Postfix 每 5 分钟发送和接收一次相同的电子邮件,持续 4 个月以上

Jam*_*ppe 12 email postfix malware amavis

回到六月,我给自己发送了 EICAR 测试签名,以确保我的 postfix/amavis/spamassassin 等设置正常工作。我当时没有注意到,但这不知何故在时空连续体中造成了撕裂,或者邮件服务器每 5 分钟一次又一次地将其发送给自己。

Oct  7 20:25:39 yavin postfix/smtpd[5598]: connect from localhost[127.0.0.1]
Oct  7 20:25:39 yavin postfix/smtpd[5598]: 886FA1A14B0: client=localhost[127.0.0.1]
Oct  7 20:25:39 yavin postfix/cleanup[5600]: 886FA1A14B0: message-id=<20111007072539.886FA1A14B0@yavin.mydomain.com>
Oct  7 20:25:39 yavin postfix/smtpd[5598]: disconnect from localhost[127.0.0.1]
Oct  7 20:25:39 yavin postfix/qmgr[2911]: 886FA1A14B0: from=<>, size=1610, nrcpt=1 (queue active)
Oct  7 20:25:39 yavin postfix/smtpd[5598]: connect from localhost[127.0.0.1]
Oct  7 20:25:39 yavin postfix/smtpd[5598]: A9C0E1A14B1: client=localhost[127.0.0.1]
Oct  7 20:25:39 yavin postfix/cleanup[5600]: A9C0E1A14B1: message-id=<VAAyuN8taIpfBV@yavin.mydomain.com>
Oct  7 20:25:39 yavin postfix/smtp[5601]: 886FA1A14B0: to=<virii@mydomain.com>, relay=192.168.178.251[192.168.178.251]:25, delay=0.23, delays=0.1/0.04/0.03/0.06, dsn=2.6.0, status=sent (250 2.6.0  <20111007072539.886FA1A14B0@yavin.mydomain.com> Queued mail for delivery)
Oct  7 20:25:39 yavin postfix/qmgr[2911]: 886FA1A14B0: removed
Oct  7 20:25:39 yavin postfix/smtpd[5598]: disconnect from localhost[127.0.0.1]
Oct  7 20:25:39 yavin postfix/qmgr[2911]: A9C0E1A14B1: from=<postmaster@mydomain.com>, size=2037, nrcpt=1 (queue active)
Oct  7 20:25:39 yavin amavis[2720]: (02720-06) Blocked INFECTED (Eicar-Test-Signature), <spambin@mydomain.com> -> <spambin@mydomain.com>, quarantine: virii@mydomain.com, mail_id: AyuN8taIpfBV, Hits: -, size: 576, 606 ms
Oct  7 20:25:39 yavin postfix/smtp[5601]: A9C0E1A14B1: to=<postmaster@mydomain.com>, relay=192.168.178.251[192.168.178.251]:25, delay=0.09, delays=0.04/0/0/0.04, dsn=2.6.0, status=sent (250 2.6.0  <VAAyuN8taIpfBV@yavin.mydomain.com> Queued mail for delivery)
Oct  7 20:25:39 yavin postfix/qmgr[2911]: A9C0E1A14B1: removed
Run Code Online (Sandbox Code Playgroud)

当我今天更改配置以将受病毒感染的邮件路由到 virii@mydomain.com 地址而不是垃圾邮件服务器上的文件时,我偶然发现了这个问题。似乎这四个月以来每 5 分钟重新发送一次。

今晚 7 点重新启动垃圾邮件服务器后,我似乎暂时停止了它,并认为它已解决,但在晚上 8 点 16 分,我再次收到该消息,此后每 5 分钟一次。它开始让我有点疯狂。

帮助?

编辑:在将配置更改回将病毒存储在服务器上而不是邮箱中时,问题仍然存在:

Oct  7 22:05:40 yavin amavis[5476]: (05476-01) Blocked INFECTED (Eicar-Test-Signature), <spambin@mydomain.com> -> <spambin@mydomain.com>, quarantine: virus-QhKp9pHFTZiG, mail_id: QhKp9pHFTZiG, Hits: -, size: 576, 795 ms
Run Code Online (Sandbox Code Playgroud)

我每 5 分钟收到一次文件,而不是电子邮件。

编辑 2:配置恢复和重启 Postfix 和 Amavis 后的新完整日志:

Oct  8 02:43:40 yavin postfix/smtpd[12710]: connect from localhost[127.0.0.1]
Oct  8 02:43:40 yavin postfix/smtpd[12710]: 2DD331A1600: client=localhost[127.0.0.1]
Oct  8 02:43:40 yavin postfix/cleanup[12706]: 2DD331A1600: message-id=<VAnB9ZAvBkol-I@yavin.mydomain.com>
Oct  8 02:43:40 yavin postfix/smtpd[12710]: disconnect from localhost[127.0.0.1]
Oct  8 02:43:40 yavin postfix/qmgr[10957]: 2DD331A1600: from=<postmaster@mydomain.com>, size=2040, nrcpt=1 (queue active)
Oct  8 02:43:40 yavin amavis[10975]: (10975-14) Blocked INFECTED (Eicar-Test-Signature), <spambin@mydomain.com> -> <spambin@mydomain.com>, quarantine: virus-nB9ZAvBkol-I, mail_id: nB9ZAvBkol-I, Hits: -, size: 579, 475 ms
Oct  8 02:43:40 yavin postfix/smtp[12711]: 2DD331A1600: to=<postmaster@mydomain.com>, relay=192.168.178.251[192.168.178.251]:25, delay=0.11, delays=0.05/0/0/0.05, dsn=2.6.0, status=sent (250 2.6.0  <VAnB9ZAvBkol-I@yavin.mydomain.com> Queued mail for delivery)
Oct  8 02:43:40 yavin postfix/qmgr[10957]: 2DD331A1600: removed
Run Code Online (Sandbox Code Playgroud)

mai*_*ilq 12

问题在于您的 Amavis 设置。

您的隔离目的地似乎是一个邮件地址。因此,Amavis 将病毒邮件注入 Postfix 以发送到该地址。Postfix 现在决定先扫描邮件并委托给 Amavis。Amavis 识别病毒并尝试通过发送到隔离邮件地址来隔离它。所以 ...

你得到了恶性循环,对吧?要么将邮件隔离到文件夹或数据库中,要么定义一个例外以不扫描隔离邮件中的病毒。

编辑到提问者的编辑

现在消息 ID 是不同的。这意味着它们是具有(令人惊讶的)相同内容的不同消息。这让我相信它要么是一个 cron 作业,要么是某种不断发送相同内容(而不是相同邮件)的监控软件。

最后,James 发现他的 Nagios 监控软件一直在发送......


Jam*_*ppe 5

好家伙。

所以,我想通了。原来这是一个 Nagios 脚本,用于检查 amavis 是否正在运行,更重要的是,对于这个特定问题,检查 AV 引擎是否正常工作……通过向它发送 EICAR 病毒。

如果有人感兴趣,http://exchange.nagios.org/directory/Plugins/Anti-2DVirus/Amavis/check_amavis/details是有问题的脚本。

感谢所有试图提供帮助的人,您绝对帮助我解决了所有问题!