summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 51ad53a)
raw | patch | inline | side by side (parent: 51ad53a)
author | grubert <grubert@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 4 Feb 2002 09:40:21 +0000 (09:40 +0000) | ||
committer | grubert <grubert@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 4 Feb 2002 09:40:21 +0000 (09:40 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@608 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/mailgw.py | patch | blob | history | |
test/test_mailgw.py | patch | blob | history |
diff --git a/roundup/mailgw.py b/roundup/mailgw.py
index fa53305fc1995de8c9474105a421305f86a5ae25..bf02c3bd1c29fbd6b692b58b7ffd612d41e9f144 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.60 2002-02-01 07:43:12 grubert Exp $
+$Id: mailgw.py,v 1.61 2002-02-04 09:40:21 grubert Exp $
'''
# assume first part is the mail
encoding = part.getencoding()
if encoding == 'base64':
+ # BUG: is base64 really used for text encoding or
+ # are we inserting zip files here.
data = binascii.a2b_base64(part.fp.read())
elif encoding == 'quoted-printable':
# the quopri module wants to work with files
#
# $Log: not supported by cvs2svn $
+# Revision 1.60 2002/02/01 07:43:12 grubert
+# . mailgw checks encoding on first part too.
+#
# Revision 1.59 2002/01/23 21:43:23 richard
# tabnuke
#
diff --git a/test/test_mailgw.py b/test/test_mailgw.py
index d385334375b1bf3b60a6c0f4643a24deea4d6fde..cb53984dc4cdd0e275daada0b0972e3edf4640fe 100644 (file)
--- a/test/test_mailgw.py
+++ b/test/test_mailgw.py
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
-# $Id: test_mailgw.py,v 1.7 2002-01-22 11:54:45 rochecompaan Exp $
+# $Id: test_mailgw.py,v 1.8 2002-02-04 09:40:21 grubert Exp $
import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys
This is a second followup
+----------
+status: unread -> chatting
+___________________________________________________
+"Roundup issue tracker" <issue_tracker@fill.me.in.>
+http://some.useful.url/issue1
+___________________________________________________
+''', 'Generated message not correct')
+
+ def testMultipartEnc01(self):
+ self.testNewIssue()
+ message = cStringIO.StringIO('''Content-Type: text/plain;
+ charset="iso-8859-1"
+From: mary <mary@test>
+To: issue_tracker@fill.me.in.
+Message-Id: <followup_dummy_id>
+In-Reply-To: <dummy_test_message_id>
+Subject: [issue1] Testing...
+Content-Type: multipart/mixed;
+ boundary="----_=_NextPart_000_01"
+
+This message is in MIME format. Since your mail reader does not understand
+this format, some or all of this message may not be legible.
+
+------_=_NextPart_000_01
+Content-Type: text/plain;
+ charset="iso-8859-1"
+Content-Transfer-Encoding: quoted-printable
+
+A message with first part encoded (encoded oe =F6)
+
+''')
+ handler = self.instance.MailGW(self.instance, self.db)
+ handler.main(message)
+ message_data = open(os.environ['SENDMAILDEBUG']).read()
+ self.assertEqual(message_data,
+'''FROM: roundup-admin@fill.me.in.
+TO: chef@bork.bork.bork, richard@test
+Content-Type: text/plain
+Subject: [issue1] Testing...
+To: chef@bork.bork.bork, richard@test
+From: mary <issue_tracker@fill.me.in.>
+Reply-To: Roundup issue tracker <issue_tracker@fill.me.in.>
+MIME-Version: 1.0
+Message-Id: <followup_dummy_id>
+In-Reply-To: <dummy_test_message_id>
+
+
+mary <mary@test> added the comment:
+
+A message with first part encoded (encoded oe รถ)
+
----------
status: unread -> chatting
___________________________________________________
#
# $Log: not supported by cvs2svn $
+# Revision 1.7 2002/01/22 11:54:45 rochecompaan
+# Fixed status change in mail gateway.
+#
# Revision 1.6 2002/01/21 10:05:48 rochecompaan
# Feature:
# . the mail gateway now responds with an error message when invalid