通过 postfix 仅发送 SMTP 邮件被中继主机拒绝(550-请打开 SMTP 身份验证)

通过 postfix 仅发送 SMTP 邮件被中继主机拒绝(550-请打开 SMTP 身份验证)

我想配置一台 Centos 8 机器通过外部 SMTP 中继发送电子邮件。 (我控制Centos盒子,无法控制外部继电器)。

我读过无数关于如何设置postfix来执行此操作的帖子,但通过以下方式发送邮件:

echo "Test Mail" | mailx -r [email protected] -s "from centUser" [email protected]

被中继主机拒绝:550-Please turn on SMTP Authentication in your mail client

我已经配置/etc/postfix/sasl_passwd并创建了哈希文件postmap /etc/postfix/sasl_passwd

有什么建议么?我已经尝试了帖子中的所有内容,但没有任何进展。

postconf -n 输出

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
compatibility_level = 2
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 10
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
html_directory = no
inet_interfaces = localhost
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
meta_directory = /etc/postfix
mydestination = $myhostname, localhost.$mydomain, localhost
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix/README_FILES
relayhost = [mail.relayHost.com]:465
sample_directory = /usr/share/doc/postfix/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
shlib_directory = /usr/lib64/postfix
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
smtp_tls_CApath = /etc/pki/tls/certs
smtp_tls_security_level = encrypt
smtp_tls_wrappermode = yes
smtp_use_tls = yes
smtpd_tls_cert_file = /etc/pki/tls/certs/postfix.pem
smtpd_tls_key_file = /etc/pki/tls/private/postfix.key
smtpd_tls_security_level = may
unknown_local_recipient_reject_code = 550

/var/log/maillog 内容:

Mar 10 19:03:59 localhost postfix/pickup[51935]: C9C78A0ECC: uid=0 from=<[email protected]>
Mar 10 19:03:59 localhost postfix/cleanup[51953]: C9C78A0ECC: message-id=<6229db1f.6kZlW9/tSI+EKENo%[email protected]>
Mar 10 19:03:59 localhost postfix/qmgr[51936]: C9C78A0ECC: from=<[email protected]>, size=430, nrcpt=1 (queue active)
Mar 10 19:04:04 localhost postfix/smtp[51955]: C9C78A0ECC: to=<[email protected]>, relay=mail.relayHost.com[xxx.xxx.xxx.xxx]:465, delay=4.9, delays=0.09/0.04/1.6/3.2, dsn=5.0.0, status=bounced (host mail.relayHost.com[xxx.xxx.xxx.xxx] said: 550-Please turn on SMTP Authentication in your mail client, or login to the 550-IMAP/POP3 server before sending your message.  550-bc9deedb.xxx.ispdomain.com (centUser.localdomain) [yyy.yyy.yyy.yyy]:42686 550 is not permitted to relay through this server without authentication. (in reply to RCPT TO command))
Mar 10 19:04:04 localhost postfix/cleanup[51953]: D9BC8A0ECD: message-id=<[email protected]>
Mar 10 19:04:04 localhost postfix/qmgr[51936]: D9BC8A0ECD: from=<>, size=2982, nrcpt=1 (queue active)
Mar 10 19:04:04 localhost postfix/bounce[51958]: C9C78A0ECC: sender non-delivery notification: D9BC8A0ECD
Mar 10 19:04:04 localhost postfix/qmgr[51936]: C9C78A0ECC: removed
Mar 10 19:04:06 localhost postfix/smtp[51955]: D9BC8A0ECD: to=<[email protected]>, relay=mail.relayHost.com[xxx.xxx.xxx.xxx]:465, delay=1.6, delays=0.04/0/1.1/0.48, dsn=5.0.0, status=bounced (host mail.relayHost.com[xxx.xxx.xxx.xxx] said: 550-Please turn on SMTP Authentication in your mail client, or login to the 550-IMAP/POP3 server before sending your message.  550-bc9deedb.xxx.ispdomain.com (centUser.localdomain) [yyy.yyy.yyy.yyy]:42688 550 is not permitted to relay through this server without authentication. (in reply to RCPT TO command))
Mar 10 19:04:06 localhost postfix/qmgr[51936]: D9BC8A0ECD: removed

答案1

中继主机 = [mail.relayHost.com]:465

您的中继主机使用端口 465,即通过 TLS 提交,您肯定需要身份验证和 TLS 才能允许通过此服务器中继您的电子邮件。

参见 参考资料 部分在 Postfix SMTP/LMTP 客户端中启用 SASL 身份验证在官方文档中是可以在这里找到

相关内容