Postfix“发件人地址被拒绝:不属于用户”

Postfix“发件人地址被拒绝:不属于用户”

我在 AWS 上设置了一个 Postfix/Dovecot 邮件服务器。我已实施自签名 TLS 授权,从外部 TBird 客户端连接到它并尝试发送/接收电子邮件。TBird 能够检测到我的服务器并且可以正常接收电子邮件,但我尝试发送时出现错误:

  NOQUEUE: reject: RCPT from <<LOCAL BOX>>: 553
 5.7.1 <<[email protected]>>: Sender address rejected: not owned by user username; from=<<[email protected]>>
 to=<<[email protected]>> proto=ESMTP helo=<<[192.168.1.148]>>

错误发生后,我可以保存草稿。

我可以手动将 openssl 放入 587 并完成身份验证,但是当我使用 rcpt 命令时,出现相同的错误。

这是我第一次发帖,如果需要提供更多信息,请告诉我:

后配置-n

alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases broken_sasl_auth_clients = yes command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 1 home_mailbox = Maildir/ html_directory = no inet_interfaces = all inet_protocols = all mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain mydomain = mydomain.tld myhostname = mail.mydomain.tld mynetworks = 168.100.189.0/28, 127.0.0.0/8 myorigin = $mydomain newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES relay_domains = sample_directory = /usr/share/doc/postfix-2.6.6/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtp_helo_name = $myhostname smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination smtpd_sasl_auth_enable = yes smtpd_sasl_path = private/auth smtpd_sasl_security_options = noanonymous smtpd_sasl_type = dovecot smtpd_sender_restrictions = permit_mynetworks, permit_sasl_authenticated smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem smtpd_tls_auth_only = no smtpd_tls_cert_file = /etc/postfix/ssl/mail.anythingbox.org.crt smtpd_tls_key_file = /etc/postfix/ssl/mail.anythingbox.org.key smtpd_use_tls = yes tls_random_source = dev:/dev/urandom unknown_local_recipient_reject_code = 550

对 main.cf 的更改

smtp_helo_name = $myhostname
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sender_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated

smtpd_recipient_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        reject_unauth_destination
smtpd_use_tls = yes
smtpd_tls_auth_only = no
smtpd_tls_key_file = /etc/postfix/ssl/mail.mydomain.tld.key
smtpd_tls_cert_file = /etc/postfix/ssl/mail.mydomain.tld.crt
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
tls_random_source = dev:/dev/urandom

我花了一天时间浏览每一个谷歌搜索结果,但似乎无法找到任何方法来解决这个问题......任何帮助都非常感谢。

答案1

您可以在 postfix 中使用 smtpd_sender_login_maps。这是一个

可选查找表,其中包含发件人(MAIL FROM)地址的 SASL 登录名

在 /etc/postfix/main.cf 中

smtpd_sender_login_maps = hash:/etc/postfix/smtpd_sender_login_maps

包含内容

[email protected] username

或者如果你使用虚拟邮箱,你可以映射到它们

smtpd_sender_login_maps = $virtual_mailbox_maps
virtual_mailbox_maps = hash:/etc/postfix/virtual-mailbox-users

答案2

对我来说reject_sender_login_mismatch

我将其从smtpd_sender_restrictions价值中删除

相关内容