• 1. London, UK
  • 2. New York, NY
  • 3. Sydney, Australia
  • 4. Melbourne, Australia
  • 5. Moscow, Russia
  • 6. Singapore
  • 7. Paris, France
  • 8. Chicago, IL
  • 9. Hong Kong
  • 10. Houston, TX

Monday, July 24, 2006

 

HELO RFC 2821: Telnetting to Gmail's SMTP servers

Posted by Bharat Suneja at 7:48 PM
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. foo@somedomain.com

With most servers, MAIL FROM:foo@somedomain.com 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.

Labels:

5 Comments:

December 29, 2006 2:05 AM
Blogger Derek said...

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

 
December 29, 2006 9:14 AM
Blogger Bharat said...

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

 
February 9, 2007 4:41 AM
Blogger Bhavik said...

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

 
February 9, 2007 4:45 AM
Blogger Bhavik said...

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

 
February 9, 2007 8:05 AM
Blogger Bharat said...

Bhavik,

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

 

Post a Comment

Links to this post:

Create a Link

<< Home