Random SMTP send failures with Office 365

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
gmackey
Posts: 35
Joined: Wed Mar 22, 2017 1:13 pm
Location: Edmond, OK
Contact:

Random SMTP send failures with Office 365

Post by gmackey »

Hello,

I've noticed that I haven't received several email notifications from Nagios XI since we switched from a local SMTP proxy to directly sending to Office 365. The notifications are recorded in Nagios XI as being sent but they are never received. I know of cases in which some co-workers received an alert that I did not, even though Nagios XI has recorded that it sent one to me. I have debugging enabled for PHPMailer and here's an example from last night that shows a few failures in between successes. Is there some way to have PHPMailer retry on failure and keep retrying until it sends those failed messages?

Code: Select all

[04-05-2017 22:12:16] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 22:12:25] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 22:12:28] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 22:12:33] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 22:12:39] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 22:12:42] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 22:12:48] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Mobile Text
[04-05-2017 22:12:54] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 22:17:08] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 22:17:13] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 22:17:15] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 22:17:23] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 22:17:30] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 22:17:34] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 22:17:43] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Mobile Text
[04-05-2017 22:17:52] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 22:17:57] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 22:18:00] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 22:18:02] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 22:18:07] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 22:18:11] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Mobile Text
[04-05-2017 22:18:20] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 22:18:26] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 23:21:44] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 23:21:49] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 23:21:58] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 23:22:01] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 23:22:05] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Mobile Text
[04-05-2017 23:22:09] Message sent! (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-05-2017 23:22:13] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
=================================================
Nagios XI 5.6.5 Enterprise
CentOS 6.10 (64-bit) VMware image
SSL implemented and forced, with exception for localhost
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Random SMTP send failures with Office 365

Post by mcapra »

gmackey wrote:Is there some way to have PHPMailer retry on failure and keep retrying until it sends those failed messages?
Not really, but this isn't the first time we've seen direct connections to smtp.office365.com behave strangely. Typically, we recommend people use a relay rather than connecting to office365.com directly. Is using a relay an option in your environment? That'd be one way to have queuing; Let something like postfix deal with it.
Former Nagios employee
https://www.mcapra.com/
gmackey
Posts: 35
Joined: Wed Mar 22, 2017 1:13 pm
Location: Edmond, OK
Contact:

Re: Random SMTP send failures with Office 365

Post by gmackey »

Yep, this is all I needed to justify going back to using the relay. We have to have a relay for other devices (UPS, HVAC, etc.) that don't support one or more of the requirements for Office 365 auth anyway, not to mention in-house apps since we don't want to have to build a queueing system for those messages if they can't be immediately delivered. Thank you, please lock this thread.
=================================================
Nagios XI 5.6.5 Enterprise
CentOS 6.10 (64-bit) VMware image
SSL implemented and forced, with exception for localhost
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Random SMTP send failures with Office 365

Post by mcapra »

Happy to provide an excuse to use a relay :) Feel free to open a new thread if you have additional problems with Office365 emails.
Former Nagios employee
https://www.mcapra.com/
Locked