1 <!doctype html public
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
8 <title>Postfix Workarounds
</title>
10 <meta http-equiv=
"Content-Type" content=
"text/html; charset=us-ascii">
14 <body bgcolor=
"#ffffff">
16 <table border=
"0" cellpadding=
"5" cellspacing=
"0" width=
"100%">
20 <td align=
"center" valign=
"top">
22 <img src=
"mysza.gif" width=
"130" height=
"91" alt=
"[LOGO]">
24 <table cellpadding=
"5" cellspacing=
"0">
28 <tr> <td nowrap
align=
"center" bgcolor=
"#b2b0b0">
30 <font size=
"-1"> <strong> QUICK LINKS
</strong> </font> </td> </tr>
34 <td nowrap
bgcolor=
"#f8eda6" align=
"left">
36 <form method=
"get" action=
"http://www.google.com/search">
40 <a href=
"start.html">Home
</a> <br>
42 <strong><a href=
"announcements.html">Workarounds
</a></strong> <br>
44 <a href=
"non-english.html">Non-English Info
</a> <br>
46 <a href=
"features.html">Feature overview
</a> <br>
48 <a href=
"web-sites.html">Web sites (text)
</a> <br>
50 <a href=
"download.html">Download (source)
</a> <br>
52 <a href=
"lists.html">Mailing lists
</a> <br>
54 <a href=
"press.html">Press and Interviews
</a> <br>
56 <a href=
"documentation.html">Documentation
</a> <br>
58 <a href=
"docs.html">Howtos and FAQs
</a> <br>
60 <a href=
"addon.html">Add-on Software
</a> <br>
62 <a href=
"packages.html">Packages and Ports
</a> <br>
64 <a href=
"mirror.html">Becoming a mirror site
</a> <br> <br>
66 <input size=
"-1" type=
"submit" value=
"Search"><br>
67 <input type=
"text" name=
"q" size=
"20" maxlength=
"255" value=
"">
68 <input type=
"hidden" name=
"sitesearch" value=
"www.postfix.org">
74 </td> </tr> </table> </td>
76 <td valign=
"top" width=
"100%">
78 <h1>Postfix Workarounds
</h1>
80 <p> This webpage documents workarounds for bugs in non-Postfix mail
81 software. Workarounds may vary from
"dumbing down" Postfix, to an
82 optional source code patch that automatically enables the workaround.
87 <li> <p> <a href=
"#frontbridge_pipelining_bug">(Resolved: December
88 9,
2010) Mail FROM FrontBridge customers does not go through while
89 Postfix repeatedly logs
"lost connection" errors
</a> </p>
93 <h2><a name=
"frontbridge_pipelining_bug">(Resolved: December
9,
94 2010) Mail FROM FrontBridge customers does not go through while
95 Postfix repeatedly logs
"lost connection" errors.
</a></h2>
97 <a href=
"#frontbridge_summary"> summary
</a> |
<a
98 href=
"#frontbridge_demonstration"> demonstration
</a> |
<a
99 href=
"#frontbridge_workaround"> workarounds
</a> |
<a
100 href=
"#frontbridge_background"> background
</a>
102 <h3><a name=
"frontbridge_summary">Problem summary
</a> </h3>
104 <p> The SMTP service at mail.global.frontbridge.com does not fully
105 conform to RFC
2920 which defines the ESMTP PIPELINING extension.
106 When the service receives a group of SMTP commands ending with
107 QUIT, it ignores all commands in that group except QUIT. Needless
108 to say, this can break SMTP sessions in unexpected ways.
</p>
110 <p> As one symptom of this defect, mail from FrontBridge customers
111 does not go through to Postfix sites, when a Postfix site is
112 configured to verify that the sender address is valid (this involves
113 connecting to the FrontBridge service).
</p>
115 <p> Due to the FrontBridge service's non-conformance to RFC
2920,
116 the attempt to verify the sender address fails, and Postfix logs
117 "<tt>lost connection with mail.global.frontbridge.com[x.x.x.x]
118 while sending RCPT TO</tt>". As Postfix is unable to verify the
119 sender address, mail from the FrontBridge customer will not go
122 <h3><a name=
"frontbridge_demonstration">Problem demonstration
</a> </h3>
124 <p> The following is a slightly-edited transcript of an SMTP session
125 that demonstrates the problem. The transcript was obtained by
126 executing the following commands:
</p>
130 # postconf -e debug_peer_list=frontbridge.com
132 # sendmail -bv receiver@example.com
136 <p> Instead of receiver@example.com specify an email address that
137 is hosted by FrontBridge.
</p>
141 S:
220 VA3EHSMHS018.bigfish.com Microsoft ESMTP MAIL Service ready at
142 Sun,
28 Nov
2010 19:
01:
22 +
0000
144 C: EHLO amnesiac.example.com
146 S:
250-VA3EHSMHS018.bigfish.com Hello [
192.0.2.1]
147 S:
250-SIZE
157286400
149 S:
250-ENHANCEDSTATUSCODES
156 Note: the following client commands are sent in one single TCP segment,
157 not in multiple segments back-to-back.
159 C: MAIL FROM:
<sender@example.com
> SIZE=
338
160 C: RCPT TO:
<receiver@example.com
>
164 S:
221 2.0.0 Service closing transmission channel
166 <Client sees premature TCP close while expecting three more responses
>
170 <p> The client sees a premature TCP close, while it expects three
171 more server responses. Specifically, the server responses to the
172 "MAIL FROM" and
"RCPT TO" and
"RSET" commands are
"lost", and the
173 "QUIT" response arrives out-of-order. One may speculate that the
174 issue is not in the FrontBridge server itself, but rather in proxy
175 software in front of the FrontBridge server.
</p>
177 <p> As discussed below, the correct behavior would be:
</p>
181 C: MAIL FROM:
<sender@example.com
> SIZE=
338
182 C: RCPT TO:
<receiver@example.com
>
186 S:
250 2.1.0 Sender OK
187 S:
250 2.1.5 Recipient OK
188 S:
250 2.0.0 Resetting
189 S:
221 2.0.0 Service closing transmission channel
193 <h3> <a name=
"frontbridge_workaround">Workarounds
</a> </h3>
195 <p> A Postfix patch may be made available that turns on workarounds
197 by looking at the content of the
"220 welcome" server greeting.
198 Until that patch is available, workarounds will need to be turned
204 <li> <p> Disable sender address verification. The problem with the
205 FrontBridge service triggers with
"MAIL FROM/RCPT TO/RSET/QUIT",
206 which appears with Postfix sender address verification probes.
</p>
208 <li> <p> Disable SMTP command pipelining for FrontBridge servers,
209 Unfortunately, Postfix supports this only by IP address and the
210 FrontBridge servers appear to use many IP addresses.
</p>
214 /etc/postfix/main.cf:
215 smtp_discard_ehlo_keyword_address_maps =
216 pcre:/etc/postfix/discard_ehlo_keywords
218 /etc/postfix/discard_ehlo_keywords:
219 # This is likely to be incomplete.
220 216.32.0.0/
16 silent-discard, pipelining
221 213.199.0.0/
16 silent-discard, pipelining
222 65.55.0.0/
16 silent-discard pipelining
223 94.245.0.0/
16 silent-discard pipelining
227 <li> <p> Disable SMTP command pipelining for all mail. This
228 sledgehammer solution will reduce performance for all outbound
229 mail, by causing extra network round-trip times.
</p>
233 /etc/postfix/main.cf:
234 smtp_discard_ehlo_keywords = silent-discard pipelining
240 <h3> <a name=
"frontbridge_background">Background information
</a> </h3>
242 <p> The SMTP service at mail.global.frontbridge.com does not fully
243 conform to RFC
2920 which defines the ESMTP PIPELINING extension.
244 When the service receives a group of pipelined SMTP commands ending
245 with QUIT, it ignores all commands in that group except QUIT.
</p>
247 <p> In http://tools.ietf.org/html/rfc2920#section-
3.1 we see that
248 "RSET",
"MAIL FROM", and
"RCPT TO" are examples of commands that
249 can appear anywhere in a pipelined group, while
"EHLO",
"DATA" and
250 "QUIT" are examples of commands that can only appear as the last
251 command in a group.
</p>
253 <p> Section
3.2 http://tools.ietf.org/html/rfc2920#section-
3.2 specifies
254 required server behavior:
</p>
258 <p> (
1) MUST respond to commands in the
259 order they are received from the client.
</p>
263 <p> (
9) MUST NOT flush or otherwise lose the contents of the TCP
264 input buffer under any circumstances whatsoever.
</p>
268 <p> A correct implementation of RFC
2920 is recorded below from an intranet
269 Microsoft Exchange
2007 server.
</p>
273 S:
220 exchange.example.com Microsoft ESMTP MAIL Service ready at
274 Sun,
28 Nov
2010 02:
41:
13 -
0500
276 C: EHLO amnesiac.example.com
278 S:
250-exchange.example.com Hello [
192.0.2.1]
282 S:
250-ENHANCEDSTATUSCODES
290 Note: the following client commands are sent in one single TCP segment,
291 not in multiple segments back-to-back.
293 C: MAIL FROM:
<sender@example.com
>
294 C: RCPT TO:
<recipient@example.com
>
298 S:
250 2.1.0 Sender OK
299 S:
250 2.1.5 Recipient OK
300 S:
250 2.0.0 Resetting
301 S:
221 2.0.0 Service closing transmission channel
305 <p> The four pipelined client commands
"MAIL FROM",
"RCPT TO",
"RSET" and
306 "QUIT" are all processed by the Exchange server which correctly returns
309 <p> The same test against the public MX host for Microsoft's Exchange
310 engineering group yields similar results:
</p>
314 S:
220 mail7.exchange.microsoft.com Microsoft ESMTP MAIL Service ready
315 at Sat,
27 Nov
2010 23:
43:
19 -
0800
317 C: EHLO amnesiac.example.com
319 S:
250-mail7.exchange.microsoft.com Hello [
192.0.2.1]
320 S:
250-SIZE
104857600
323 S:
250-ENHANCEDSTATUSCODES
325 S:
250-X-ANONYMOUSTLS
334 Note: the following client commands are sent in one single TCP segment,
335 not in multiple segments back-to-back.
337 C: MAIL FROM:
<sender@example.com
>
338 C: RCPT TO:
<recipient@example.com
>
342 S:
250 2.1.0 Sender OK
343 S:
250 2.1.5 Recipient OK
344 S:
250 2.0.0 Resetting
345 S:
221 2.0.0 Service closing transmission channel
349 <p> Finally, testing mail.global.frontbridge.com we get non-conformant results
350 as discussed above.
</p>
354 S:
220 DB3EHSMHS006.bigfish.com Microsoft ESMTP MAIL Service ready at
355 Sun,
28 Nov
2010 07:
47:
08 +
0000
357 C: EHLO amnesiac.example.com
359 S:
250-DB3EHSMHS006.bigfish.com Hello [
192.0.2.1]
360 S:
250-SIZE
157286400
362 S:
250-ENHANCEDSTATUSCODES
369 Note: the following client commands are sent in one single TCP segment,
370 not in multiple segments back-to-back.
372 C: MAIL FROM:
<sender@example.com
>
373 C: RCPT TO:
<recipient@example.com
>
377 S:
221 2.0.0 Service closing transmission channel
379 <Client sees premature TCP close while expecting three more responses
>
383 <p> In this case the client's
"MAIL FROM",
"RCPT TO" and
"RSET"
384 commands are
"lost", and the
"QUIT" response arrives out-of-order.
385 One may speculate that the issue is not in the FrontBridge server
386 itself, but rather in proxy software in front of the FrontBridge
389 <p> Significantly, the FrontBridge SMTP servers correctly handle pipelining
390 of DOT + QUIT at the end of a delivery transaction, perhaps because this
391 "group" is treated specially.
</p>
395 S:
220 DB3EHSMHS003.bigfish.com Microsoft ESMTP MAIL Service ready at
396 Sun,
28 Nov
2010 07:
27:
55 +
0000
398 C: EHLO amnesiac.example.com
400 S:
250-DB3EHSMHS003.bigfish.com Hello [
192.0.2.1]
401 S:
250-SIZE
157286400
403 S:
250-ENHANCEDSTATUSCODES
410 Note: the following client commands are sent in one single TCP segment,
411 not in multiple segments back-to-back.
413 C: MAIL FROM:
<sender@example.com
>
414 C: RCPT TO:
<recipient@example.com
>
417 S:
250 2.1.0 Sender OK
418 S:
250 2.1.5 Recipient OK
419 S:
354 Start mail input; end with
<CRLF
>.
<CRLF
>
425 S:
250 2.6.0 <20101128070828.AB036504373@amnesiac.example.com
>
426 [InternalId=
11073071] Queued mail for delivery
427 S:
221 2.0.0 Service closing transmission channel