无法使用 postfix 从 linux CentOS 7 发送电子邮件

unable to send email from linux CentOS 7 using postfix

提问人:Ashar 提问时间:10/15/2023 最后编辑:Ashar 更新时间:10/16/2023 访问量:46

问:

我触发以下命令以发送电子邮件。

echo "This is the body of the email." | mailx -s "Subject of the Email" -r "[email protected]" [email protected]

以下是我的日志:

尾巴 -f /var/log/maillog

Oct 14 19:34:50 SGGS-Prod postfix/pickup[2065215]: 39FCB48B3BA: uid=0 from=<[email protected]>
Oct 14 19:34:50 SGGS-Prod postfix/cleanup[2065227]: 39FCB48B3BA: message-id=<652aed5a.MSgmspqvsdKAT5tU%[email protected]>
Oct 14 19:34:50 SGGS-Prod postfix/qmgr[2065216]: 39FCB48B3BA: from=<[email protected]>, size=479, nrcpt=1 (queue active)
Oct 14 19:34:51 SGGS-Prod postfix/smtp[2065218]: warning: SASL authentication failure: No worthy mechs found
Oct 14 19:34:51 SGGS-Prod postfix/smtp[2065218]: 39FCB48B3BA: to=<[email protected]>, relay=smtp.zoho.com[136.143.190.56]:587, delay=1.5, delays=0/0/1.5/0, dsn=4.7.0, status=deferred (SASL authentication failed; cannot authenticate to server smtp.zoho.com[136.143.190.56]: no mechanism available)

下面是配置文件:

$ cat /etc/postfix/main.cf
relayhost = [smtp.zoho.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_use_tls = yes
smtp_tls_security_level = encrypt
smtp_tls_note_starttls_offer = yes
smtp_sasl_mechanism_filter = plain, login

使用以下命令创建:smtp_sasl_password_maps

[smtp.zoho.com]:587    [email protected]:my-password
sudo chmod 600 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd

你能建议吗?

电子邮件 Zoho SASL MailX

评论

0赞 Rob 10/16/2023
SO 是一个编程问答平台,这个问题与编程无关。关于操作系统、其实用程序、网络和硬件的问题都是题外话。我可以在这里问什么话题?请删除此内容,并在 superuser.com 上询问

答:

1赞 Ashar 10/16/2023 #1

改变

[smtp.zoho.com]:587    [email protected]:my-password

smtp.zoho.com   [email protected]:my-password

并按照以下步骤帮助解决了该问题。

sudo chmod 600 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd