Page 1 of 1

Email check with Office 365

Posted: Tue Oct 10, 2017 3:09 am
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.

Re: Email check with Office 365

Posted: Tue Oct 10, 2017 8:56 am
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.

Re: Email check with Office 365

Posted: Tue Oct 10, 2017 9:01 am
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.

Re: Email check with Office 365

Posted: Tue Oct 10, 2017 10:07 am
by proddan
Thanks Guys - I'll check those things out, and let you know how I get on.


Peter.

Re: Email check with Office 365

Posted: Tue Oct 10, 2017 10:18 am
by kyang
Sounds good! Let us know if you have any more questions.

If not, let us know when we can close this thread.

Re: Email check with Office 365

Posted: Wed Oct 11, 2017 6:43 am
by proddan
Tried again, this time with SSL enabled and on Port 993, and it now works.

Thanks for your help!

Peter.

Re: Email check with Office 365

Posted: Wed Oct 11, 2017 9:06 am
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!