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(`RELAY_MAILER_ARGS', `TCP $h 25')dnl define(`ESMTP_MAILER_ARGS', `TCP $h 25')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:
- Authenticate your device or application directly with an Office 365 mailbox (SMTP client submission)*
- Send mail direct from your printer or application to Office 365 (Direct send)
- 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.
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.
And that is all! Now you should be able to receive notifications in your Office365 mailboxes from your appliance or applications.
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.
- 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 188.8.131.52 [[email protected] ~]# curl -s curlmyip.com 184.108.40.206 [[email protected] ~]# curl wgetip.com 220.127.116.11 [[email protected] ~]# curl -s wgetip.com 18.104.22.168
- Login to Office365 Exchange Admin Center
- Select Mail Flow -> Connectors
- Add new connector
- Select from ” Your Organization to Office365″
- Give a name to the connector
- Select identify by verifying IP address and enter your public IP Address.
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
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.