Monthly Archives: November 2008

Email servers and the MAIL FROM syntax

If you’re into chatting with SMTP servers via telnet ( only for debugging purposes, I swear :p ), be aware that some new email servers strictly interpret RFC 2821 and appears to reject MAIL FROM and RCPT TO addresses of the form foo@example.com. Instead, it will return a 555 5.5.2 Syntax error. The proper solution is to enclose the address brackets, as in <foo@example.com>.

A redacted transcript:

HELO example.com
250 Hello
MAIL FROM: foo@example.com
555 5.5.2 Syntax error.
MAIL FROM: <foo@example.com>
250 2.1.0 OK
RCPT TO: bar@example.com
555 5.5.2 Syntax error.
RCPT TO: <bar@example.com>
250 2.1.5 OK
DATA

....

I’m sure this is intended so that clients that send “Joe Schmoe <joe@example.com>” are correctly interpreted. I’m not sure if the RFC asks for this strict enforcement (on my admittedly cursory reading), though and yet a fair number of servers are rejecting the alternate address-only syntax. Wacky.