msmtp с аккаунтом iCloud не работает

msmtp с аккаунтом iCloud не работает

Я совсем новичок в Linux (Raspbian на Raspberry Pi 4 Model B) и просто пытаюсь отправить электронное письмо через командную строку. Сейчас это работает с 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

Могу ли я что-то сделать сейчас? Любая помощь приветствуется!

Связанный контент