msmtp icon indicating copy to clipboard operation
msmtp copied to clipboard

Issues while sending email to office 365

Open linux2981 opened this issue 2 years ago • 5 comments

Dear Dev,

Thank you for the tool!

The msmtp was sending email from Request Tracker to Office 365 for long time, but since last week it's not sending. The following error is displayed:

==> msmtp.log <== Jul 27 14:43:18 host=smtp.office365.com tls=on auth=on [email protected] [email protected] [email protected] errormsg='the server sent an invalid reply' exitcode=EX_PROTOCOL

I am using the following configuration:

defaults account default host smtp.office365.com port 587 tls on #tls_starttls off tls_trust_file /etc/pki/tls/certs/ca-bundle.crt tls_certcheck on auth on aliases /etc/aliases user [email protected] password password logfile /var/log/rt5/msmtp.log

There are no changes done on RT/msmtp configurations. Any idea why the above error is coming?

linux2981 avatar Jul 27 '22 15:07 linux2981

It should work with tls_starttls on (TLS is only available via STARTTLS on port 587).

Since tls_starttls off is commented out in your configuration, that should already be active, but can you check this nevertheless?

marlam avatar Jul 27 '22 16:07 marlam

Hello @marlam ,

I tried with tls_starttls on and the error message is same.

linux2981 avatar Jul 28 '22 05:07 linux2981

Can you run with the --debug option, to see the whole SMTP session? My next guess is that this is related to xoauth2 authentication; see some of the closed issues.

marlam avatar Jul 28 '22 10:07 marlam

I'm using msmtp on my laptop for sending mails through o365 every day and it's been working solidly for over a year. I am using app passwords though.

peterhoeg avatar Aug 18 '22 01:08 peterhoeg

Michaël Cadilhac found and fixed an issue in mpop with XOAUTH2 and Microsoft servers: https://github.com/marlam/mpop-mirror/issues/11 I applied the fix to msmtp as well, can someone please test XOAUTH2 with outlook.office365.com to see if it works now?

marlam avatar Aug 25 '22 06:08 marlam

Unfortunately there was no feedback. I'll close this issue now.

marlam avatar Jan 23 '23 19:01 marlam