我最近从Courier迁移到了Dovecot。我在配置Postfix + MySQL + Dovecot时遵循的主要指南是:https://library.linode.com/email/postfix/postfix2.9.6-dovecot2.0.19-mysql
一切都很完美,但是当我更改邮件客户端中的邮件地址,保留服务器的正确登录名和密码,并发送带有该假邮件(和域)地址的电子邮件时,Postfix只是发送它,而不验证如果该电子邮件地址存在于数据库中,并且未验证该电子邮件地址是否是我的。
因此,我的SMTP配置一定有问题。 这是我的实际配置:
# Requirements for the sender details
smtpd_reject_unlisted_sender = yes
smtpd_reject_unlisted_recipient = yes
smtpd_sender_restrictions =
warn_if_reject,
permit_mynetworks,
permit_sasl_authenticated,
reject_non_fqdn_sender,
reject_unknown_sender_domain,
reject_unauth_pipelining,
reject_unlisted_sender,
reject_unverified_sender,
permit
# Requirements for the connecting server
smtpd_client_restrictions =
reject_rbl_client zen.spamhaus.org,
reject_rbl_client blackholes.easynet.nl,
reject_rbl_client bl.spamcop.net,
permit
# Requirement for the recipient address
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_pipelining,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
reject_unauth_destination,
reject_unlisted_recipient,
reject_unverified_recipient,
check_policy_service inet:127.0.0.1:10023,
permit
smtpd_data_restrictions =
reject_unauth_pipelining
# require proper helo at connections
smtpd_helo_required = yes
# waste spammers time before rejecting them
smtpd_delay_reject = yes
isable_vrfy_command = yes
任何?
答案 0 :(得分:2)
reject_unlisted_sender
中列出的smtpd_sender_restrictions
限制列在permit_mynetworks
和permit_sasl_authenticated
之后。 Postfix按顺序遍历限制列表,并在遇到第一个许可/拒绝时终止,因此永远不会到达reject_unlisted_sender
。由于reject_unauth_destination
未拒绝您的邮件,因此permit_mynetworks
或permit_sasl_authenticated
必须接受该邮件。
此外,除非您使用的发件人地址具有Postfix实际上“拥有”的域部分(即列在mydestination
,virtual_mailbox_domains
,virtual_alias_domains
或{{1}中}),它无法验证,relay_domains
将无法正常工作。请参阅postconf(5) man page。
其他观察:
reject_unlisted_sender
限制位于warn_if_reject
之前。因为后者从不拒绝任何事情,permit_mynetworks
限制没有用处。warn_if_reject
和reject_unlisted_recipient
,因此无需设置reject_unlisted_sender
和smtpd_reject_unlisted_sender
。smtpd_reject_unlisted_recipient
是隐含的,可以删除。permit
。disable_vrfy_command
。启用smtpd_recipient_restrictions
后,无论如何都会在收件人阶段评估所有限制,单个列表通常会使配置更容易理解。