如何阻止Postfix接受邮件到root@hostname.localdomain
如何阻止Postfix从外部接收邮件到本地用户@ my-FQDN?
$hostname -f hostname.example.com Postfix接受邮件到my-FQDN的任何本地用户.因此,我们将使用root@hostname.example.com作为示例本地用户,我想停止从外部接收邮件. 我有一个非常基本的Postfix / Dovecot / SASL / LDA设置,但让我分享一些细节. >接收虚拟本地域/用户的邮件:25 我试过在/ etc / aliases和Postfix的virtual_alias_maps.cf中反转用户,但没有运气.我在更新后运行newaliases和postmap. #/etc/aliases: #root: user@example.com #/etc/postfix/virtual_alias_maps.cf: root user@example.com 我想我还有四个(更新的)选择… >在postfix / main.cf中,搞乱mydestination.我很确定我需要在这里保留我的FQDN,所以我不认为删除它是一个不错的选择.编辑:是的,虽然从mydestination删除你的FQDN禁止外界向本地用户发送邮件,但这不是禁用它的正确方法,因为这会影响其他东西. 这是我的Postfix main.cf的相关部分: myhostname = hostname.example.com mydomain = example.com mydestination = $myhostname,localhost.$mydomain,localhost smtpd_recipient_restrictions = reject_unknown_recipient_domain,reject_non_fqdn_recipient,reject_unauth_destination,permit_mynetworks,permit 这是我的Postfix master.cf的相关部分: submission inet n - - - - smtpd -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes -o smtpd_sasl_type=dovecot -o smtpd_sasl_path=private/auth -o smtpd_recipient_restrictions= reject_unknown_recipient_domain,permit_sasl_authenticated,reject 附:这是HowTo我从VirtualUserFlatFilesPostfix开始采用了很多设置 解决方法
你提到smtp_recipient_restrictions,你真的尝试过添加行check_recipient_access哈希:/ etc / postfix / recipient_access吗?
将它放在reject_unknown_recipient_domain之前的第一行,然后放在/ etc / postfix / recipient_access中
(别忘了postmap / etc / postfix / recipient_access) 顺便说一句,postmaster地址应该始终可用,但我从未见过一个RFC说root必须可用,尽管我还没有阅读每一个与SMTP相关的RFC. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |