On Tue, Jan 04, 2011 at 04:09:04PM -0500, Wietse Venema wrote:

> Having implemented $name expansion, I find that it is easy produce
> long contact footer text, so I have added multi-line support.
> 
> Unfortunately, multi-line footers can be harder to read. For example,
> Postfix will word-wrap multi-line replies when it reports delivery
> errors in a bounce message.
> 
> Suppose we have this nice multi-line contact footer:
> 
>     554-5.5.1 <u...@example>: Recipient address rejected: User unknown
>     554-5.5.1 For assistance, call 800-555-0101. Please mention the
>     554-5.5.1 following information in your problem report: 
>     554 5.5.1 localtime=Jan 4 15:42:00, client=192.168.1.248

When the Postfix SMTP client consumes the multiple-lines of a multi-line
response, it should I think drop all but the first occurence of the
XYZ-A.B.C codes, making the two forms indistiguishable.

> The logging would look something horrible like:
> 
>     Jan  4 15:42:00 client postfix/smtp[25100]: B32E0924782:
>     to=<u...@example>, relay=mail.example[192.168.1.58]:25,
>     delay=0.04, delays=0.01/0/0.01/0.01, dsn=5.1.1, status=bounced
>     (host mail.example[192.168.1.58] said: 550 554-5.5.1 <u...@example>:
>     Recipient address rejected: User unknown 554-5.5.1 For assistance,
>     call 800-555-0101. Please mention the 554-5.5.1 following
>     information in your problem report: 554 5.5.1 localtime=Jan 4
>     15:42:00, client=192.168.1.248

Per the above this issue already applies when the remote server is not
Postfix, and the fix is IMHO to prune the codes from the interior of
the response.

> 
> <u...@example>: host mail.example[192.168.1.58] said:  554-5.5.1
>     <u...@example>: Recipient address rejected: User unknown 554-5.5.1 For
>     assistance, call 800-555-0101. Please mention the 554-5.5.1 following
>     information in your problem report: 554 5.5.1 localtime=Jan 4 15:42:00,
>     client=192.168.1.248

Which solves the issue for bounces.

> On the other hand with a single-line contact footer, there would
> be no ugly "554-5.5.1" strings messing up the contact footer text:
> 

Agreed, and since, we don't control all potential SMTP servers that may
generate a multi-line reply, we should perhaps deal with it on the client
side...

Here is a bounce in my queue trying to return to a Gmail-hosted spammer:

    8A12750421C     1678 Sun Jan  2 10:55:26  MAILER-DAEMON
    (host ALT1.ASPMX.L.GOOGLE.com[74.125.77.27] said: 450-4.2.1 The user you 
are trying to contact is receiving mail at a rate that 450-4.2.1 prevents 
additional messages from being delivered. Please resend your 450-4.2.1 message 
at a later time. If the user is able to receive mail at that 450-4.2.1 time, 
your message will be delivered. For more information, please 450 4.2.1 visit 
http://mail.google.com/support/bin/answer.py?answer=6592 v45si53059220eeh.66 
(in reply to RCPT TO command))

-- 
        Viktor.

Reply via email to