[Mailman-Users] delivering contents of private archive, bad MIME types

maeder+mm at mathconsult.ch maeder+mm at mathconsult.ch
Thu Dec 29 10:30:12 CET 2005


for a private archive, the Cgi/private script not only checks authentication/
authorisation, but also delivers the contents. (This task would probably
better be left to Apache.) Here's one problem:

the script has its own logic for determining the MIME type of attachments,
separate from Apache. The one private list I am running accepts attachments
of many types (images, vrml files, zip archives, ...), and I let MHonArc
do the archiving. My members told me that they could not view vrml files,
and indeed Cgi/private treats them as HTML. It uses the Python library
mimemtypes.py to guess the mime type of files, and this in turn uses
a random-looking list of files to check, in my case (Python 2.3) it is

knownfiles = [
    "/etc/mime.types",
    "/usr/local/etc/httpd/conf/mime.types",
    "/usr/local/lib/netscape/mime.types",
    "/usr/local/etc/httpd/conf/mime.types",     # Apache 1.2
    "/usr/local/etc/mime.types",                # Apache 1.3
    ]

as a quick fix, I edited Cgi/private.py to override this with a line

	mimetypes.init(["/www/apache/conf/mime.types"])

which is where my Apache lives. In this way it is at least synchronized
with Apache. However, this is a bad hack. If it is deemed ok that Mailman
takes on the role of Web server, there should probably be a config option
that points to the mime.types file to use.

Roman Maeder




More information about the Mailman-Users mailing list