[Mimedefang] Mimedefang breaks DKIM signing of single-part, plain text emails

Peter Nagel pbnagel at rmi.net
Thu Apr 23 10:15:21 EDT 2015

On 01/15/15, 1:55 PM, Dianne F. Skoll wrote:

> Yes, I can see how MIMEDefang misbehaves if you're trying to sign
> something.  I'll definitely look at fixing the behaviour.
> Regards,
> Dianne.


Using version 2.76, I¹ve moved my DKIM signing stuff to the new
filter_wrapup subroutine, but it¹s still not letting me sign singlepart,
text/plain emails correctly. One problem, I suspect, is line 6140 of
mimedefang.pl, which collapses multipart entities that actually have only
one part back into singlepart entities. It looks to me like that line
replaces the entire email, headers and body both, with just the single part
of the multipart entity, which results in all the non-mime headers getting

So, I tried replacing --

    $rebuilt = $rebuilt->parts(0);

with --


which handles that conversion more intelligently, and now it appears to work
like a charm.

Many thanks,
Peter Nagel

More information about the MIMEDefang mailing list