如何配置 Postfix 使其仅接受来自特定域的电子邮件?
我在 /etc/postfix/sender_access 中添加了条目,例如“domain.xyz permit_auth_destination”,在文件上做了一个 postmap,并添加了以下行
"smtpd_recipient_restrictions = check_sender_access hash:/etc/postfix/sender_access"
到 main.cf
整个 smtpd_recipient_restrictions 如下所示:
smtpd_recipient_restrictions =
reject_unauth_pipelining,
check_sender_access hash:/etc/postfix/sender_access
附言:我知道邮件地址很容易被伪造,但这不是重点:)
答案1
在main.cf
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
reject_unknown_reverse_client_hostname,
reject_unknown_client_hostname,
check_client_access hash:/etc/postfix/whitelist,
reject
在/etc/postfix/whitelist
my.whitelisted.tld OK
更改my.whitelisted.tld
为您想要允许的域。
然后postmap /etc/postfix/whitelist
运行service postfix restart