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
therapservices.net 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 mail.test.com. 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 mail.therapbd.com

verify with this command.

Advertisements

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 user@example.com. so that the other smtp server relays the mail from user@example.com to the admin@example.com or whatever address you want to send the service status mail to.

Step-1

Check for installed sendmail packages –

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

Step-2

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

vi /etc/hosts

10.1.1.10 smtp.example.com

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.

Step-3

Edit the Sendmail configuration file for forwarding mails

vi /etc/mail/sendmail.mc

LOCAL_CONFIG
CPexample.com
EXPOSED_USER(root uucp)dnl # users exempt from masquerading
LOCAL_USER(root)dnl
dnl # Masquerading options
MASQUERADE_AS(`example.com’)dnl
FEATURE(`allmasquerade’)dnl
FEATURE(`masquerade_envelope’)dnl
FEATURE(`nullclient’, smtpservername)dnl

LOCAL_CONFIG

Step-4

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

Step-5
Finally, test your settings –
telnet localhost 25
Trying 127.0.0.1…
Connected to localhost.
Escape character is ‘^]’.
220 clinet1.example.com 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 [127.0.0.1]
helo smtp
250 client1.example.com Hello localhost [127.0.0.1], pleased to meet you
mail from:root@client1.example.com
250 2.1.0 root@client1.example.com… Sender ok
rcpt to:tarique@yahoo.com
250 2.1.5 tarique@yahoo.com… Recipient ok
data
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].