使用 iCloud 帐户的 msmtp 不起作用

使用 iCloud 帐户的 msmtp 不起作用

我对 Linux(Raspberry Pi 4 Model B 上的 Raspbian)非常陌生,我只是尝试通过命令行发送电子邮件。现在,这正在与msmtp一个gmx.de帐户合作指导。

apt-get update && apt-get upgrade -V

apt-get install msmtp msmtp-mta mailutils

/etc/msmtprc〜/.msmtprc包含

# Set default values for all following accounts.
defaults
port 587
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile        ~/.msmtp.log

# Mail account
account [email protected]
host mail.gmx.net
from [email protected]
auth on
user [email protected]
password PASSWORD

account default : [email protected]

aliases /etc/aliases

/etc/别名包含

root: [email protected]
default: [email protected]

/etc/mail.rc包含

set sendmail="/usr/bin/msmtp -t"

1. 测试

echo "Content of the e-mail" | mail -s "Subject" [email protected]

这效果非常好!但如果我将其更改为我的 iCloud 帐户,身份验证就会失败(密码正确;))。

# Set default values for all following accounts.
defaults
port 587
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
# Mail account
account [email protected]
host smtp.mail.me.com
from [email protected]
auth on
user [email protected]
password PASSWORD

account default : [email protected]

aliases /etc/aliases

2. 测试

pi@raspberrypi:~ $ echo "Content of the e-mail" | mail -s "Subject" [email protected]
msmtp: authentication failed (method PLAIN)
msmtp: server message: 535 5.7.8 Error: authentication failed
msmtp: could not send mail (account default from /home/pi/.msmtprc)
mail: Sending data to /usr/bin/msmtp -t failed: Process exited with a non-zero status
mail: cannot send message: Process exited with a non-zero status

我现在有什么可以做的吗?任何帮助表示赞赏!

相关内容