[Mimedefang] base64 to quoted-printable

Bill Cole mdlist-20140424 at billmail.scconsult.com
Wed Oct 11 16:42:30 EDT 2017

On 10 Oct 2017, at 18:24, Michael Fox wrote:

> Then, I see an action_change_header(), but no action_change_body().  
> So,
> presume I need to build a new entity by copying headers from the old 
> entity,
> replacing the Content-Transfer-Encoding header, and replacing the 
> body.
> Then use replace_entire_message().
> Does that sound about right?

Yes. For what you are determined to do, that would be the way. Note that 
if the message body has been cryptographically signed in any way (DKIM, 
OpenPGP, S/MIME, whatever) your replacement of the message will 
invalidate the signature.

> Also, I've got to believe someone else has needed to do this before.  
> But
> I'm finding it tough to locate examples.

Faith is an amazing thing... :)

The irony is that this was more likely to be needed in the early 90's, 
when there were many clients that could handle QP and not Base64, but 
there wasn't any comprehensive toolkit for manipulating MIME messages. 
By the time the tools got really good, it was no longer much needed or 
generally safe to do the conversion to accommodate mail clients.

If the old client that you are accommodating is running on (or even just 
displaying on) a reasonably modern OS, there's a strong chance that 
you'll actually do better for readability by using UTF-8 as the 
character set and "8bit" encoding instead of QP. Many (but not all) 
older mail clients don't really know MIME but do happily pass through 
all 8 bits of every byte to their output, whether it's a terminal driver 
or a GUI API.

More information about the MIMEDefang mailing list