HELO RFC 2821: Telnetting to Gmail’s SMTP servers

by Bharat Suneja

Telnetting to SMTP port of a mail server is a common troubleshooting task to test SMTP connectivity and mail flow that most of us do ever so frequently. After the initial HELO/EHLO command, you issue a MAIL FROM command that provides a return path to the receiving server – generally the SMTP address of the sender e.g. [email protected]

With most servers, MAIL FROM:[email protected] works.

Today I was testing some X-header functionality with Google’s Gmail service, after having performed similar tests against Exchange Server 2007 (Beta 2), Exchange 2003, and Hotmail. However, when I issued the MAIL FROM command when testing with Gmail, it threw up a syntax error! I use this almost several times a day, and never have I seen a syntax error being thrown up on MAIL FROM or RCPT TO.

Out of curiosity, I decided to lookup RFC 2821 to figure out if there was something I wasn’t doing right or that Gmail was enforcing in its zeal to be strictly RFC-compliant. As it turns out, the RFC does require addresses to be enclosed in “<” and “>” brackets!

Specifically:

The first step in the procedure is the MAIL command.

MAIL FROM:<reverse-path> [SP <mail-parameters> ] <CRLF>

This command tells the SMTP-receiver that a new mail transaction is starting and to reset all its state tables and buffers, including any recipients or mail data. The <reverse-path> portion of the first or only argument contains the source mailbox (between “<” and “>” brackets), which can be used to report errors…

I’ve never come across this particular issue with almost any MTA that I remember testing against… entering the addresses with those brackets seemed to work.

{ 5 comments… read them below or add one }

Derek December 29, 2006 at 2:05 am

Hi Bharat, I came across the exact same problem by telnetting to gmail yesterday. So what’s the solution? I can figure out to get the Exchange MTA to put “<" & ">” around the mail from address. Did you find a solution for the Exchange MTA? -Derek

Reply

Bharat Suneja December 29, 2006 at 9:14 am

Hi Derek,

Exchange itself doesn’t have any issues with sending to gmail. However, when telnetting to SMTP hosts, it’s not very common to use the “<" & ">” brackets – though it’s completely valid according to RFC 2821, it’s not really enforced by most hosts.

Bharat

Reply

iMERGE Group February 9, 2007 at 4:41 am

Hi Bharat,

I just want to know that when we are receiving a mail from gmail id we are not able to get the Original IP Address of the sender. why … can you explain me how does this gmail message sending works?

thanks

Bhavik Fuletra

Reply

iMERGE Group February 9, 2007 at 4:45 am

Hi Bharat,

I am having a dought regarding the gmail smtp. When a person sends an email from his gmail id. we are not able to get his Original IP Address can you let me know why… Explain me how doest gmail message sending works….

Thanks Bhavik

Reply

Bharat Suneja February 9, 2007 at 8:05 am

Bhavik,

How are you sending to gmail? What does the Received header show?

Reply

Leave a Comment

{ 1 trackback }

Previous post:

Next post: