sendmail problem

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
majed
Posts: 98
Joined: Mon Mar 17, 2014 5:29 am

sendmail problem

Post by majed »

Hello, i am connecting to the internet through an isp and when it fails i am automatically swithced to another isp. sendmail works fine with the first isp but when the switch over happens the emails stop being sent.
/var/log/mail.log

Code: Select all

Jul  4 05:33:41 oversun sm-mta[28593]: s642WSeK028593: Saved message in /var/lib/sendmail/dead.letter
Jul  4 05:34:35 oversun sendmail[28872]: s642YZcw028872: from=nagios, size=347, class=0, nrcpts=1, msgid=<[email protected]>, relay=nagios@localhost
Jul  4 05:34:35 oversun sm-mta[28874]: s642YZcC028874: from=<[email protected]>, size=633, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Jul  4 05:34:45 oversun sendmail[28891]: s642YjN4028891: from=nagios, size=227, class=0, nrcpts=1, msgid=<[email protected]>, relay=nagios@localhost
Jul  4 05:34:45 oversun sm-mta[28892]: s642YjEh028892: from=<[email protected]>, size=513, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Jul  4 05:35:02 oversun sendmail[28944]: s642Z2Rg028944: from=root, size=375, class=0, nrcpts=1, msgid=<[email protected]>, relay=root@localhost
Jul  4 05:35:02 oversun sm-mta[28945]: s642Z2gF028945: from=<[email protected]>, size=617, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Jul  4 05:35:02 oversun sendmail[28944]: s642Z2Rg028944: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30375, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (s642Z2gF028945 Message accepted for delivery)
Jul  4 05:35:13 oversun sm-mta[28874]: s642YZcC028874: to=<[email protected]>, ctladdr=<[email protected]> (1001/1001), delay=00:00:38, xdelay=00:00:38, mailer=relay, pri=30633, relay=mx10.mail.oversun.ru. [188.127.232.6], dsn=2.0.0, stat=Sent (<[email protected]> [InternalId=10160405] Queued mail for delivery)
Jul  4 05:35:13 oversun sm-mta[28892]: s642YjEh028892: to=<[email protected]>, ctladdr=<[email protected]> (1001/1001), delay=00:00:28, xdelay=00:00:28, mailer=relay, pri=30513, relay=mx10.mail.oversun.ru. [188.127.232.6], dsn=2.0.0, stat=Sent (<[email protected]> [InternalId=10160407] Queued mail for delivery)
Jul  4 05:35:14 oversun sendmail[28891]: s642YjN4028891: [email protected], ctladdr=nagios (1001/1001), delay=00:00:28, xdelay=00:00:28, mailer=relay, pri=30227, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (s642YjEh028892 Message accepted for delivery)
switched to isp 2

Code: Select all

Jul  4 05:35:24 oversun sm-mta[28947]: s642Z2gF028945: to=<[email protected]>, ctladdr=<[email protected]> (0/0), delay=00:00:22, xdelay=00:00:22, mailer=relay, pri=120617, relay=mx1.mail.oversun.ru. [188.127.232.5], dsn=5.1.1, stat=User unknown
Jul  4 05:35:34 oversun sm-mta[28947]: s642Z2gF028945: s642ZYgF028947: DSN: User unknown
Jul  4 05:35:44 oversun sm-mta[28947]: s642ZYgF028947: to=<[email protected]>, delay=00:00:10, xdelay=00:00:10, mailer=relay, pri=30000, relay=mx1.mail.oversun.ru. [188.127.232.5], dsn=5.1.1, stat=User unknown
Jul  4 05:35:55 oversun sm-mta[28947]: s642ZYgF028947: s642ZYgG028947: return to sender: User unknown
Jul  4 05:36:05 oversun sm-mta[28947]: s642ZYgG028947: to=root, delay=00:00:10, xdelay=00:00:10, mailer=relay, pri=30000, relay=mx1.mail.oversun.ru. [188.127.232.5], dsn=5.1.1, stat=User unknown
back to isp 1

Code: Select all

Jul  4 05:36:15 oversun sm-mta[28947]: s642ZYgF028947: Saved message in /var/lib/sendmail/dead.letter
Jul  4 05:40:02 oversun sm-mta[29635]: s642e2p4029635: from=<[email protected]>, size=522, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Jul  4 05:40:02 oversun sm-msp-queue[29634]: s642WSoO028592: [email protected], ctladdr=nagios (1001/1001), delay=00:07:34, xdelay=00:00:01, mailer=relay, pri=120236, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (s642e2p4029635 Message accepted for delivery)
Jul  4 05:40:02 oversun sm-mta[29635]: s642e2p6029635: from=<[email protected]>, size=565, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Jul  4 05:40:02 oversun sm-msp-queue[29634]: s642UmSa028367: [email protected], ctladdr=nagios (1001/1001), delay=00:09:14, xdelay=00:00:00, mailer=relay, pri=120279, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (s642e2p6029635 Message accepted for delivery)
Jul  4 05:40:02 oversun sm-mta[29635]: s642e2p8029635: from=<[email protected]>, size=565, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Jul  4 05:40:02 oversun sm-msp-queue[29634]: s642Sfk5028051: [email protected], ctladdr=nagios (1001/1001), delay=00:11:21, xdelay=00:00:00, mailer=relay, pri=120279, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (s642e2p8029635 Message accepted for delivery)
Jul  4 05:40:02 oversun sm-mta[29635]: s642e2pA029635: from=<[email protected]>, size=633, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Seek and you shall find, knock and it shall be opened, cry and you shall find comfort
chris.fixter
Posts: 22
Joined: Wed Jun 18, 2014 4:15 am

Re: sendmail problem

Post by chris.fixter »

It looks to me the problem is likely caused by [email protected] is an invalid mailbox.
Otherwise it could be that mx10.mail.oversun.ru and its friend mx1.mail.oversun.ru relays for your first ISP IP but dislike your 2nd ISP's IP.

I am not familiar with sendmail, I might be miss reading the sendmail log though. However, the hint should be the return code 2.0.0 and 5.1.1.
majed
Posts: 98
Joined: Mon Mar 17, 2014 5:29 am

Re: sendmail problem

Post by majed »

Well why is it sending to root and is there a way to fix it?
Seek and you shall find, knock and it shall be opened, cry and you shall find comfort
chris.fixter
Posts: 22
Joined: Wed Jun 18, 2014 4:15 am

Re: sendmail problem

Post by chris.fixter »

It is probably a bounce mail from sendmail itself. So the fix would be how you designed the whole mail delivery and ISP failover.
ATM I am not sure why you do not get email alert from your 2nd ISP because I don't see any direct evidence.
Perhaps you can start off by telling us how your nagios networks are configured to failover and how you configure your sendmail.
You may also manually switch your network and execute the mail command defined in your nagios notification command from shell to see what happens.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: sendmail problem

Post by eloyd »

DSN: User unknown
This indicates that the username/password that you're using to connect to the SMTP server at the second site is invalid.

This is not a Nagios issue, this is a general systems administration/configuration issue.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: sendmail problem

Post by abrist »

Closing as stale.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked