Solved

Getting rid of ipop3d connections from system log

Posted on 1998-10-11
2
256 Views
Last Modified: 2013-11-13
I have some 150 mail users on a Redhat linux box, and my system log /var/log/messages gets flooded with messages like this one: (certain users check their mail every 60 secs...)

Oct 11 11:35:37 foobar ipop3d[6869]: connect from x.x.x.x

I want to get rid of them without having to put mail.none in syslog.conf, because I want to keep other mail related messages. I guess it's fairly simple once you know the trick, but the manpages for syslog.conf don't make much sense to me :-(
0
Comment
Question by:FloydATC
2 Comments
 
LVL 1

Accepted Solution

by:
ghjm earned 100 total points
ID: 1638249
As far as I can see, there is no way to do what you want using config files. The syslog.conf file is not capable of preventing these messages without also preventing other messages that you want to see, and the ipop3d daemon itself has no options for setting the log level.

But of course this is what we all like about Linux: When the going gets tough, go get the source code.

Assuming you have RedHat 5.1 in a box, mount the second CD and go to ...cdrom/SRPMS. Install the imap/pop source code with "rpm --install imap-4.1.final-1.src.rpm". Then, unpack the source with "rpm -bp /usr/src/redhat/SPECS/imap-4.1.final.spec". This will install the imap/pop3 source code under /usr/src/redhat/BUILD/imap-4.1.FINAL.

The files you are interested in are ipopd/ipop3d.c, ipopd/ipop2d.c, and imapd/imapd.c. Edit each of these files and search for "syslog". If you're a C programmer, just figure it out. Otherwise: For each syslog that you don't want to see any more, comment out the call using C comments: /* this is a comment */. Put the /* right before the word "syslog" and the */ right after the next semicolon (;). It is important that you comment out the entire statement, which may extend to the next line, or it won't compile.

Once you're finished making changes, cd to the base imap-4.1.FINAL directory and type
"make lnx" - if you get compilation errors, you did something wrong while editing. If the compile finishes successfully, you will have executable binaries called imapd/imapd, ipopd/ipop3d, and ipopd/ipop2d. You can install these manually or else type "make install" to have it done automatically. IF THIS IS A PRODUCTION SYSTEM, MAKE SURE TO KEEP COPIES OF THE ORIGINAL BINARIES IN CASE SOMETHING GOES WRONG. Usually you do this by renaming the original /usr/sbin/ipop3d (etc) files to ipop3d.old (etc). If worst comes to worst, you can still reinstall (perhaps with --force) from the original imapd rpm file (the precompiled binary, off RedHat CD #1). And make sure to test your newly compiled binaries before you unleash them on users...

A slicker way to approach the problem would be to write code to accept command-line parameters and control the log level at run-time.

-Graham

ps. More points please! :-)
0
 

Author Comment

by:FloydATC
ID: 1638250
Adjusted points to 100
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The purpose of this article is to demonstrate how we can use conditional statements using Python.
If you don't know how to downgrade, my instructions below should be helpful.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question