我有几个电子邮件别名转发到外部主机。 目前,如果外部主机拒绝消息,Exim会生成退回消息并将其发送给原始发件人。 这是不好的,因为如果外部主机拒绝邮件作为垃圾邮件(一种常见的情况),那么我是反向垃圾邮件的来源。
因此,如果发件人是非本地的,我想将邮件反弹给postmaster(我)。 或者,发送所有反弹到邮政总局将是足够好的。
Exim文档提示可以这样做(“当消息传递失败时… Exim向原始发送者发送消息,或者向另一个configuration的地址发送消息,强调增加了),但我找不到。
例如,这是一个日志摘录,显示反垃圾邮件被创build(在这种情况下,声称的源服务器不接受连接)。 [email protected]是发送给[email protected]的垃圾电子邮件的[email protected] ,然后转发给[email protected] ; GMail然后拒绝这个消息,我的服务器创build一个反弹到[email protected] 。 我想要反弹到[email protected] 。 (用户名混淆;日志的其余部分是逐字的。)
2011-10-03 12:03:08 1RAkyw-0000cj-45 <= [email protected] H=(gyajnj.com [113.190.35.111] P=esmtp S=33927 [email protected] 2011-10-03 12:03:09 1RAkyw-0000cj-45 ** [email protected] <[email protected]> R=dnslookup T=remote_smtp: SMTP error from remote mail server after end of data: host gmail-smtp-in.l.google.com [74.125.47.26]: 552-5.7.0 Our system detected an illegal attachment on your message. Please\n552-5.7.0 visit http://mail.google.com/support/bin/answer.py?answer=6590 to\n552 5.7.0 review our attachment guidelines. i3si13239001yhk.107 2011-10-03 12:03:09 1RAkyz-0000cm-H5 <= <> R=1RAkyw-0000cj-45 U=Debian-exim P=local S=35124 2011-10-03 12:03:09 1RAkyw-0000cj-45 Completed 2011-10-03 12:03:30 1RAkyz-0000cm-H5 nacha.net [64.212.215.180] Connection timed out 2011-10-03 12:03:30 1RAkyz-0000cm-H5 == [email protected] R=dnslookup T=remote_smtp defer (110): Connection timed out
这里是相关的路由器:
dnslookup: debug_print = "R: dnslookup for $local_part@$domain" driver = dnslookup domains = ! +local_domains transport = remote_smtp same_domain_copy_routing = yes # ignore private rfc1918 and APIPA addresses ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 192.168.0.0/16 :\ 172.16.0.0/12 : 10.0.0.0/8 : 169.254.0.0/16 :\ 255.255.255.255 no_more
有些规则是愚蠢的,因为它们会造成更多的伤害 鼓吹和创造他们的人都知道这一点。 我会更关心邮政pipe理者的道德,而不是愚蠢的规则。 我讨厌愚蠢的规则,显然是人们设定这些规则。 如果你像我一样,意识到后果(见上文),并想要拧紧规则,那么当然,
1)build立发件人和收件人validation,以确保自己或
2)失败或冻结所有空postmaster反弹。 做一个exim系统filter
system_filter = /etc/exim/screwtherules.exim vi /etc/exim/screwtherules.exim if $sender_address is "" then if ${lookup{${extract{2}{@}{$recipients}}}lsearch{/etc/localdomains}{yes}{no}} is "no" then fail text "Delayed bounce message ignored" seen finish endif endif
3)或在acl_smtp_data检查时间创build一个ACL来转发,失败或冻结发送到或不发送到特定主机的空popup电子邮件。 您可以按照https://grepular.com/Exim_Trick_to_Extract_Received_Header_IP_Addresses中所述提取收到的标题信息
您的方法违反了RFC 5321,您必须将其发送或退回给发件人。 只有非常有限的例外: http : //tools.ietf.org/html/rfc5321#section-6.2
所以你有三个select
去选项3.但更好的是在转发这些邮件之前禁止转发邮件或增加垃圾邮件过滤。
做到这一点的方法是在路由器中使用errors_to指令。 我相信Exim也支持一些条件select性地做。