I have installed nagios
for monitoring and sendmail
for sending mails. When testing from root
account I am receiving mails, but I'm not receiving mails when I send it from nagios
account. I have googled and found that only root
user can send mails using sendmail MTA
. How to enable sendmail
to send mails from nagios
account?
Note that I don't send messages directly from the local machine, but instead use my ISP/provider relay. The below logs show the error from the relay when the message comes from nagios@
, but not when it comes from root@
.
Output from nagios user:
cat /var/log/maillog
Sep 19 15:52:32 ubuntubackup-chennai sendmail[6088]: q8JAMWXZ006088: from=nagios, size=237, class=0, nrcpts=1, msgid=<[email protected]>, relay=nagios@localhost Sep 19 15:52:32 ubuntubackup-chennai sendmail[6089]: q8JAMWCn006089: from=<[email protected]>, size=517, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1] Sep 19 15:52:32 ubuntubackup-chennai sendmail[6088]: q8JAMWXZ006088: to=karthick.murugadhas@****.com, ctladdr=nagios (496/492), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30237, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q8JAMWCn006089 Message accepted for delivery) Sep 19 15:52:32 ubuntubackup-chennai sendmail[6091]: q8JAMWCn006089: to=<karthick.murugadhas@****.com>, ctladdr=<[email protected]> (496/492), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=120517, relay=smtp10.netcore.co.in. [202.162.229.32], dsn=4.7.1, stat=Deferred: 450 4.7.1 <nagios@****.com>: Sender address rejected: Please checked sender domain
Output from root user:
cat /var/log/maillog
Sep 19 15:43:29 ubuntubackup-chennai sendmail[5158]: q8JADTt2005158: from=root, size=237, class=0, nrcpts=1, msgid=<[email protected]>, relay=root@localhost Sep 19 15:43:29 ubuntubackup-chennai sendmail[5159]: q8JADTFO005159: from=<[email protected]>, size=511, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1] Sep 19 15:43:29 ubuntubackup-chennai sendmail[5158]: q8JADTt2005158: to=karthick.murugadhas@****.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30237, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q8JADTFO005159 Message accepted for delivery) Sep 19 15:43:30 ubuntubackup-chennai sendmail[5161]: q8JADTFO005159: to=<karthick.murugadhas@****.com>, ctladdr=<[email protected]> (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=120511, relay=smtp10.netcore.co.in. [202.162.229.32], dsn=2.0.0, stat=Sent (_SMR_smtp9.netcore.co.in Ok: queued as 29CE7F6D4C)
Update 1:
sendmail.mc
configuration file is here.