Postfix:不要为远程服务器的 virtual_alias_maps 创建退回邮件

Postfix:不要为远程服务器的 virtual_alias_maps 创建退回邮件

我用virtual_alias_maps它来将邮件转发到远程邮件服务器(GMail、icloud)。我自己设置了垃圾邮件防护措施(SPF 检查、队列前内容过滤器等),但 Postfix 通常会接受足够多的垃圾邮件,将其排入队列,然后上游邮件服务器可能会拒绝它,这会导致 Postfix 发送退回邮件。我宁愿首先拒绝邮件,类似于队列前内容过滤器检测到它是垃圾邮件时的情况。

https://stackoverflow.com/a/30175673/15690建议使用discard服务bounce(可能使用 缩小范围header_checks),但这仍会丢弃退回邮件(即默默丢弃邮件),而不是首先拒绝它。此外,我不清楚如何将其应用于某些情况,例如,当virtual_alias_maps被普遍使用和/或用于特定返回代码时(不丢弃合法退回邮件,例如,如果帐户已关闭等)。

Postfix 是否可以不将要通过virtual_alias_maps(或来自那里的某些域)转发的邮件排入队列,而是充当代理(即类似于smtpd_proxy_filter但到远程服务器)。

这是针对小型邮件服务器的,因此可以为此阻止一个接收 smtpd 服务器。如果这些邮件从未以任何方式在本地排队,那就太好了。

日志如下所示:

postfix/smtpd[5364]: connect from source.com[X.X.X.X]
postfix/smtpd[5364]: NOQUEUE: client=source.com[X.X.X.X]
postfix/smtpd[5372]: connect from amavis[internal24]
postfix/smtpd[5372]: D6749620E2: client=amavis[internal24], orig_client=source.com[X.X.X.X]
postfix/cleanup[5373]: D6749620E2: message-id=<[email protected]>
postfix/qmgr[12066]: D6749620E2: from=<[email protected]>, size=5076, nrcpt=1 (queue active)
postfix/smtpd[5372]: disconnect from amavis[internal24]
postfix/smtpd[5364]: proxy-accept: END-OF-MESSAGE: 250 2.0.0 from MTA(smtp:[internal25]:10025): 250 2.0.0 Ok: queued as D6749620E2; from=<[email protected]> to=<recipient@postfix> proto=ESMTP helo=<source.com>
postfix/smtpd[5364]: disconnect from source.com[X.X.X.X]
postfix/smtp[5374]: D6749620E2: to=<[email protected]>, orig_to=<recipient@postfix>, relay=mx4.mail.icloud.com[17.178.97.73]:25, delay=3.1, delays=0.07/0.01/1.7/1.3, dsn=5.7.1, status=bounced (host mx4.mail.icloud.com[17.178.97.73] said: 550 5.7.1 [CS01] Message rejected due to local policy. Please visit https://support.apple.com/en-us/HT204137 (in reply to end of DATA command))
postfix/cleanup[5373]: 198966214E: message-id=<[email protected]>
postfix/qmgr[12066]: 198966214E: from=<>, size=7279, nrcpt=1 (queue active)
postfix/bounce[5375]: D6749620E2: sender non-delivery notification: 198966214E
postfix/cleanup[5373]: 2E1286214F: message-id=<[email protected]>
postfix/qmgr[12066]: 2E1286214F: from=<[email protected]>, size=4880, nrcpt=1 (queue active)
postfix/bounce[5375]: D6749620E2: postmaster non-delivery notification: 2E1286214F
postfix/qmgr[12066]: D6749620E2: removed
postfix/smtp[5374]: 198966214E: to=<[email protected]>, relay=source.com[185.207.8.246]:25, delay=0.14, delays=0.08/0/0.05/0, dsn=4.0.0, status=deferred (host source.com[185.207.8.246] refused to talk to me: 421 Too many concurrent SMTP connections; please try again later.)

相关内容