How can I suppress Postfix anvil statistics from system logs?
If you want to change the frequency of the logs you can set anvil_status_update_time
in main.cf
. The default is 600s. http://www.postfix.org/postconf.5.html#anvil_status_update_time
Two hours worked better for me, than using the default 10 minutes, but it will vary depending on the environment obviously.
anvil_rate_time_unit = 60s
anvil_status_update_time = 2h
Also, in order to solve an issue I had with long delay in logging of incoming mail, I had to configure the following settings. If you notice your incoming mail logs aren't updating when they should be, try this:
smtpd_error_sleep_time = 2s
smtpd_soft_error_limit = 10
smtpd_hard_error_limit = 20
*If your server gets less than 1 email per 600s
The anvil daemon by default logs statistics when it exits. Since the default idle time is 600s, you will continue to receive anvil logs every 10 minutes in the event no email is received.
This can be changed to a longer time-span by adding -o max_idle
to master.cf
anvil unix - - n - 1 anvil -o max_idle=3600s
Beware this setting will override your ability to limit client connection.
There is a parameter in main.cf
to suppress the anvil process. This parameter is called smtpd_client_event_limit_exceptions. The purpose of this parameter is to exclude some client from smtpd_client_*_count/rate_limit restrictions. In your case, you should specify it in main.cf
smtpd_client_event_limit_exceptions = static:all
This will make all IP address listed as clients that are excluded from smtpd_client_*_count/rate_limit restrictions. Thus this setting will suppress anvil log because there is nothing to log.
Source: similar question in postfix mailing list.