我触发以下命令来发送电子邮件。
echo "This is the body of the email." | mailx -s "Subject of the Email" -r "[email protected]" [email protected]
以下是我的日志:
tail -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
你能推荐一下吗?
改变
[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