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

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

我在运行 Parabola GNU/Linux-libre(基于 Arch 和 ALARM)和 Dovecot 的 SBC 上安装了 Postfix。

它运行得很好,我已经在 Thunderbird 中设置了一个帐户。我发现的唯一问题是,在发送电子邮件时,我收到:

Sender address rejected: not owned by user megver83

我到处寻找解决方案,例如

但什么都没有,这真是太疯狂了。有时他们解决问题是通过使用 MySQL,但遗憾的是 MySQL 在我的服务器上不起作用,所以我安装了 PostgreSQL 以防万一。

邮件日志:

Aug 28 16:27:30 localhost postfix/smtpd[12064]: connect from gateway[192.168.50.1]
Aug 28 16:27:31 localhost postfix/smtpd[12064]: Anonymous TLS connection established from gateway[192.168.50.1]: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
Aug 28 16:27:31 localhost postfix/trivial-rewrite[12070]: warning: do not list domain eumela.ga in BOTH mydestination and virtual_alias_domains
Aug 28 16:27:31 localhost postfix/trivial-rewrite[12070]: warning: do not list domain eumela.ga in BOTH mydestination and virtual_mailbox_domains
Aug 28 16:27:31 localhost postfix/smtpd[12064]: NOQUEUE: reject: RCPT from gateway[192.168.50.1]: 553 5.7.1 <[email protected]>: Sender address rejected: not owned by user megver83; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<[192.168.50.10]>
Aug 28 16:27:33 localhost postfix/smtpd[12064]: disconnect from gateway[192.168.50.1] ehlo=2 starttls=1 auth=1 mail=1 rcpt=0/1 quit=1 commands=6/7

这里^我试图自动给我发送一封邮件,但我写信给的所有地址都发生了这种情况。

$ postconf -n
alias_database = $alias_maps
alias_maps = hash:/etc/postfix/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
command_directory = /usr/bin
compatibility_level = 2
daemon_directory = /usr/lib/postfix/bin
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_owner = postfix
mailbox_size_limit = 134217728
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
message_size_limit = 134217728
meta_directory = /etc/postfix
mydestination = localhost.$mydomain, localhost, $mydomain, smtp.$mydomain
mydomain = eumela.ga
myhostname = pi.eumela.ga
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix
relay_domains = *
relayhost =
sample_directory = /etc/postfix
sendmail_path = /usr/bin/sendmail
setgid_group = postdrop
shlib_directory = /usr/lib/postfix
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = $virtual_mailbox_maps
smtpd_tls_cert_file = /etc/letsencrypt/live/smtp.eumela.ga/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/smtp.eumela.ga/privkey.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
unknown_local_recipient_reject_code = 550
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

答案1

您的 SASL 配置参数看起来正确 - Postfix 将依赖 Dovecot 进行身份验证。我假设您的身份验证正在工作[1]。您验证的用户可能与电子邮件发件人地址不同。您想告诉 Postfix 哪些经过身份验证的用户地图给其他发件人。顺便说一下,接收也一样,您可以通过系统用户/etc/aliases或其他方式将收件人别名为系统用户。

这些线条显示了要看的地方

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

并相应地编辑文件,例子

#  envelope sender   owner (SASL login names)
[email protected]   user

然后运行postmap -f /etc/postfix/virtual-mailbox-users并重新加载 postfix 服务。此后,postfix 将允许您使用映射的条目发送。

[1]: 例如:userdb {driver = passwd}passdb {driver = pam}将通过 passwd/userdb 文件或 SQL 后端指向系统用户身份验证或虚拟用户

答案2

哦,我看是 master.cf 文件出了问题。文件内容如下:

  -o smtpd_helo_restrictions=reject_sender_login_mismatch

并评论了它

#  -o smtpd_helo_restrictions=reject_sender_login_mismatch

相关内容