General
cancel
Showing results for 
Search instead for 
Did you mean: 

i am not able to send mail to gmail?

Mohammed Yusuf
Occasional Contributor

i am not able to send mail to gmail?

Hi,

echo "test" | mail -s "test" sample@gmail.com

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 -----
sample@gmail.com
(reason: 553 5.1.2 ... Unrecognized host name gmail.com.)
(expanded from: sample@gmail.com)

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

--o1OFTxjV004505.1267025400/test2.domain.com
Content-Type: message/delivery-status

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

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

--o1OFTxjV004505.1267025400/test2.domain.com
Content-Type: message/rfc822

Return-Path:
Received: (from root@localhost)
by test2.domain.com (8.13.1/8.13.1/Submit) id o1OFTxjU004505
for sample@gmail.com; Wed, 24 Feb 2010 20:59:59 +0530
Date: Wed, 24 Feb 2010 20:59:59 +0530
From: root
Message-Id: <201002241529.o1OFTxjU004505@test2.domain.com>
To: sample@gmail.com
Subject: test

test

--o1OFTxjV004505.1267025400/test2.domain.com--


Thanks,
2 REPLIES
Steven E. Protter
Exalted Contributor

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

Shalom,

User unknown

There is no user at google sample@google.com

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.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Matti_Kurkela
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 test2.domain.com, not .google.com.

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

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

From the information available so far, I cannot positively identify which Mail Transfer Agent is installed on test2.domain.com (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 test2.domain.com 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 test2.domain.com is supposed to be able to send email to any destination without using another mail server, then test2.domain.com must have unrestricted DNS access.

Manually looking up the IP address of gmail.com 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 test2.domain.com:

nslookup -query=MX gmail.com

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.

MK
MK