I modified /etc/mail/sendmail.mc to include the following changes:
Modified the line to include ADCB's SMTP Address
Commented the below line in the file /etc/mail/sendmail.mc
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
Then executed the below steps:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
Restart sendmail service
But when i run /bin/mail or /usr/sbin/sendmail commands, i receive the following error in the /var/log/maillog as
Jul 26 18:40:58 adcb0293 sendmail: n6QEew0E005626: from=root, size=48, class=0, nrcpts=1, msgid=<200907261440.n6QEew0E005626@email@example.com>, relay=netcool@localhost
Jul 26 18:40:58 abcd0493 sendmail: n6QEew0E005626: to=netcool@localhost, ctladdr=root,(0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30048, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
I am able to perform the below commands successfully:
1) telnet localhost 25
2) telnet 127.0.0.1 25
Not sure if any problems with sendmail.mc, but when i tried to send email after executing telnet localhost 25 and from this session i am able to send email. Like
telnet localhost 25
Connected to localhost.localdomain. (127.0.0.1).
Escape character is '^]'.
220 abcd0493.abcdsim.local ESMTP Sendmail 8.13.1/8.13.1; Sun, 26 Jul 2009 18:52:18 +0400
250 abcd093.abcdsim.local Hello localhost.localdomain [127.0.0.1], pleased to meet you
mail from: netcool@localhost
250 2.1.0 netcool@localhost... Sender ok
rcpt to: firstname.lastname@example.org
250 2.1.5 email@example.com
... Recipient ok
354 Enter mail, end with "." on a line by itself
250 2.0.0 n6QEew0E005626 Message accepted for delivery
221 2.0.0 abcd0493.abcdsim.local closing connection
Connection closed by foreign host.
And in the /var/log/maillog, i can see the entries like
Jul 26 18:56:27 adcb0293 sendmail: STARTTLS=client, relay=ad.abcdsim.local., version=TLSv1/SSLv3, verify=FAIL, cipher=AES128-SHA, bits=128/128
Jul 26 18:56:27 abcd0493 sendmail: n6QEqIMH005672: firstname.lastname@example.org, ctladdr=netcool@localhost (500/501), delay=00:00:57, xdelay=00:00:00, mailer=relay, pri=120013, relay=ad.abcdsim.local. [10.100.5.154], dsn=2.0.0, stat=sent (<200907261455.n6QEqIMH005672@abcd0493.abcdsim.local> Queued mail for delivery)
Any my /etc/hosts looks like
# Do not remove the following line, or various programs
# that requires network functionality will fail.
127.0.0.1 localhost.localdomain localhost
10.200.4.155 abcd0493 abcd0493.abcdsim.local
I am unable to figure out where the mistake is. Please help me on this issues.