[Mailman-Users] attached "text.sxw" becomes "text.bin" in archives and digests, why?

Richard Barrett r.barrett at openinfo.co.uk
Fri Nov 21 21:21:03 CET 2003


On 20 Nov 2003, at 13:51, Robert Breithuber wrote:

> everytime an attachment becomes scrubbed, some document types get a new
> fileextension like .bin or .exe
>
> e.g. the attached file was text.sxw (staroffice-text-document):
>
> in archive and digests it gets scrubbed like this:
>
> Dateiname   : plan.sxw
> Dateityp    : application/vnd.sun.xml.writer
> Dateigröße  : 5449 bytes
> Beschreibung: nicht verfügbar
> URL         : https://.../pipermail/.../attachments/.../plan.bin
>
> why .bin?
>
> is this because the "scrubber" doesnt know what
> "application/vnd.sun.xml.writer" is ?
> why is the extension changed anyway?
> can i affect this behavior in any way?
>

$prefix/Mailman/Handlers/Scrubber.py uses the Python mimetypes module 
to try and determine an appropriate file extension from the MIME type 
it has found. The standard set of such mappings held by the mimetypes 
module does not include application/vnd.sun.xml.writer.

The mimetypes module attempts to parse a number of files when loaded to 
extend the mappings it knows about; you could add the missing MIME 
definitions to one of these files and this should solve your problem.

Try running python from the command line as shown in the following 
transcript; this will tell you which files the mimetypes module 
attempts to harvest information from. Add what you want to one of these 
files, if any exist on your system, or you could create one of them 
containing what you need if none of them exist on your system. This 
works for me with Python 2.2.2 and 2.3. You may need to check the 
mimetypes module documentation if you run some other Python version.

mailman at mailman:~> python
Python 2.2.2 (#3, Feb 11 2003, 16:57:53)
[GCC 2.95.3 20010315 (SuSE)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import mimetypes
 >>> mimetypes.knownfiles
['/usr/local/etc/httpd/conf/mime.types', 
'/usr/local/lib/netscape/mime.types', 
'/usr/local/etc/httpd/conf/mime.types', '/usr/local/etc/mime.types']
 >>> import sys
 >>> sys.exit()
mailman at mailman:~>

> please help!
>
> greetings,
>
> robert
>
> -- 
>  _________________________________________
> / If at first you don't succeed, you must \
> \ be a programmer.                        /
>  -----------------------------------------
>         \   ^__^
>          \  (oo)\_______
>             (__)\       )\/\
>                 ||----w |
>                 ||     ||
-----------------------------------------------------------------------
Richard Barrett                               http://www.openinfo.co.uk





More information about the Mailman-Users mailing list