Thursday, November 6, 2008

Google - 451 4.5.0 SMTP protocol violation

I had an interesting issue with one of our outbound SMTP servers yesterday. At around 9am one of our servers would get the following error when sending to any domain hosted by Google...

451 4.5.0 SMTP protocol violation, see RFC 2821 s30si809416qbs.8 (in reply to end of DATA command)

We use Postfix for handling outbound SMTP internet mail and have 3 identical servers. The other 2 servers could send to mail servers without error but this one could not. I started analyzing the actual communication and saw the following on the server having the issue...

250 2.1.0 OK s30si809416qbs.8
250 2.1.5 OK s30si809416qbs.8
354 Go ahead s30si809416qbs.8
451 4.5.0 SMTP protocol violation, see RFC 2821 s30si809416qbs.8

It was sending the dot (end of data charachter) and QUIT command without waiting for a response from the Google server. The other servers would wait for the OK after sending the end of data character before sending QUIT. After some reasearch I found out this is done when PIPELINING is enabled. It turns out that Google enabled this on some of their servers yesterday but it was broken. Today it is turned off and all our SMTP servers can successfully send to Google e-mail domains.

Here is what the response from an EHLO command looks like if pipelining is enabled by a receiving server.....

EHLO at your service
250-SIZE 35651584

Pipelining will cause your SMTP server to send commands in a stream without waiting for a response.