[Mailman-Users] Problems with uuencoded attachments

Dimitrios Gerasimatos Dimitrios.Gerasimatos at jpl.nasa.gov
Sat Jan 14 17:42:27 CET 2006



If I send an attachment encoded with old HP-UX uuencode or
Eudora 6.2.3 uuencode then mailman shunts the message. The
error is "Warning: Trailing garbage" which is actually coming
from Python's uu.py module, which in turn gets it from the
binascii library. I wrote a little script to decode the file
in the shunt directory after running show_qfiles on it:


#!/usr/bin/python


import uu
import os, sys


infile = "myfile"
uu.decode(infile, sys.stdout)


This is where the above error message is coming from. Looking
at the C source code to binascii, this message results because
there are trailing characters in the message which are not
blanks, newlines, or '`' (a special character which means ' '
to some encoders). The character is above the 'end' tag and is
actually the last character in the encoding. Here are the last
few lines:


M,3,P,3(S,B`P,#`P,"!N(`IT<F%I;&5R"CP\("]3:7IE(#DR("]2;V]T(#@Y
M(#`@4B`O26YF;R`Y,"`P(%(@+TE$(#DQ(#`@4B`^/@IS=&%R='AR968*,3,P
+,3,R, at HE)45/1 at HY
`
end


The character Python complains about is the 'Y'. I actually
tried two different files (a PDF and an Excel file) and both
failed with the same error and complained about the last
character. I thought this must be a Python bug, because when I
take the same original file and encode it on an HP-UX command
line I get the same as above, therefore absolving Eudora. However,
if I uuencode the file using MS Outlook I get the following:


M,3,P,3(S,B P,# P,"!N( IT<F%I;&5R"CP\("]3:7IE(#DR("]2;V]T(#@Y
M(# @4B O26YF;R Y," P(%(@+TE$(#DQ(# @4B ^/@IS=&%R='AR968*,3,P
+,3,R, at HE)45/1 at H`
`
end


Mailman/python have no problems with this file sent via Outlook.
Notice the final character is a '`' and not a 'Y'.


I have a few questions:


1. Why do Eudora and HP-UX both produce code different from
   Outlook? Did two vendors make the same bug or is this a
   specification issue?


2. What can I do to mailman such that it can process the
   attachments sent by these rogue mailers like Eudora
   under MacOS X (definitely modern software)? Right now
   it chokes with:


Jan 14 06:36:21 2006 (2768) SHUNTING:
1137189869.4197209+f52dada65a850f1abfbdd0e
2044e7a117a6828f9
Jan 14 06:36:21 2006 (2768) uncaught archiver exception at filepos: 0
Jan 14 06:36:21 2006 (2768) Uncaught runner exception: [Errno 32] Broken
pipe
Jan 14 06:36:21 2006 (2768) Traceback (most recent call last):
  File "/usr/lib/mailman/Mailman/Queue/Runner.py", line 111, in _oneloop
    self._onefile(msg, msgdata)
  File "/usr/lib/mailman/Mailman/Queue/Runner.py", line 167, in _onefile
    keepqueued = self._dispose(mlist, msg, msgdata)
  File "/usr/lib/mailman/Mailman/Queue/ArchRunner.py", line 73, in _dispose
    mlist.ArchiveMail(msg)
  File "/usr/lib/mailman/Mailman/Archiver/Archiver.py", line 216, in
ArchiveMail
    h.processUnixMailbox(f)
  File "/usr/lib/mailman/Mailman/Archiver/pipermail.py", line 569, in
processUni
xMailbox
    m = mbox.next()
  File "/usr/lib/python2.3/mailbox.py", line 35, in next
    return self.factory(_Subfile(self.fp, start, stop))
  File "/usr/lib/mailman/Mailman/Mailbox.py", line 89, in scrubber
    return mailbox.scrub(msg)
  File "/usr/lib/mailman/Mailman/Mailbox.py", line 109, in scrub
    return self._scrubber(self._mlist, msg)
  File "/usr/lib/mailman/Mailman/Handlers/Scrubber.py", line 290, in process
    payload = part.get_payload(decode=True)
  File "/usr/lib/mailman/pythonlib/email/Message.py", line 223, in
get_payload
    uu.decode(StringIO(payload+'\n'), sfp)
  File "/usr/lib/python2.3/uu.py", line 139, in decode
    sys.stderr.write("Warning: %s\n" % str(v))
  File "/usr/lib/mailman/Mailman/Logging/MultiLogger.py", line 45, in write
    _logexc(logger, msg)
  File "/usr/lib/mailman/Mailman/Logging/Utils.py", line 22, in _logexc
    sys.__stderr__.write('Logging error: %s\n' % logger)
IOError: [Errno 32] Broken pipe


3. Is this possibly a python bug? HP-UX uudecode can decode
   these files no problem, but python gives me the
   "Warning: Trailing garbage" error. What's more, if I
   mail from Eudora to an IMAP account (not mailman) I have
   no problem opening the Eudora attachment in MS Outlook.
   Therefore, why does mailman dislike it?


This is mailman 2.1.7 with python 2.4.


Thanks for the help!


Dimitri

--
Dimitrios Gerasimatos       dimitrios.gerasimatos at jpl.nasa.gov
Section 343 System Administration    Jet Propulsion Laboratory
4800 Oak Grove Dr.    Mail Stop 301-276,   Pasadena, CA  91109
Voice: 818.354.4910    FAX: 818.393.7102    Cell: 818.726.8617





More information about the Mailman-Users mailing list