海量的数据每分钟写入一次mail.log

我在Ubuntu服务器上,每分钟一次写入我的/var/log/mail.log大量的行。 线条看起来像:

Mar 11 17:39:08 Ubuntu-1010-maverick-32-minimal postfix/qmgr[1085]: 75A8B17150: from=<[email protected]>, size=769, nrcpt=1 (queue active) Mar 11 17:39:08 Ubuntu-1010-maverick-32-minimal postfix/qmgr[1085]: 7F70417129: from=<>, size=2900, nrcpt=1 (queue active) Mar 11 17:39:08 Ubuntu-1010-maverick-32-minimal postfix/qmgr[1085]: 7BD0616D9D: from=<>, size=2819, nrcpt=1 (queue active) Mar 11 17:39:08 Ubuntu-1010-maverick-32-minimal postfix/qmgr[1085]: 7A10716D88: from=<>, size=2841, nrcpt=1 (queue active) Mar 11 17:39:08 Ubuntu-1010-maverick-32-minimal postfix/qmgr[1085]: 7AA5C107FC3: from=<[email protected]>, size=778, nrcpt=1 (queue active) Mar 11 17:39:08 Ubuntu-1010-maverick-32-minimal postfix/qmgr[1085]: 7462F433F8: from=<>, size=2870, nrcpt=1 (queue active) 

要么

  Mar 11 17:54:26 Ubuntu-1010-maverick-32-minimal postfix/error[3500]: 729BE4CF6C: to=<[email protected]>, orig_to=<root>, relay=none, delay=134965, delays=134937/29/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to example.org[2606:2800:220:1:248:1893:25c8:1946]:25: Network is unreachable) Mar 11 17:54:26 Ubuntu-1010-maverick-32-minimal postfix/error[3488]: 73FAB4D467: to=<[email protected]>, orig_to=<root>, relay=none, delay=55045, delays=55016/29/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to example.org[2606:2800:220:1:248:1893:25c8:1946]:25: Network is unreachable) Mar 11 17:54:26 Ubuntu-1010-maverick-32-minimal postfix/error[3504]: 7B460870F2: to=<[email protected]>, orig_to=<root>, relay=none, delay=256705, delays=256676/29/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to example.org[2606:2800:220:1:248:1893:25c8:1946]:25: Network is unreachable) 

问题是 – 我和我的cronjob都没有试图发送任何东西。 那么这里发生了什么?

你的邮件服务器中有一些你不知道的东西,后缀正试图使用​​ipv6将电子邮件转移到某个远程服务器,但是这个连接始终失败。 如果主机上可用,Postfix更喜欢使用ipv6,但是您的本地networking或远程主机可能不支持ipv6。 我们在我们的内部服务器上有这个问题,当我们第一次开始在我们的办公networking上推出ipv6时。

为防止postfix使用ipv6,请更新后缀configuration以便如此设置variables:

 inet_protocols = ipv4 

然后重新启动postfix

 service postfix restart 

现在postfix将只使用ipv4连接。 在Ubuntu上,这是在/etc/postfix/main.cf文件中。

许多应用程序和服务都设置为发送电子邮件到根错误,并且您的服务器上至less有一个这样的电子邮件。 要查看未决电子邮件,请使用

 mailq 

问题重新出现了。 所以我不能接受user208998的回答了。

原因是cron。 我的一个cronjob退出失败。 我没有注意到,因为实际的任务是正确执行的。 因为我没有设置MAILTO环境variables,所以cron试图通过电子邮件通知用户root。 由于不知名的原因,cron认为我的主机名是“example.org”。

为他人提供类似问题的信息:发现问题的起源是一个重合。 你可以确定发送邮件的过程,当然是“后缀”。 但是,我无法确定postfix发送邮件的过程。