How to Send Mail Notifications to Office365

ISSUE

Note - The default port for the 365 configuration in the sendmail.mc file is 587.  This may need to be changed to port 25, depending on customer requirement.  This is addressed by looking for:

define(`SMART_HOST',`mail.yourmailserver.com')dnl

define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl
See these considerations from Microsoft-
https://support.office.com/en-us/article/How-to-set-up-a-multifunction-device-or-application-to-send-email-using-Office-365-69f58e99-c550-4274-ad18-c805d654b4c4

If you are an Office365 customer there are a number of steps you need to configure to send mail notifications from your applications or Unitrends Appliance to your Office365 domain mailboxes.

Office 365 supports these options for sending email from an application:

  1. Authenticate your device or application directly with an Office 365 mailbox (SMTP client submission)*
  2. Send mail direct from your printer or application to Office 365 (Direct send)
  3. Configure a connector to send mail using Office 365 (SMTP relay)

* Unitrends appliances currently cannot use option Option 1 out of the box.

This article will explain how to use Option 2 (Direct Send) and Option 3 (SMTP Relay), as well as explain the differences.

 

RESOLUTION

Direct Send

If you just want to send mail alerts and reports to your Office365 mailboxes this method is the easiest one as you don't have to configure anything else in Office365. But it will not work for sending mails to external mail addresses like [email protected].com or other domains.  Direct Send requires port 25.  This is a Microsoft requirement.

To configure, you only need to find out the MX DNS register for your domain and setup it in your application settings.

You can find it using powershell:
 

PS> Resolve-DnsName -Name unitrends.com -Type MX

Name             Type   TTL   Section    NameExchange                                Preference
----             ----   ---   -------    ------------                                ----------
unitrends.com    MX     9     Answer     unitrends-com.mail.protection.outlook.com   0

In this scenario to send alerts to our @unitrends.com user mailboxes we just need to configure unitrends-com.mail.protection.outlook.com as SMTP.

Email Settings Tab

And that is all! Now you should be able to receive notifications in your Office365 mailboxes from your appliance or applications.
 

SMTP Relay

This method allows to send mail to other domains but it requires your Office365 administrator to create a mail flow connector that allows relay all mails that are coming from the public IP address used by the appliance to connect to Office365.

  1. You can find out the public IP address being used by your appliance to connect to Internet running any of these commands inside the appliance console:
    [[email protected] ~]# curl -s icanhazip.com
    37.134.134.124
    [[email protected] ~]# curl -s curlmyip.com
    37.134.134.124
    [[email protected] ~]# curl wgetip.com
    37.134.134.124
    [[email protected] ~]# curl -s wgetip.com
    37.134.134.124
  2. Login to Office365 Exchange Admin Center
  3. Select Mail Flow -> Connectors
  4. Add new connector
    Office365 Exchange Admin Center
  5. Select from ” Your Organization to Office365″
    New Connector
  6. Give a name to the connector
    New Connector
  7. Select identify by verifying IP address and enter your public IP Address.
    New Connector
  8. Save
    New Connector

Once this is done you can configure Unitrends Appliance to use your MX DNS register as SMTP Server to send mails to Office365 mailboxes and also to external domains.

PS> Resolve-DnsName -Name unitrends.com -Type MX

SMTP Server: unitrends-com.mail.protection.outlook.com

Email Settings Tab

Check Spam Databases

Office365 will block email if your IP address is blacklisted in a spam database.

IP ranges normally assigned to ISP end-user broadband connections are blacklisted as they should not be delivering unauthenticated SMTP email to any Internet mail server using these methods.

You can use mxtoolbox.com/blacklists.aspx website to check if your IP is listed and request removal.

NOTES

SEE ALSO  How do I change the sendmail 'from' address and domain on the appliance emails?
 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Contact us