Page 1 of 1

SMTP and Azure AD

Posted: Fri Apr 16, 2021 8:26 am
by DFaught
Hi,

We have recently changed over to an authenticated SMTP service using Microsoft Active Directory and Azure. Using the debug methods in https://support.nagios.com/kb/article/p ... g-820.html it appears that the TLS and SMTP connection works to a point and then says that the authentication is unsuccessful and the Password command failed. We have tested the same user account and password on a local workstation using Powershell and it works just fine. I have attached the debug log. What do we need to do to get this to work properly?

Thank you for your help,
Dave

P.S. I have also attached the System Profile file.

Moderator's Note: The profile has been shared with the support team but has been removed from the public forum.

Re: SMTP and Azure AD

Posted: Fri Apr 16, 2021 4:33 pm
by ssax
Usually when I see these words:

Code: Select all

SMTP Error: Could not authenticate.
I read them as Should not authenticate.

Please blank out the user/pass in the Admin > Email Settings and then test it again.

Your email admins likely allowed relaying without auth to your mail server (just a guess, this is what happens with exchange) so when you try to do that it fails. Please try it and report the results. If you wanted to force auth with relaying it's likely a setting in your mail server.

Re: SMTP and Azure AD

Posted: Mon Apr 19, 2021 8:15 am
by DFaught
I blanked out the userID and password and got this:

A test email was sent to [email protected]
----
Mailer said: [04-19-2021 09:12:17] The following From address failed: [email protected] : MAIL FROM command failed,5.7.57 Client not authenticated to send mail. [CH2PR20CA0002.namprd20.prod.outlook.com] ,530,SMTP server error: MAIL FROM command failed Detail: 5.7.57 Client not authenticated to send mail. [CH2PR20CA0002.namprd20.prod.outlook.com] SMTP code: 530SMTP server error: MAIL FROM command failed Detail: 5.7.57 Client not authenticated to send mail. [CH2PR20CA0002.namprd20.prod.outlook.com] SMTP code: 530 (method=smtp;host=smtp.office365.com;port=587;security=tls), Referer: admin/testemail.php
An error occurred sending a test email!

It's not MY mail server, it is a Microsoft cloud service, so it's unlikely that changes can be made there.

Re: SMTP and Azure AD

Posted: Mon Apr 19, 2021 9:11 am
by DFaught
This is solved. I had to put in both the Send Mail From and the Username with the domain, "@footlocker.com", so that Active Directory knew where to look up the user account.

Thank you for your help!

Regards,
Dave

Re: SMTP and Azure AD

Posted: Mon Apr 19, 2021 4:51 pm
by ssax
Glad you were able to fix that! Let us know when we're okay to lock this up and mark it as resolved.

Re: SMTP and Azure AD

Posted: Tue Apr 20, 2021 7:46 am
by DFaught
Yes, this is resolved.

Re: SMTP and Azure AD

Posted: Tue Apr 20, 2021 8:25 am
by scottwilkerson
DFaught wrote:Yes, this is resolved.
Locking thread