后缀:“中继访问被拒绝”

后缀:“中继访问被拒绝”

我一直在尝试使用 dovecot、postfix、opendkim 和 spamassassin 建立一个邮件服务器。经过一番麻烦之后,我设法让收到的邮件正常工作(我用电子邮件注册了这个帐户!)。然而,发送邮件不起作用——我通过从这封新电子邮件发送到我的旧 Protonmail 帐户来测试这一点,但收到错误。同样,它适用于传入的邮件——从旧电子邮件发送到我的新电子邮件。使用 Neomutt 使用 msmtp 作为其邮件发送命令来测试发送。

我有一个relayhost连接到我域的端口 587 的端口。这是因为我的 ISP 很胖并且出于某种原因阻止了端口 25。无论如何,这是我发送电子邮件时收到的日志消息:

postfix/submission/smtpd[57255]: NOQUEUE: reject: RCPT from unknown[192.168.86.1]: 454 4.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail.doma.in>
postfix/smtp[57263]: E45589003B2: to=<[email protected]>, relay=MY.IP[MY.IP]:587, delay=0.2, delays=0.14/0.02/0.02/0.02, dsn=4.7.1, status=deferred (host MY.IP[MY.IP] said: 454 4.7.1 <[email protected]>: Relay access denied (in reply to RCPT TO command))
postfix/submission/smtpd[57255]: disconnect from unknown[192.168.86.1] ehlo=2 starttls=1 mail=1 rcpt=0/1 data=0/1 rset=1 quit=1 commands=6/8

postconf -n:

alias_database = $alias_maps
alias_maps = hash:/etc/postfix/aliases
command_directory = /usr/bin
compatibility_level = 3.6
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 = Mail/Inbox/
html_directory = no
inet_protocols = ipv4
mail_owner = postfix
mailbox_command = /usr/lib/dovecot/deliver
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
meta_directory = /etc/postfix
milter_default_action = accept
milter_protocol = 6
mydestination = $myhostname, $mydomain, localhost, localhost.localdomain, 127.0.0.1, MY.IP
mydomain = doma.in
myhostname = mail.doma.in
mynetworks = , 127.0.0.0/8 [::1]/128 MY.IP/32 MY.PRIVATE.IP MY.IP
newaliases_path = /usr/bin/newaliases
non_smtpd_milters = inet:127.0.0.1:12301
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix
relay_domains = $mydestination
relayhost = [MY.IP]:587
sample_directory = /etc/postfix
sendmail_path = /usr/bin/sendmail
setgid_group = postdrop
shlib_directory = /usr/lib/postfix
smtp_tls_CAfile = /etc/letsencrypt/live/doma.in/cert.pem
smtp_tls_loglevel = 3
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtp_tls_security_level = may
smtpd_milters = inet:127.0.0.1:12301
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_security_options =
smtpd_sasl_tls_security_options =
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/letsencrypt/live/doma.in/fullchain.pem
smtpd_tls_exclude_ciphers = aNULL, LOW, EXP, MEDIUM, ADH, AECDH, MD5, DSS, ECDSA, CAMELLIA128, 3DES, CAMELLIA256, RSA+AES, eNULL
smtpd_tls_key_file = /etc/letsencrypt/live/doma.in/privkey.pem
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1
smtpd_tls_security_level = may
tls_preempt_cipherlist = yes
unknown_local_recipient_reject_code = 550

它正在监听端口 587:

# lsof -i -P -n|grep 587
...
master    57239      root   94u  IPv4 970320      0t0  TCP *:587 (LISTEN)
smtpd     57364   postfix    6u  IPv4 970320      0t0  TCP *:587 (LISTEN)
smtpd     57367   postfix    6u  IPv4 970320      0t0  TCP *:587 (LISTEN)
smtpd     57371   postfix    6u  IPv4 970320      0t0  TCP *:587 (LISTEN)
smtpd     57374   postfix    6u  IPv4 970320      0t0  TCP *:587 (LISTEN)

为什么我会收到此错误?我已经解决了其他几个被问到的问题,特别是:

但这些都没有帮助

答案1

我最终通过添加192.168.86.0/24到解决了这个问题mynetworks。我还有另一个问题,但我会为此提出一个新问题。

相关内容