[Mailman-Developers] Attachments directory

Kory Wheatley wheakory at isu.edu
Fri Oct 1 18:53:25 CEST 2004


Question for all of you, I added the addition below code into the 
Scrubber.py script, and the filename extensions are used has specified 
and not changed, so that works.
But when I go and view a Microsoft Word or Microsoft Excel scrubbed 
document in the archives it will not bring up the right plugins and 
displays garbled characters and lines in the browser window.  I know for 
a fact that I have the correct mime types specified on the Apache Web 
server.
Now, here's where it gets strange, I can move that attachment word file 
out of the "/archives/private/mlist/attachments" directory and put it in 
another Mailman directory on the web server, and it will bring up the 
Microsoft Word or Excel plugin and display the document fine.  The mime 
types I thought should be global on the web server, unless you have 
.htaccess file where you want to change the content type for that 
extension, which I don't see in the "attachments" directory.  Any idea 
whats going on?

+    # i18n file name is encoded

+    lcset = Utils.GetCharSet(mlist.preferred_language)

+    filename = Utils.oneline(msg.get_filename(''), lcset)

+    fnext = os.path.splitext(filename)[1]

+    # For safety, we should confirm this is valid ext for content-type

+    # but we can use fnext if we introduce fnext filtering

+    if mm_cfg.SCRUBBER_USE_ATTACHMENT_FILENAME_EXTENSION:

+        ext = fnext

+    else:

+        ext = guess_extension(ctype, fnext)

     if not ext:

         # We don't know what it is, so assume it's just a shapeless

         # application/octet-stream, unless the Content-Type: is



With this patch, site manager can set

SCRUBBER_USE_ATTACHMENT_FILENAME_EXTENSION = True

in mm_cfg.py to use attachment filename extension as is specified by

the original attachment. I also want to merge patch id 1027882

so that really dangerous files can be trapped by MimeDel.py.


-- 
Kory Wheatley
Academic Computing Analyst Sr.
Phone 282-3874
#########################################
Everything must point to him.



More information about the Mailman-Developers mailing list