Bounce message length

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Bounce message length

Griff
I have Postfix currently running as an outbound relay for a  Microsoft
Exchange system.  It's working beautifully, but we are having issues
with bounce messages:

It appears bounce messages are trucated to <80 chars (more like 75
according to the tcpdump).

This means the error code and message are not handled correctly by
Exchange.  See below screenshot:
https://pbs.twimg.com/media/DBuyDLkXkAEWZ9d.jpg:large

I found a reference a possible cause for this in this thread:
http://marc.info/?l=postfix-users&m=125273313101833&w=2

This lead me to the source code (and I will stress, I am an admin and
not a dev, but I'll have a go)

from: /bounce/bounce_notify_util.c

/* bounce_print_wrap - print and wrap a line */

static void bounce_print_wrap(VSTREAM *bounce, BOUNCE_INFO *bounce_info,
             const char *format,...)
{
    va_list ap;

#define LENGTH 79
#define INDENT 4

    va_start(ap, format);
    vstring_vsprintf(bounce_info->buf, format, ap);
    va_end(ap);
    line_wrap(STR(bounce_info->buf), LENGTH, INDENT,
     bounce_print, (void *) bounce);
}

/* bounce_recipient_log - send one bounce log report entry */


Are LENGTH and INDENT variables which can be defined in config?  And
if not, as I suspect,  can I make a feature request that these can be
changed with postconf or in a .cf file?

Many thanks.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bounce message length

Wietse Venema
Griff:
> I have Postfix currently running as an outbound relay for a  Microsoft
> Exchange system.  It's working beautifully, but we are having issues
> with bounce messages:
>
> It appears bounce messages are trucated to <80 chars (more like 75
> according to the tcpdump).

Postfix produces the following form:

Diagnostic-Code: X-Postfix; Host or domain name not found, Name service error
    for name=fakemadeupdomain.com type=AAAA: host not found

Your example shows a line break in the middle of 'error', and other
text that is converted into quoted-printable.

Diagnostic-Code: X-Postfix; Host or domain name not found, Name service e=
rror
    for name=3Dfakemadeupdomain.com type=3DAAAA: host not found

POSTFIX DID NOT CONVERT THIS TEXT TO QUOTED-PRINTABLE
POSTFIX DID NOT BREAK "error" INTO "e=" and "rror",
POSTFIX DID NOT CONVERT "=" INTO "=3D".

        Wietse
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bounce message length

Wietse Venema
Wietse Venema:

> Griff:
> > I have Postfix currently running as an outbound relay for a  Microsoft
> > Exchange system.  It's working beautifully, but we are having issues
> > with bounce messages:
> >
> > It appears bounce messages are trucated to <80 chars (more like 75
> > according to the tcpdump).
>
> Postfix produces the following form:
>
> Diagnostic-Code: X-Postfix; Host or domain name not found, Name service error
>     for name=fakemadeupdomain.com type=AAAA: host not found
>
> Your example shows a line break in the middle of 'error', and other
> text that is converted into quoted-printable.
>
> Diagnostic-Code: X-Postfix; Host or domain name not found, Name service e=
> rror
>     for name=3Dfakemadeupdomain.com type=3DAAAA: host not found
>
> POSTFIX DID NOT CONVERT THIS TEXT TO QUOTED-PRINTABLE

Except that the Postfix SMTP client convert text and will break
lines in precisely this manner when sending mail to a receiver that
does not announce 8BITMIME support in SMTP.

To avoid:

main.cf:
    disable_mime_output_conversion = yes

Or, fix the SMTP receiver that does not announce 8BITMIME support.

        Wietse
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

PATCH: Bounce message length

Wietse Venema
In reply to this post by Griff
Griff:

> I have Postfix currently running as an outbound relay for a  Microsoft
> Exchange system.  It's working beautifully, but we are having issues
> with bounce messages:
>
> It appears bounce messages are trucated to <80 chars (more like 75
> according to the tcpdump).
>
> This means the error code and message are not handled correctly by
> Exchange.  See below screenshot:
> https://pbs.twimg.com/media/DBuyDLkXkAEWZ9d.jpg:large

After a bit of study, I determined that there is no legitimate need
to convert message/delivery-status to qouted-printable or base64.
The content of message/delivery-status should always be 7bit.

        Wietse

diff -ur /var/tmp/postfix-3.3-20170506/src/bounce/bounce_notify_util.c src/bounce/bounce_notify_util.c
--- /var/tmp/postfix-3.3-20170506/src/bounce/bounce_notify_util.c 2015-01-26 15:00:13.000000000 -0500
+++ src/bounce/bounce_notify_util.c 2017-06-10 14:47:25.000000000 -0400
@@ -637,7 +637,9 @@
       (bounce_info->smtputf8 & SMTPUTF8_FLAG_REQUESTED) ?
       "global-" : "");
     /* Fix 20140709: addresses may be 8bit. */
-    if (NOT_7BIT_MIME(bounce_info))
+    if (NOT_7BIT_MIME(bounce_info)
+    /* BC Fix 20170610: prevent MIME downgrade of message/delivery-status. */
+ && (bounce_info->smtputf8 & SMTPUTF8_FLAG_REQUESTED))
  post_mail_fprintf(bounce, "Content-Transfer-Encoding: %s",
   bounce_info->mime_encoding);
 
Loading...