Take the 2-minute tour ×

I have a fairly standard postfix installation which is monitored using monit. Monit checks the connection every so often and when it does, the connection from localhost is somewhat polluting my log files.

Is there a way to change this logging behavior?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Not from Postfix, but if you use a new enough syslog daemon you can do it there. For example, in syslog-ng you can create a filter that matches the localhost connections and in your log statement do a conditional that excludes matches for that filter.

For example (off the top of my head check before using):

filter f_mailNoLocalhost { facility(mail) and not match("matching pattern here");};

That said, you'll probably need to know about them sooner or later and not having them will be a detriment. You could also just filter them out when running through whatever parser you are using to parse them - even if it's just your eyes. ;) Also if running a syslog daemon that doesn't have such capabilities you could set up a cron job to clean (via "grep -v pattern") after the log is rotated.

If the connection count is significant enough to be "polluting" the logs it is significant enough to keep since it may affect troubleshooting.

share|improve this answer
Worked out well. Thanks! –  astjohn Jun 1 '11 at 0:48

Your Answer


