我们运行Postfix邮件服务器。 它是后缀+ spamassasin + cyrus + MailScanner + MySQL。 主邮件服务器由一个域(example.com)使用(总共两个域)。 Postfix将MySQL用于虚拟域和用户。 另外我把一个域example.com重写为example.biz 。
服务器在大约7年前build立(configuration)。 这是postconf -n
问题是,在日志文件中,我看到一些random recipients虚拟域。 我读了Postfix Backscatter Howto和这个问题 。 此时服务器正在将传送状态通知发送回该发件人。 我尝试了各种configuration,但没有运气。 这里是从smtp日志输出
postfix/smtpd[29764]: >>> CHECKING RECIPIENT MAPS <<< postfix/smtpd[29764]: ctable_locate: leave existing entry key [email protected] postfix/smtpd[29764]: maps_find: recipient_canonical_maps: [email protected]: not found postfix/smtpd[29764]: match_string: example.com ~? mysql:/etc/postfix/mysql-mydestination.cf(0,lock|fold_fix) postfix/smtpd[29764]: dict_mysql_get_active: attempting to connect to host unix:/var/run/mysqld/mysqld.sock postfix/smtpd[29764]: dict_mysql: successful connection to host unix:/var/run/mysqld/mysqld.sock postfix/smtpd[29764]: dict_mysql: successful query from host unix:/var/run/mysqld/mysqld.sock postfix/smtpd[29764]: dict_mysql_lookup: retrieved 0 rows postfix/smtpd[29764]: match_list_match: example.com: no match postfix/smtpd[29764]: maps_find: recipient_canonical_maps: hash:/etc/postfix/myrecipientmap(0,lock|fold_fix): @example.com = @example.biz postfix/smtpd[29764]: mail_addr_find: [email protected] -> @example.biz postfix/smtpd[29764]: smtpd_check_rewrite: trying: permit_inet_interfaces postfix/smtpd[29764]: permit_inet_interfaces: mail-lf0-f51.google.com 209.85.215.51 postfix/smtpd[29764]: before input_transp_cleanup: cleanup flags = enable_header_body_filter enable_automatic_bcc enable_address_mapp postfix/smtpd[29764]: after input_transp_cleanup: cleanup flags = enable_header_body_filter enable_automatic_bcc enable_address_mappi postfix/smtpd[29764]: connect to subsystem public/cleanup postfix/smtpd[29764]: public/cleanup socket: wanted attribute: queue_id postfix/smtpd[29764]: input attribute name: queue_id postfix/smtpd[29764]: input attribute value: 6564E15F890 postfix/smtpd[29764]: public/cleanup socket: wanted attribute: (list terminator) postfix/smtpd[29764]: input attribute name: (end) postfix/smtpd[29764]: send attr flags = 50 postfix/smtpd[29764]: 6564E15F890: client=mail-lf0-f51.google.com[209.85.215.51] postfix/smtpd[29764]: > mail-lf0-f51.google.com[209.85.215.51]: 250 2.1.5 Ok postfix/smtpd[29764]: < mail-lf0-f51.google.com[209.85.215.51]: DATA
在日志中我看到,在数据库dict_mysql_lookup: retrieved 0 rows找不到的随机用户dict_mysql_lookup: retrieved 0 rows 。 所以,这是正确的。 但是它不会在SMTP级别被拒绝。 很明显, 我的configuration有问题 。
我尝试在smtpd_recipient_restrictions指令中添加虚拟用户查找,并更改了permit reject但没有运气。
我想要做的是改变后缀的行为,以便在SMTP交易过程中拒绝邮件,而不是生成邮件forms的MAILER-DAEMON邮件。
那么,似乎虽然你没有在虚拟域名下的这样一个帐户,你实际上有一些原因为这个域设置规范映射:
postfix/smtpd[29764]: maps_find: recipient_canonical_maps: hash:/etc/postfix/myrecipientmap(0,lock|fold_fix): @example.com = @example.biz
Canonical(5)手册明确指出:
@domain address Replace other addresses in domain by address. This form has the lowest precedence. Note: @domain is a wild-card. When this form is applied to recipient addresses, the Postfix SMTP server accepts mail for any recipient in domain, regardless of whether that recipient exists. This may turn your mail system into a backscatter source: Postfix first accepts mail for non-existent recipients and then tries to return that mail as "undeliverable" to the often forged sender address.
总之,你应该停止在规范地图中使用这种forms的别名,并为此使用虚拟别名地图。