Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Getting rid of ipop3d connections from system log

Posted on 1998-10-11
2
Medium Priority
?
273 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 400 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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
This article will show you step-by-step instructions to build your own NTP CentOS server.  The network diagram shows the best practice to setup the NTP server farm for redundancy.  This article also serves as your NTP server documentation.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month7 days, 3 hours left to enroll

783 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