On Thu, Nov 16, 2023 at 03:18:13PM -0500, postfix--- via Postfix-users wrote:

> I'm thinking someone has probably already seen this and wondering if anyone
> has a work around (other than send the bounce somewhere else which may or
> may not be possible in my current situation, still investigating that).

News to me, FWIW.

> In brief if a Postfix bounce message is sent through Amazon SES, and the
> bounce message contains a third part with the Content-Type:
> text/rfc822-headers, and the original message (and therefore the body part
> of the text/rfc822-headers message) included a multipart Content-Type
> header, Amazon rejects the bounce message with "554 Transaction failed:
> Missing start boundary." I'm guessing this is an error on Amazon's part;
> they shouldn't be expecting actual inner boundary delimiters in the
> text/rfc822-headers part of the message. (Should they?)

They're definitely wrong.  It's a bug.

> I'll include the setup I used to test this below in case I'm missing
> something on my end but if not, is there a way around this? I.E., maybe some
> way to exclude that header from the text/rfc822-headers part of the message
> (for my particular usage I probably won't need it on a bounce; and if it's
> between that and getting the message delivered I'd rather it be delivered).

You'd need to apply "body checks" to internally generated mail, which is
generally not recommended, and would apply regardless of context, not
just to bounced header-only content.

    main.cf:
        internal_mail_filter_classes = bounce
        bounce_body_checks = pcre:{ {~^(Content-Type:\s*multipart/)~ X-$${1}} }

    master.cf:
        bounce     unix  -       -       n       -       0       bounce
            -o { cleanup_service_name = bounce-cleanup }
        bounce-cleanup unix n    -       n       -       0       cleanup
            -o { receive_override_options = no_milters }
            -o { disable_mime_input_processing = no }
            -o { body_checks = $bounce_body_checks }
            -o { header_checks = }
            -o { nested_header_checks = }

-- 
    Viktor.
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to