Guide: How To Configure Jamf Pro SMTP with M365

anotherAdmin
New Contributor II

Overview:

I was really struggling to configure SMTP with M365. We have a distribution list that our Operations team are all apart of and wanted to receive email notifications from Jamf for a variety of reasons.

Our environment has MFA enabled and I was continuously fighting with both Jamf/Azure to figure out a workaround to the authentication errors I was seeing in the Jamf Server Logs.

It wasn't until after creating a service account without MFA applied it(account being authenticated in Jamf SMTP) and enabling "Send As" and "Send on behalf" in the distribution list by adding the service account to the delegates list that mail was delivered.

Lets look at a couple server logs I was experiencing first.

 

Server Log Error generated from an account with MFA enabled:

  • javax.mail.AuthenticationFailedException: Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully. Contact your administrator.

With the error above I messed around in Azure quite a bit and got no where. I made exceptions with my user for MFA and I attempted trying to configure an "App Password" which doesn't seem to exist anymore? Or at least was not available within my users account settings for some reason.

 

Server log Error generated from authenticating with a service account created in M365 with no MFA enabled.

  • com.sun.mail.smtp.SMTPSendFailedException: SendAsDenied;

The "SendAsDenied" stuck out to me and I remembered in Exchange that you could configure an account to "Send As". It wasn't until after enabling the service account (account being authenticated in Jamf SMTP) to send as the distribution list that I was targeting mail was finally delivered. 

 

Below is the configuration / solution which allowed for mail to be delivered successfully from Jamf Pro to our M365 Server using a service account without MFA.

 

Microsoft 365 Configuration:

Step 1: Navigate to admin.microsoft.com

Step 2: Users > Active Users > Add a User

  • Enter all required information. I added Exchange Admin as Administrator credentials to this service account.
  • Assign a license that will provide this service account a mailbox.
  • In the User settings > Mail > Mail Apps > verify that Authenticated SMTP is enabled.

Step 3: Navigate to Exchange Online Admin Center from M365 Admin Center.

Step 4: Navigate to Recipients > Groups > Distribution List and locate the Distribution List you want to target.

Step 5: Select the Distribution List > Settings > Manage Delegates > Edit Delegates  > Add a delegate > Add the service account you created and choose the “send on behalf” option. Save changes.

5jamf-smtp-config-1.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Jamf Pro Configuration:

Step 1: Sign into your Jamf Cloud Instance

Step 2: Select the Settings cog in the top right

Step 3: Navigate to System Settings > SMTP Server

Step 4: Enter the following information:

  • Server and port: smtp.office365.com | 587
  • Encryption: TLSv1.2
  • Connection Timeout: 15 [You can play around with this depending on what you want/need]
  • Sender Display Name: [Up to you]
  • Sender Email Address: Enter the mailing address you want mail to be sent from. I sent mine from a distribution group.
  • Requires Authentication: Enter the credentials of the service account you’ve created in M365.

    jamf-smtp-config-1.png
  •  

 

 

 

 

 

 

 

 


Step 5:
Save and Test. At this point I received an email.

Note: This is how I accomplished this, it may not work for your environment. If you think I skipped a step or didn't explain something clearly please let me know and I'll take a look.

15 REPLIES 15

RaxiaDK
Contributor

Thank you for your guide, I keep getting: javax.mail.AuthenticationFailedException: 535 5.7.139 Authentication unsuccessful, basic authentication is disabled. [AS8PR07CA0033.eurprd07.prod.outlook.com]

This not working for me: Disable Basic authentication in Exchange Online | Microsoft Docs

it was a time issue, it work for me now

MSB
New Contributor

Foe Me Its work First time only Not sure why But its working 

 

"A test message was successfully sent."

https://docs.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/authenticated-client...

 

scottb
Honored Contributor

Can anyone here get the "Sender Display Name" to work?  I've got the emails working fine, but I never get the Sender Display Name to use what I have entered, and it's confusing as I have a bunch of Jamf servers...

Thank you

RaxiaDK
Contributor

Mine Work fine

sarvagya
New Contributor

Hi, it's not working! I tried this:

 

- Created an user in Outlook

- Enabled SMTP Auth for that user mailbox.

- smtp.outlook365.com | 587

- TLS1.2 and connection timeout 15sec

Added username (email) and password

 

Not working!

try use your EOP on port 25

I tried this not working.

I do this, but look your log

Skærmbillede 2022-08-26 101738.png

sarvagya
New Contributor

I tried this not working.

scottb
Honored Contributor

Odd, this was working until the 10.40.1 update...now it's not.  This sucks!

scottb
Honored Contributor

Well, this may be part of what we're seeing...we recently changed our auth to modern using OKTA verify, so we'll have to see if we can make changes or change to another email solution for this:

Basic Authentication Deprecation in Exchange Online – May 2022 Update 

Yeah, since Microsoft enforced Modern Authentication at the end of 2022, it completely broke this. You can allow Basic Authentication for the single email account to get it working, but this is a security risk.

 

I suggest putting a vote on this feature request to get Jamf to intergrade with Modern Auth:  

https://ideas.jamf.com/ideas/JN-I-16171 

Am I correct in thinking that auth should still work if you setup an App Password on an account that has Enforced MFA? As long as you enable SMTP auth on the account it should work with the App Password? 

Vnds
New Contributor

I have done everything as suggested here but its not working for us. What else we need make changes in the both side JAMF pro and M365 side?