[Mailman-Users] Disable attachment scrubbing?

Mark Sapiro mark at msapiro.net
Sun Aug 2 18:10:11 CEST 2009

Edward Harvey quoted me and wrote:
>> If you mean replace the attachment with a link that preserves the
>> original attachment file name and extension, put the following in
>> mm_cfg.py
>That is precisely what I was looking for, thank you very much.
>The root cause of the problem was - People are starting to use docx and
>xlsx files by default now, and these mime types aren't recognized (at
>least in the version of mailman that I have.)  So they get renamed
>"attachment.bin" and that's a problem for non-technical users.

Actually, it's not mailman that doesn't recognize the MIME type.
Mailman (Scrubber) calls the Python library
mimetypes.guess_all_extensions() to 'guess' the extension for the MIME
type. This in turn, at least with Python 2.3 and newer, looks in the
following list of system files for mappings from MIME type to

knownfiles = [
    "/etc/httpd/mime.types",                    # Mac OS X
    "/etc/httpd/conf/mime.types",               # Apache
    "/etc/apache/mime.types",                   # Apache 1
    "/etc/apache2/mime.types",                  # Apache 2
    "/usr/local/etc/httpd/conf/mime.types",     # Apache 1.2
    "/usr/local/etc/mime.types",                # Apache 1.3

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