summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 60cf9e8)
raw | patch | inline | side by side (parent: 60cf9e8)
author | grubert <grubert@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 1 Feb 2002 07:43:12 +0000 (07:43 +0000) | ||
committer | grubert <grubert@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 1 Feb 2002 07:43:12 +0000 (07:43 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@607 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/mailgw.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 049be7e0fed8bf51a589ed8171d7160fcb3ca402..4382fb87468bd94185815ef1b6adfb76038d3d74 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
. you can now use the roundup-admin tool pack the database
Fixed:
+ . mailgw checks encoding on first part too.
. the mail gateway now responds with an error message when invalid values
for arguments are specified for link or mutlilink properties
. modified unit test to check nosy and assignedto when specified as arguments
. run_tests testReldate_date failed if LANG is 'german'
. mailgw failures (unexpected ones) are forwarded to the roundup admin
-
2002-01-16 - 0.4.0b2
Fixed:
. #495392 ] empty nosy -patch
diff --git a/roundup/mailgw.py b/roundup/mailgw.py
index 87a685cbe17eb77b05a8327d5f3b7839218ad371..fa53305fc1995de8c9474105a421305f86a5ae25 100644 (file)
--- a/roundup/mailgw.py
+++ b/roundup/mailgw.py
an exception, the original message is bounced back to the sender with the
explanatory message given in the exception.
-$Id: mailgw.py,v 1.59 2002-01-23 21:43:23 richard Exp $
+$Id: mailgw.py,v 1.60 2002-02-01 07:43:12 grubert Exp $
'''
subtype = part.gettype()
if subtype == 'text/plain' and not content:
# add all text/plain parts to the message content
+ # BUG (in code or comment) only add the first one.
if content is None:
- content = part.fp.read()
+ # try name on Content-Type
+ # maybe add name to non text content ?
+ name = part.getparam('name')
+ # assume first part is the mail
+ encoding = part.getencoding()
+ if encoding == 'base64':
+ data = binascii.a2b_base64(part.fp.read())
+ elif encoding == 'quoted-printable':
+ # the quopri module wants to work with files
+ decoded = cStringIO.StringIO()
+ quopri.decode(part.fp, decoded)
+ data = decoded.getvalue()
+ elif encoding == 'uuencoded':
+ data = binascii.a2b_uu(part.fp.read())
+ attachments.append((name, part.gettype(), data))
+ else:
+ # take it as text
+ data = part.fp.read()
+ content = data
else:
content = content + part.fp.read()
elif encoding == 'uuencoded':
data = binascii.a2b_uu(part.fp.read())
attachments.append((name, part.gettype(), data))
-
if content is None:
raise MailUsageError, '''
Roundup requires the submission to be plain text. The message parser could
#
# $Log: not supported by cvs2svn $
+# Revision 1.59 2002/01/23 21:43:23 richard
+# tabnuke
+#
# Revision 1.58 2002/01/23 21:41:56 richard
# . mailgw failures (unexpected ones) are forwarded to the roundup admin
#