[Mailman-Users] preserve html and allow attachements

Mark Sapiro mark at msapiro.net
Tue Feb 27 15:07:39 EST 2018

On 02/26/2018 02:49 PM, Tammy Mitchell wrote:
> Hi, I've been reading posts I find through google searches to try to
> solve this. I can't seem to find the correct settings.
> -I'm trying to allow html email, with attachments of photos and .pdfs.

You have two choices. You can set Content filtering -> filter_content to
No, or you can set filter_content to Yes and set the following


collapse_alternatives: No
convert_html_to_plaintext: No

You may also want to add some "rare" pdf types like application/nappdf
and application/x-pdf and possibly limit image types to, e.g.,
image/jpeg, image/png, image/tiff depending on what you want to allow.

> -I'd also like my archives to look like the email people get. Right now
> it looks like text with code. The html is staying raw, filled with the
> code, it is not rendering properly. My attachements are still all being
> scrubbed.

Pipermail doesn't do that. Non text/plain attachments will always be
scrubbed. HTML will always be HTML escaped unless you add


See the docs in Mailman/Defaults.py which say in part

> # 3 - Remove text/html as attachments but don't HTML-escape them. Note: this
> #     is very dangerous because it essentially means anybody can send an HTML
> #     email to your site containing evil JavaScript or web bugs, or other
> #     nasty things, and folks viewing your archives will be susceptible.  You
> #     should only consider this option if you do heavy moderation of your list
> #     postings.
> #
> # Note: given the current archiving code, it is not possible to leave
> # text/html parts inline and un-escaped.  I wouldn't think it'd be a good idea
> # to do anyway.

The alternative is to use an external archiver such as MHonArc

> -I guess I'd like the archive messages to show as rendered html, with a
> link to any attachments that were included in the mail.
> -I would like the default view of my archives to be set to Thread.
> I've gotten this far:
> I am allowing html email to go to my list and that is working well.
> Last week, I had it working so attachments would go with the email. That
> was working. It is not now, since I made the changes described below:
> Today I read instructions, on this page, and changed the settings as
> advised here.
> https://wiki.list.org/DOC/How%20do%20I%20preserve%20HTML%20formatting%20while%20filtering%20other%20content%3F
> Changed the settings as described in that link. I thought it would allow
> my archives to look like rendered html.
> (nope).
> - also now my attachments are not being sent with the email messages as
> they had been.

Did you set scrub_nondigest to Yes? (The FAQ says be sure it's No), but
setting it Yes or not passing HTML at all are the only things that would
cause this.

> I'm in a plesk environment so I don't have access to the mail Mailman
> files. I might be able to ask my administrator if he'd change some files
> if needed.

He'd be the one to change ARCHIVE_HTML_SANITIZER, but it's a global
setting and doesn't do exactly what you want anyway.

> My archives are at:
> http://lists.cotyrone.com/pipermail/ulsterancestry/
> Do you suggest the easiest thing for me to do, would be to set my own
> list up at:
> https://www.mail-archive.com/search?q=preserve+html+and+allow+attachements&l=mailman-users%40python.org

That search returns no results. and mail-archive.com is an archiving
service, not a list host, but you could archive your list there if you
like it better than pipermail.

> Also, should I be asking my server admin to upgrade me to Mailman 3.x at
> this time, since my list is new. How hard would that be for him to
> install, and keep up to date in the Plesk environment?

I have no idea how difficult it would be to install Mailman 3 under
Plesk. Mailman 3 installation is non-trivial. According to
<https://wiki.list.org/DOC/Mailman%20and%20Plesk>, installing Mailman 2
upgrades manually is non-trivial - "It is possible to trick Plesk into
recognizing newer versions installed manually but it's not for the faint
of heart."

The situation might be easier with Mailman 3 since Plesk knows nothing
about it.

You might want to check out
to see what Mailman 3's HyperKitty archives look like, but that list is
plain text only. There are other lists at
<https://mail.python.org/mm3/mailman3/>, but I don't know if any have
HTML in their archives.

Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan

More information about the Mailman-Users mailing list