Error while setting up custom SMTP with Office 365 as outbound email in BMS

Issue

I am unable to set up Office 365 as Custom SMTP in BMS without getting this error:

Error! The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.57 SMTP; Client was not authenticated to send anonymous mail during MAIL FROM  [xxxx.prod.outlook.com]"

Resolution

Follow these steps:

1. SMTP settings should be configured as follows:

2. You will then need to create a connector in Office 365 to accept to relay the email sent by BMS web servers:

  • In the security of the email server, you will need to allow external apps from sending emails on behalf. Login to your O365 admin center and follow this Microsoft guide to create the connector.

3. Navigate to Exchange admin center.

4. Navigate to mail flow > connectors.

5. Click Add a Connection.

6. Add all IPs mentioned below: 

  • 40.69.184.90
  • 52.176.147.81
  • 52.165.157.136
  • 34.197.117.170
  • 79.125.7.9

To ensure successful delivery of alerts and alarms via Kaseya's e-mail relays, the following IP addresses should also be added as firewall rules on port 25. Our new email domain is now called: sg.cloud.kaseya.net.

  • 79.125.7.9
  • 149.72.39.215
  • 149.72.182.166
  • 52.144.52.4

NOTE  https://docs.microsoft.com/en-us/exchange/mail-flow-best-practices/use-connectors-to-configure-mail-flow/set-up-connectors-to-route-mail

Please contact Kaseya Support if after creating the connector you are still having issues setting up custom SMTP.

Applies to: O365 mail servers used in BMS.

Custom SMTP and OAuth 2.0

Custom SMTP now supports OAuth 2.0 for Exchange Online.

  1. Go to Admin > My company > Outbound email.
  2. Use Custom SMTP Settings: Yes > Enable OAuth 2.0 Authentication: Yes
  3. Fill in the below values from your account
    • Application ID:
    • Directory ID:

NOTE   To enable OAuth 2.0 on SMTP, please follow this topic - OAuth2.0 for Microsoft O365 with PSA email parser.