[Mimedefang] BUG: filter_begin always gets a multipart MIME::Entity

Dianne Skoll dfs at roaringpenguin.com
Wed Jul 12 07:14:56 EDT 2017

On Wed, 12 Jul 2017 00:35:17 -0400
"Bill Cole" <mdlist-20140424 at billmail.scconsult.com> wrote:

> This is apparently
> a manifestation of documented behavior in an undocumented
> circumstance: mimedefang-filter (5) says an existing message that is
> not already multipart/mixed will be wrapped in a multipart/mixed
> container if you call action_add_part(). I don't. Anywhere. Ever.

Actually, the documentation isn't quite right.  MIMEDefang
unconditionally wraps the message.  Here's the code:

    $entity = $parser->parse(\*FILE);


    # Make entity multipart
    my ($code);
    $code = $entity->make_multipart();
    $WasMultiPart = ($code eq 'ALREADY');

There's an escape hatch: You can check the (undocumented, alas) global
variable $WasMultiPart to determine if the original message was multipart.



More information about the MIMEDefang mailing list