在我的Postfix上,我尝试拒绝使用来自本地托pipe的域的伪地址的发件人。 但是我只想执行本地域的检查,而不是每个发件人。
所以如果example.com是在本地pipe理的,我想阻止[email protected]并让[email protected]和[email protected]通过。
我看着与reject_unverified_sender smtpd_sender_restrictions ,但我不知道如何做本地域的检查。
您正在查找的参数是smtpd_reject_unlisted_sender
smtpd_reject_unlisted_sender(默认:不)
要求Postfix SMTP服务器拒绝来自未知发件人地址的邮件,即使未指定明确的
reject_unlisted_sender访问限制。 这可以减缓蠕虫或病毒造成的伪造邮件的爆炸。当一个地址匹配一个虚拟(5)别名或一个规范(5)映射时,它总是被认为是“已知的”。
- 发件人域匹配$ mydestination , $ inet_interfaces或$ proxy_interfaces ,但发件人不在$ local_recipient_maps中列出,并且$ local_recipient_maps不为空。
- 发件人域匹配$ virtual_alias_domains,但发件人未列在$ virtual_alias_maps中。
- 发件人域匹配$ virtual_mailbox_domains,但发件人未列在$ virtual_mailbox_maps中 , $ virtual_mailbox_maps不为空。
- 发件人域匹配$ relay_domains,但发件人不在$ relay_recipient_maps中列出,并且$ relay_recipient_maps不为空。
Postfix 2.1和更高版本提供此function。
您可以通过在main.cf指定smtpd_reject_unlisted_sender = yes来启用它。 另一种方法是将reject_unlisted_sender放入smtpd_*_restriction堆栈中。
其他说明: reject_unverified_sender和reject_unlisted_sender有什么区别?
两种方法的区别在于它如何进行validation。
reject_unverified_sender postfix将通过telnetvalidation发件人到远程MX服务器,并使用recipient = unverified_sender执行未完成的SMTP事务。 如果远程服务器不拒绝收件人,则postfix假定发件人已被validation。 请参阅地址validation在Postfix文档中的工作原理 。 reject_unlisted_sender Postfix将通过查看所有域类 (本地,虚拟别名,虚拟邮箱和中继)中的有效收件人来validation发件人。