Archive for the ‘SendMail’ Category

Send Mail Errors

April 18, 2010

1. CNAME lookup failed temporarily. (#4.4.3) –

This means that the mail router cannot find the correct information for the domain. This is a mail routing problem. Please consult to the people who manage the mail server.

It sometimes happen with Qmail. so may be something to do with Qmail being unable to handle oversized DNS query responses. Some time upgrading Qmail version fix the problem.

2. Domain of sender address does not resolve

This simply refer that your mail server cannot talk with your specified name server to resolve the domain name. Verify your DNS settings.

3. Local configuration error config error: mail loops back to me (MX problem?)

This refer to someone update or change your dns mx record entry for your mail server and the ip is not valid.

dig -t mx

verify with this command.


localhost as a smart SMTP relay

February 2, 2010

You have a production server which is not configured to relay mails externally, but there is a application running in that server which mails its log to the given email address regarding its status and incase of any service failures. since the sendmail runs locally on localhost.localdomain name it tries to forward the mail with root@localhost.localdomain to the remote smtp server, which would get rejected because of the reason that localhost.localdomain resolves to Invalid IP. So in order to overcome that we have to rewrite the from address of root@localhost.localdomain to so that the other smtp server relays the mail from to the or whatever address you want to send the service status mail to.


Check for installed sendmail packages –

apt-get install sendmail-base sendmail-bin sendmail-cf sendmail


First add the remote server ip address and its domain name to the /etc/hosts

vi /etc/hosts

You don’t have to do the above step if your local dns can resolve the domain name to the ip address of the smtp server which is configured to relay mail.


Edit the Sendmail configuration file for forwarding mails

vi /etc/mail/

EXPOSED_USER(root uucp)dnl # users exempt from masquerading
dnl # Masquerading options
FEATURE(`nullclient’, smtpservername)dnl



run the ‘make’ command on /etc/mail directory then reload the sendmail server
/etc/init.d/sendmail reload

Finally, test your settings –
telnet localhost 25
Connected to localhost.
Escape character is ‘^]’.
220 ESMTP Sendmail 8.14.3/8.14.3/Debian-5; Tue, 2 Feb 2010 13:41:34 +0600; (No UCE/UBE) logging access from: localhost(OK)-localhost []
helo smtp
250 Hello localhost [], pleased to meet you
250 2.1.0… Sender ok
250 2.1.5… Recipient ok
354 Enter mail, end with “.” on a line by itself
hello from example1
250 2.0.0 o127fY1s008960 Message accepted for delivery
[type quit to exit].