Email check with Office 365

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
proddan
Posts: 20
Joined: Mon Feb 13, 2017 8:38 am

Email check with Office 365

Post by proddan »

Hi Everyone,

I'm trying to set up an Email Delivery check (using the built in wizard) to check mail flow from a local SMTP server to an Office 365 mailbox.

The email is delivered ok, but I get an error when the check tries to connect to the Office 365 mailbox.

The command that runs and the error I get are :

Code: Select all

/usr/local/nagios/libexec/check_email_delivery --mailto [email protected] --mailfrom [email protected] -H 172.16.12.22 --smtp-server 172.16.12.22 --smtp-username '' --smtp-password '' --smtp-port 25 --imap-server outlook.office365.com --username 'xxxxxx' --password 'xxxxxxx' --imap-port 143 EMAIL DELIVERY CRITICAL - imap failed: IMAP RECEIVE CRITICAL - Could not connect to outlook.office365.com port 143: 1 BAD Command received in Invalid state. at /usr/local/nagios/libexec/check_imap_receive line 145. 
I've ran nmap outlook.office365.com 143 and it tells me the port is open, so my Nagios server can see Office365's server ok.
I'm running Nagios XI 5.4.10.

Any suggestions will be appreciated.


Peter.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Email check with Office 365

Post by scottwilkerson »

It may be open but those aren't the ports it usually uses, see here
https://www.google.com/search?q=outlook ... 5.com+port

also, looks like you are not providing SMTP username and password which may also be required as well as the correct port for that.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Email check with Office 365

Post by mcapra »

From what I recall, Office365 requires you to configure a relay server (within Office365) when connecting via SMTP/IMAP (or really anything other than Outlook or webmail). You should hit that relay server with check_email_delivery rather than the cloud Office365 server if you aren't currently. I could be wrong, my memory is a bit fuzzy.
Former Nagios employee
https://www.mcapra.com/
proddan
Posts: 20
Joined: Mon Feb 13, 2017 8:38 am

Re: Email check with Office 365

Post by proddan »

Thanks Guys - I'll check those things out, and let you know how I get on.


Peter.
kyang

Re: Email check with Office 365

Post by kyang »

Sounds good! Let us know if you have any more questions.

If not, let us know when we can close this thread.
proddan
Posts: 20
Joined: Mon Feb 13, 2017 8:38 am

Re: Email check with Office 365

Post by proddan »

Tried again, this time with SSL enabled and on Port 993, and it now works.

Thanks for your help!

Peter.
kyang

Re: Email check with Office 365

Post by kyang »

Sounds great! I'll be closing this topic as resolved!

If you have any more questions, feel free to create another thread!

Thank you for using the Nagios Support Forum!
Locked