1)When sending mail as nagios user
A)How mail is sent
[root@localhost ~]# su nagios
[nagios@localhost root]$ mail
[email protected]
Subject: test
.
EOT
Null message body; hope that's ok
[nagios@localhost root]$
B)Maillog content
[root@localhost log]# tail -f maillog
Jan 22 08:45:16 localhost sendmail[14914]: t0M5huO3014914: from=nagios, size=226, class=0, nrcpts=1, msgid=<
[email protected]>, relay=nagios@localhost
Jan 22 08:45:16 localhost sendmail[14914]: t0M5huO3014914: to=
[email protected], delay=00:01:20, mailer=esmtp, pri=30226, dsn=4.4.3, stat=queued
Jan 22 08:53:52 localhost sendmail[14987]: t0M5rpLd014987: from=<
[email protected]>, size=486, class=0, nrcpts=1, msgid=<
[email protected]>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Jan 22 08:53:52 localhost sm-msp-queue[14980]: t0M5huO3014914: to=
[email protected], ctladdr=nagios (501/501), delay=00:09:56, xdelay=00:00:01, mailer=relay, pri=120226, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (t0M5rpLd014987 Message accepted for delivery)
Jan 22 08:53:59 localhost sendmail[14989]: t0M5rpLd014987: to=<
[email protected]>, ctladdr=<
[email protected]> (501/501), delay=00:00:07, xdelay=00:00:07, mailer=esmtp, pri=120486, relay=mail.company.com. [186.22.32.22], dsn=5.1.1, stat=User unknown
Jan 22 08:53:59 localhost sendmail[14989]: t0M5rpLd014987: t0M5rxLd014989: DSN: User unknown
Jan 22 08:53:59 localhost sendmail[14989]: t0M5rxLd014989: to=<
[email protected]>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31710, dsn=2.0.0, stat=Sent
2)When sending mail as root user
A)How mail is sent
[root@localhost ~]# mail
[email protected]
Subject: test
.
EOT
Null message body; hope that's ok
B)Maillog content
[root@localhost ~]#
[root@localhost log]# tail -f maillog
Jan 22 09:21:02 localhost sendmail[15206]: t0M6L1Bn015206: from=root, size=226, class=0, nrcpts=1, msgid=<
[email protected]>, relay=root@localhost
Jan 22 09:21:02 localhost sendmail[15208]: t0M6L2i4015208: from=<
[email protected]>, size=489, class=0, nrcpts=1, msgid=<
[email protected]>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Jan 22 09:21:02 localhost sendmail[15206]: t0M6L1Bn015206: to=
[email protected], ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30226, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (t0M6L2i4015208 Message accepted for delivery)
Jan 22 09:21:04 localhost sendmail[15210]: t0M6L2i4015208: to=<
[email protected]>, ctladdr=<
[email protected]> (0/0), delay=00:00:02, xdelay=00:00:02, mailer=esmtp, pri=120489, relay=mail.company.com. [186.22.32.22], dsn=2.0.0, stat=Sent (OK id=1YEB7i-0008KX-Nb)
Note:
1)Here I received mail sent by root user and did not receive mail sent by nagios user.
2)I replaced my original mail ID with
[email protected] and smtp as mail.company.com and also mail server IP in the above for security reasons.
Please find attachments for configuration files, Servers.cfg is the host file