Page 1 of 1

Sendmail Not Working

PostPosted: Mon Oct 07, 2019 10:25 am
by ecolgroveMOT
I receive this:

A test email was sent to eric@ezaccessmot.com
----
Mailer said: [10-07-2019 10:15:46] Message sent! (method=sendmail), Referer: admin/testemail.php
Use this to send a test email to your current logged in user address to verify you can recieve alerts from Nagios XI.

An email will be sent to: eric@ezaccessmot.com

Change your email address

But no email has been received, please help!

Re: Sendmail Not Working

PostPosted: Mon Oct 07, 2019 10:45 am
by mcapra
Are you using Nagios Core or Nagios XI? You posted in the Nagios Core section, but mention Nagios XI.

Check your mail server logs if you have access to them. Many mail servers straight up reject any messages sent via sendmail, in which case you may need to configure an SMTP server instead to "play nice" with your mail server.

Here's the XI documentation for setting up email notifications:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf

And the general purpose troubleshooting documentation for XI:
https://support.nagios.com/kb/article.php?id=36

Re: Sendmail Not Working

PostPosted: Mon Oct 07, 2019 11:28 am
by benjaminsmith
Thanks @mcapra!

As Matt suggested, check the mail log (/var/log/maillog) for error messages, If the message was sent, then check the spam folders as it maybe there.

Let us know what you find.

Re: Sendmail Not Working

PostPosted: Wed Oct 09, 2019 10:10 am
by ecolgroveMOT
Thanks for the support guys and the suggestions the sendmailer now works, however the SMTP option produces this error:

Mailer said: [10-09-2019 10:06:13] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting (method=smtp;host=smtp.office365.com;port=587;smtpauth=true;security=tls), Referer: admin/testemail.php
An error occurred sending a test email!

Any suggestions?

Re: Sendmail Not Working

PostPosted: Wed Oct 09, 2019 3:38 pm
by mbellerue
Could you attempt to send a test email message, let it fail, and then PM me a fresh copy of your system profile? You can get that from Admin -> System Profile -> Download Profile.

Just for the sake of future troubleshooting, this is a continuation from a previous troubleshooting session. We have already verified with nmap that the Nagios server can see the SMTP port on the destination server as Open and not Filtered. Also tried a known good account.

Re: Sendmail Not Working

PostPosted: Mon Oct 14, 2019 12:12 pm
by mbellerue
Okay, I have your profile, but I forgot one piece in my initial request. In your Outbound Mail Settings, just under SMTP, there is a checkbox that enables logging to phpmailer.log. Could you make sure that is checks, hit Update, send another test email, and then download the profile once more?