Unable to send email from new Nagios install

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
dfmco
Posts: 257
Joined: Wed Dec 04, 2013 11:05 am

Unable to send email from new Nagios install

Post by dfmco »

mail.log
Dec 21 08:16:27 localhost postfix/qmgr[13633]: 361FE61F: from=<[email protected]>, size=982, nrcpt=1 (queue active)
Dec 21 08:16:32 localhost postfix/smtp[461]: connect to smtp2.mailcleaner.net[2001:918:ffd1:0:2000:0:2000:99]:25: Network is unreachable
Dec 21 08:16:32 localhost postfix/smtp[461]: connect to smtp.mailcleaner.net[2001:918:ffd1:0:2000:0:3000:97]:25: Network is unreachable
Dec 21 08:17:02 localhost postfix/smtp[461]: connect to smtp.mailcleaner.net[195.176.194.32]:25: Connection timed out

php log
[12-21-2016 07:55:29] SMTP Error: Could not connect to SMTP host. (method=smtp;host=webmail.onshoreit.net;port=25;security=none), Referer: admin/testemail.php
[12-21-2016 07:56:12] SMTP Error: Could not connect to SMTP host. (method=smtp;host=webmail.onshoreit.net;port=25;security=none), Referer: admin/testemail.php
[12-21-2016 07:57:48] SMTP Error: Could not connect to SMTP host. (method=smtp;host=216.230.228.195;port=25;security=none), Referer: admin/testemail.php
[12-21-2016 07:58:18] Message sent! (method=sendmail), Referer: admin/testemail.php

I would like to send mail directly to my server and avoid my spam service (which has the MX records) but I can't seem to get mail out of the system at all. Postfix seems to be trying IPv6 even though I disabled v6 and the sendmail messages does not make it even though I can get to the server.
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Unable to send email from new Nagios install

Post by mcapra »

From the CLI of your Nagios XI machine, can you share the output of the following commands:

Code: Select all

nmap webmail.onshoreit.net -p 25,465,587
nmap smtp.mailcleaner.net -p 25,465,587
nmap 195.176.194.32 -p 25,465,587
ping 195.176.194.32 -c 4
You may need to yum install nmap as well
Former Nagios employee
https://www.mcapra.com/
dfmco
Posts: 257
Joined: Wed Dec 04, 2013 11:05 am

Re: Unable to send email from new Nagios install

Post by dfmco »

[root@dfmco-rbunw-nagios ~]# nmap webmail.onshoreit.net -p 25,465,587

Starting Nmap 6.47 ( http://nmap.org ) at 2016-12-21 21:46 CST
Nmap scan report for webmail.onshoreit.net (216.230.228.195)
Host is up (0.0070s latency).
PORT STATE SERVICE
25/tcp filtered smtp
465/tcp open smtps
587/tcp open submission

Nmap done: 1 IP address (1 host up) scanned in 1.51 seconds
[root@dfmco-rbunw-nagios ~]# nmap smtp.mailcleaner.net -p 25,465,587

Starting Nmap 6.47 ( http://nmap.org ) at 2016-12-21 21:47 CST
Nmap scan report for smtp.mailcleaner.net (195.176.194.32)
Host is up (0.041s latency).
Other addresses for smtp.mailcleaner.net (not scanned): 193.246.63.97 193.246.63.102
rDNS record for 195.176.194.32: gate6.mailcleaner.net
PORT STATE SERVICE
25/tcp filtered smtp
465/tcp open smtps
587/tcp open submission

Nmap done: 1 IP address (1 host up) scanned in 2.07 seconds
[root@dfmco-rbunw-nagios ~]# nmap 195.176.194.32 -p 25,465,587

Starting Nmap 6.47 ( http://nmap.org ) at 2016-12-21 21:47 CST
Nmap scan report for gate6.mailcleaner.net (195.176.194.32)
Host is up (0.041s latency).
PORT STATE SERVICE
25/tcp filtered smtp
465/tcp open smtps
587/tcp open submission

Nmap done: 1 IP address (1 host up) scanned in 1.80 seconds
[root@dfmco-rbunw-nagios ~]# ping 195.176.194.32 -c 4
PING 195.176.194.32 (195.176.194.32) 56(84) bytes of data.
64 bytes from 195.176.194.32: icmp_seq=1 ttl=45 time=175 ms
64 bytes from 195.176.194.32: icmp_seq=2 ttl=45 time=171 ms
64 bytes from 195.176.194.32: icmp_seq=3 ttl=45 time=171 ms
64 bytes from 195.176.194.32: icmp_seq=4 ttl=45 time=172 ms

--- 195.176.194.32 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3173ms
rtt min/avg/max/mdev = 171.641/172.712/175.235/1.464 ms
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Unable to send email from new Nagios install

Post by rkennedy »

Code: Select all

Nmap scan report for webmail.onshoreit.net (216.230.228.195)
Host is up (0.0070s latency).
PORT STATE SERVICE
25/tcp filtered smtp
465/tcp open smtps
587/tcp open submission

Nmap scan report for smtp.mailcleaner.net (195.176.194.32)
Host is up (0.041s latency).
Other addresses for smtp.mailcleaner.net (not scanned): 193.246.63.97 193.246.63.102
rDNS record for 195.176.194.32: gate6.mailcleaner.net
PORT STATE SERVICE
25/tcp filtered smtp
It looks like it's being filtered on both hosts on port 25, are there firewall rules in place to restrict who can send from possibly? Please run a telnet against both of them as this will help to see the response received (if any), and post the results back here.

As an example for a working server -

Code: Select all

[root@localhost etc]# telnet smtp.emailsrvr.com 25
Trying 98.129.185.2...
Connected to smtp.emailsrvr.com.
Escape character is '^]'.
220 smtp31.relay.dfw1a.emailsrvr.com ESMTP - VA Code Section 18.2-152.3:1 forbids use of this system for unsolicited bulk electronic mail (Spam)
Former Nagios Employee
dfmco
Posts: 257
Joined: Wed Dec 04, 2013 11:05 am

Re: Unable to send email from new Nagios install

Post by dfmco »

Figured it out! The DSL provider was blocking on their end. I put a sniffer on my firewall and was not seeing inbound packets to port 25 but the sniffer on the firewall behind the DSL was sending them.

Thanks!
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Unable to send email from new Nagios install

Post by avandemore »

Great, good to hear you got it resolved. Are we ok to lock this thread?
Previous Nagios employee
dfmco
Posts: 257
Joined: Wed Dec 04, 2013 11:05 am

Re: Unable to send email from new Nagios install

Post by dfmco »

Yes please
Locked