i am not able to send mail to gmail?

Mohammed Yusuf
Occasional Contributor

i am not able to send mail to gmail?


echo "test" | mail -s "test"

tail -100 /var/spool/mail/root:

The original message was received at Wed, 24 Feb 2010 20:59:59 +0530
from root@localhost

----- The following addresses had permanent fatal errors -----
(reason: 553 5.1.2 ... Unrecognized host name
(expanded from:

----- Transcript of session follows -----
... while talking to []:
>>> DATA
<<< 553 5.1.2 ... Unrecognized host name
550 5.1.1 User unknown
<<< 503 5.0.0 Need RCPT (recipient)

Content-Type: message/delivery-status

Reporting-MTA: dns;
Arrival-Date: Wed, 24 Feb 2010 20:59:59 +0530

Final-Recipient: RFC822;
Action: failed
Status: 5.1.2
Remote-MTA: DNS; []
Diagnostic-Code: SMTP; 553 5.1.2 ... Unrecognized host name
Last-Attempt-Date: Wed, 24 Feb 2010 21:00:00 +0530

Content-Type: message/rfc822

Received: (from root@localhost)
by (8.13.1/8.13.1/Submit) id o1OFTxjU004505
for; Wed, 24 Feb 2010 20:59:59 +0530
Date: Wed, 24 Feb 2010 20:59:59 +0530
From: root
Message-Id: <>
Subject: test



Steven E. Protter
Exalted Contributor

Re: i am not able to send mail to gmail?


User unknown

There is no user at google

Therefore their mail system is rejecting the mail.

That part is quite simple.

Google has some standards other than this for accepting mail.

1) The domain name of the sender must match the domain name associated with the IP address sending the mail.
2) The domain name of the sender must be able to be looked up with nslookup or dig. Public look up for the domain must succeed.
3) The domain name of the server/ip address must be able to be found in a public dns look up.

There are other conditions and spam filters. But any discrepancies in the source of the sender will stop the mail from being delivered.

Steven E Protter
Owner of ISN Corporation
Honored Contributor

Re: i am not able to send mail to gmail?

Looks like the message was rejected by the local MTA in Mohammed's system, even before making an attempt to deliver it to Google.

Note that the Reporting-MTA in the error email is, not

Apparently the did not have access to Internet DNS servers, because it could not resolve the name "".

Also, apparently does not have a "smarthost" (the address of the local organization's primary SMTP server) configured: otherwise would have passed this message to the configured smarthost for further delivery instead of trying to deliver it directly to

From the information available so far, I cannot positively identify which Mail Transfer Agent is installed on (i.e. sendmail, Postfix, exim, qmail or something else?), so I cannot provide detailed configuration instructions.

Basically, there is two alternative ways to fix this:
1.) the "smarthost" configuration: tell the MTA installed on to deliver all outgoing mail to your primary mail server, which is probably already configured to handle the delivery to anywhere on the Internet.

2.) the "independent" way: if is supposed to be able to send email to any destination without using another mail server, then must have unrestricted DNS access.

Manually looking up the IP address of and storing it in /etc/hosts is not enough: there is a special DNS record type specifically for controlling email delivery, called a MX record. Any MTA that is not using the smarthost configuration must be able to look up the MX records.

For testing the necessary level of DNS access, try running this command on

nslookup -query=MX

Because Google has servers all over the world and uses world-wide load balancing, you and I might get different answers to this query; but if the query is not successful at all, you don't have the necessary DNS access.