Resolved not sending via external SMTP (msmtp + Office365)

lema

New Pleskian
Server operating system version
Debian 12.12
Plesk version and microupdate number
Plesk Obsidian 18.0.73 Update #3 Web Host Edition
Hello everyone,

On my Debian 12 server (Plesk 18.0.73, mail service not installed),
I’m using the built-in msmtp integration to send outgoing messages through Office 365 (smtp.office365.com:587).

When I test manually from Debian shell, it works perfectly:
echo "Subject: Test" | msmtp -v [email protected]

However, messages sent *from Plesk itself* (e.g. scheduled tasks) are not delivered.
The /var/log/maillog shows:

Oct 20 12:08:15 plesk2 msmtp[221934]: host=smtp.office365.com tls=on auth=on user=[email protected] from=[email protected] recipients=[email protected] errormsg='the server sent an invalid reply' exitcode=EX_PROTOCOL


my /etc/msmtprc file looks like:
defaults
syslog LOG_MAIL
tls_certcheck on
tls on
#from %[email protected]
from [email protected]
allow_from_override off
domain plesk2.domain.gr
account default
host smtp.office365.com
port 587
auth on
user [email protected]
passwordeval /usr/lib/plesk-9.0/msmtp-pwdeval

I have already checked the thread Resolved - External SMTP Server Settings but unfortunately it didn’t solve the problem in my case.
The Office 365 account [email protected] has explicit “Send As” permission for [email protected] and this has been tested and verified.

Has anyone managed to make outgoing emails from Plesk itself work with Office 365 via msmtp?
 
Back
Top