大网数据广告活动
服务器运维问答

How can I suppress Postfix anvil statistics from system logs?

· 52CE 我爱测

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 No…

问题原文

原帖链接 · 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

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2014-11-09)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。