当我尝试通过经过身份验证的 SMTP 服务器从我家用计算机上的客户端发送电子邮件到 时出现以下错误[email protected]
。
Oct 17 09:21:40 debian postfix/smtpd[1643]: NOQUEUE: reject: RCPT from
unknown[x.x.x.x]: 553 5.7.1 <[email protected]>: Sender address rejected:
not owned by user [email protected]; from=<[email protected]>
to=<[email protected]> proto=ESMTP helo=<[192.168.1.5]>
我最终正在寻找错误修复方法,但目前我想知道哪些配置参数main.cf
可以修复它。例如,我应该摆弄smtpd_sender_restrictions
、smtpd_relay_restrictions
或吗smtpd_recipient_restrictions
?我无法通过使任何先前的参数尽可能宽松来消除错误。
编辑:这是我当前配置的相关部分,尽管我主要在寻找可能导致地址被拒绝的几个 Postfix 参数。
relay_domains = *
smtpd_sender_restrictions =
permit_mynetworks,
permit_sasl_authenticated
smtpd_relay_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination,
reject_rbl_client zen.spamhaus.org,
reject_rhsbl_reverse_client dbl.spamhaus.org,
reject_rhsbl_helo dbl.spamhaus.org,
reject_rhsbl_sender dbl.spamhaus.org,
smtpd_data_restrictions = reject_unauth_pipelining
并且master.cf
:
submission inet n - - - - smtpd
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_security_options=noanonymous
-o smtpd_client_restrictions=permit_sasl_authenticated
-o smtpd_sender_restrictions=reject_sender_login_mismatch
答案1
根据手册smtpd_sender_login_maps需要设置。将其设置为与虚拟邮箱映射对我有用。例如:
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
smtpd_sender_login_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
此外,如果您的地图位于数据库中,请记住您需要实际选择一个字段,而不仅仅是像某些操作指南建议的那样选择“1”。
# good
query = SELECT email FROM postfix_mailbox_maps where email = '%s';
# bad
query = SELECT 1 FROM postfix_mailbox_maps where email = '%s';
答案2
添加此项: smtpd_sender_restrictions =允许_sasl_已认证在 main.cf 中
答案3
尝试一下这个,这是我的服务器的配置方式(如果您的域不是“虚拟的”,请找到相应的选项):
保留您最初问题中的现有选项,我不认为它们是问题。
在 main.cf 中添加此内容:
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_mailbox_domains = hash:/etc/postfix/virtual-mailbox-domains
virtual_mailbox_maps = hash:/etc/postfix/virtual-mailbox-users
/etc/postfix/virtual (可能与您无关):
[email protected] [email protected]
[email protected] [email protected]
[email protected] [email protected]
/etc/postfix/虚拟邮箱域
exemple.com OK
/etc/postfix/virtual-mailbox-users(这是重点部分)
[email protected] [email protected]
[email protected] [email protected]
答案4
更改为 smtpd_sender_restrictions = permit_sasl_authenticated,删除 #permit_mynetworks,。