问题原文
原帖链接 · squircle · CC BY-SA 3.0
After every email sent through my mail server, postfix/anvil appends something like the following:
Nov 9 15:09:11 keutenberg postfix/anvil[30006]: statistics: max connection rate 1/60s for (smtp:103.28.42.75) at Nov 9 15:02:42
Nov 9 15:09:11 keutenberg postfix/anvil[30006]: statistics: max connection count 1 for (smtp:103.28.42.75) at Nov 9 15:02:42
Nov 9 15:09:11 keutenberg postfix/anvil[30006]: statistics: max message rate 1/60s for (smtp:103.28.42.75) at Nov 9 15:02:43
Nov 9 15:09:11 keutenberg postfix/anvil[30006]: statistics: max cache size 1 at Nov 9 15:02:42
I understand why these messages are being logged (I set up the restrictions), but I can't find any way to change anvil's log level (i.e. to suppress these informational messages from mail.log). Is there a setting I can use in my main.cf to disable these statistical messages? I'd rather stop them at the source than suppress them through a syslog setting.
已采纳解答
原帖链接 · Hunter Frazier · CC BY-SA 4.0
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
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
