How do I preserve HTML formatting while filtering other content?

If you want to filter content with Mailman's content filtering, but preserve HTML message formatting, there are a few things you must do. You must ensure that MIME type text/html is not removed. The normal way to do this is to put text/html in pass_mime_types along with your other settings. Adding this to the distributed defaults results in

multipart/mixed
multipart/alternative
text/plain
text/html

however, since there are other multipart sub-types that are commonly used such as multipart/related, a better option is

multipart
text/plain
text/html

The above will allow text/html and text/plain parts to remain in the messages after the initial filtering. You may also want to allow those parts to remain if they are sub-parts of an attached forwarded message message/rfc822 part, and you may want to allow PGP signatures application/pgp-signature resulting in pass_mime_types containing

multipart
message/rfc822
text/plain
text/html
application/pgp-signature

The above will allow text/html parts to remain after initial filtering, but in order that they pass the remaining steps unchanged, you must set

Should Mailman collapse multipart/alternative to its first part content?
(Edit collapse_alternatives)

to No so that a text/html alternative part is not removed in favor of a text/plain alternative, and

Should Mailman convert text/html parts to plain text?
This conversion happens after MIME attachments have been stripped.
(Edit convert_html_to_plaintext)

to No for the obvious reason.

Also, The list's Non-digest options -> scrub_nondigest setting must be No or the HTML part(s) will be stored aside and replaced in delivered messages by brief notes with the URL of the removed part.

MailmanWiki: DOC/How do I preserve HTML formatting while filtering other content? (last edited 2011-12-08 11:07:30 by msapiro)