Search This Blog

Wednesday, March 16, 2011

Configure mail Client (Internal Mail Server)

Today i was configuring mail for one of our Linux server .

After following the normal steps for configuring the mail client i wasn't able to send mail .

following were the steps taken for configuring the mail client.

Make sure you have following rpms installed.
# rpm -qa| grep sendmail

(Note:Most linux distributions comes with sendmail rpm but most of the time you need to install sendmail-cf rpm according to your distribution).

Modified below parameter from /etc/mail/ file.

dnl define(`SMART_HOST', `')dnl

Here you define the name of your internal mail server.
(Note : Make sure you can ping the mail server from client machine).

Now its time to compile the /etc/mail/ file to /etc/mail/
the command used is.
m4 /etc/mail/ > /etc/mail/

After compiling its time to send the mail.

mail -s "test" , relay=root@localhost
Mar 16 10:58:13 XXX sendmail[5220]: p2G5SCCf005220: from=, size=389, class=0, nrcpts=1, msgid=<>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain []
Mar 16 10:58:13 XXX sendmail[5219]: p2G5SCgA005219:, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30073, relay=[] [], dsn=2.0.0, stat=Sent (p2G5SCCf005220 Message accepted for delivery)
Mar 16 10:58:15 XXX sendmail[5222]: STARTTLS=client,, version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256
Mar 16 10:58:16 XXX sendmail[5222]: p2G5SCCf005220: to=, ctladdr= (0/0), delay=00:00:03, xdelay=00:00:03, mailer=esmtp, pri=120389, [XXXX], dsn=5.1.8, stat=User unknown
Mar 16 10:58:17 XXX sendmail[5222]: p2G5SCCf005220: p2G5SHCf005222: DSN: User unknown
Mar 16 10:58:17 XXX sendmail[5222]: p2G5SHCf005222: to=, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31656, dsn=2.0.0, stat=Sent

It was bit clear from the log that machine was sending the email to itself but not able to send it to internal mail server.

Later i checked that the machine wasn't registered in it was not returning its ip address after i issue following command.
when i added the machine in dns it was successfully resolving the ip address.
host has address XX.XXX.XXX.XXX

So it was all due to DNS not having our server entry and nothing wrong with Configuration of mail.

No comments:

Post a Comment