summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 78cd430)
raw | patch | inline | side by side (parent: 78cd430)
author | rochecompaan <rochecompaan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 18 Mar 2002 18:32:00 +0000 (18:32 +0000) | ||
committer | rochecompaan <rochecompaan@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 18 Mar 2002 18:32:00 +0000 (18:32 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@677 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/roundupdb.py | patch | blob | history | |
test/test_mailgw.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 0800add9b7db09005e42c71d0f25685398630530..5143ab7c8fd54eb78a06c426a0dc694f54fa9167 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
field won't exist in most installations, but it will be added to the
default templates.
. #517734 ] web header customisation is obscure
+ . All messages sent to the nosy list are now encoded as
+ quoted-printable before they are sent.
Fixed:
. Clean up mail handling, multipart handling.
diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py
index 0ff49ece6d884dfb6154ea360dc2ebb102075b98..bce531513554842af812c949173a08c2421fe94e 100644 (file)
--- a/roundup/roundupdb.py
+++ b/roundup/roundupdb.py
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: roundupdb.py,v 1.47 2002-02-27 03:16:02 richard Exp $
+# $Id: roundupdb.py,v 1.48 2002-03-18 18:32:00 rochecompaan Exp $
__doc__ = """
Extending hyperdb with types specific to issue-tracking.
import re, os, smtplib, socket, copy, time, random
import MimeWriter, cStringIO
-import base64, mimetypes
+import base64, quopri, mimetypes
import hyperdb, date
if self.db.config.EMAIL_SIGNATURE_POSITION == 'bottom':
m.append(self.email_signature(nodeid, msgid))
+ # encode the content as quoted-printable
+ content = cStringIO.StringIO('\n'.join(m))
+ content_encoded = cStringIO.StringIO()
+ quopri.encode(content, content_encoded, 0)
+ content_encoded.seek(0)
+ content_encoded = content_encoded.read()
+
# get the files for this message
message_files = messages.get(msgid, 'files')
if message_files:
part = writer.startmultipartbody('mixed')
part = writer.nextpart()
+ part.addheader('Content-Transfer-Encoding', 'quoted-printable')
body = part.startbody('text/plain')
- body.write('\n'.join(m))
+ body.write(content_encoded)
for fileid in message_files:
name = files.get(fileid, 'name')
mime_type = files.get(fileid, 'type')
body.write(base64.encodestring(content))
writer.lastpart()
else:
+ writer.addheader('Content-Transfer-Encoding', 'quoted-printable')
body = writer.startbody('text/plain')
- body.write('\n'.join(m))
+ body.write(content_encoded)
# now try to send the message
if SENDMAILDEBUG:
#
# $Log: not supported by cvs2svn $
+# Revision 1.47 2002/02/27 03:16:02 richard
+# Fixed a couple of dodgy bits found by pychekcer.
+#
# Revision 1.46 2002/02/25 14:22:59 grubert
# . roundup db: catch only IOError in getfile.
#
diff --git a/test/test_mailgw.py b/test/test_mailgw.py
index f6a5ba80ed35dc38fe1b8a5a635e2659b187f877..c896afc7c09b0547692c551279c1ad9e149cdaaf 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.13 2002-02-15 07:08:45 richard Exp $
+# $Id: test_mailgw.py,v 1.14 2002-03-18 18:32:00 rochecompaan Exp $
import unittest, cStringIO, tempfile, os, shutil, errno, imp, sys
except OSError, error:
if error.errno not in (errno.ENOENT, errno.ESRCH): raise
- def xtestNewIssue(self):
+ def testNewIssue(self):
message = cStringIO.StringIO('''Content-Type: text/plain;
charset="iso-8859-1"
From: Chef <chef@bork.bork.bork
self.assertEqual(userlist, self.db.user.list(),
"user created when it shouldn't have been")
- def xtestNewIssueNoClass(self):
+ def testNewIssueNoClass(self):
message = cStringIO.StringIO('''Content-Type: text/plain;
charset="iso-8859-1"
From: Chef <chef@bork.bork.bork
error = open(os.environ['SENDMAILDEBUG']).read()
self.assertEqual('no error', error)
- def xtestNewIssueAuthMsg(self):
+ def testNewIssueAuthMsg(self):
message = cStringIO.StringIO('''Content-Type: text/plain;
charset="iso-8859-1"
From: Chef <chef@bork.bork.bork
MIME-Version: 1.0
Message-Id: <dummy_test_message_id>
X-Roundup-Name: Roundup issue tracker
+Content-Transfer-Encoding: quoted-printable
New submission from Chef <chef@bork.bork.bork>:
# BUG should test some binary attamchent too.
- def xtestFollowup(self):
+ def testFollowup(self):
self.testNewIssue()
message = cStringIO.StringIO('''Content-Type: text/plain;
charset="iso-8859-1"
Message-Id: <followup_dummy_id>
In-Reply-To: <dummy_test_message_id>
X-Roundup-Name: Roundup issue tracker
+Content-Transfer-Encoding: quoted-printable
richard <richard@test> added the comment:
___________________________________________________
''', 'Generated message not correct')
- def xtestFollowup2(self):
+ def testFollowup2(self):
self.testNewIssue()
message = cStringIO.StringIO('''Content-Type: text/plain;
charset="iso-8859-1"
Message-Id: <followup_dummy_id>
In-Reply-To: <dummy_test_message_id>
X-Roundup-Name: Roundup issue tracker
+Content-Transfer-Encoding: quoted-printable
mary <mary@test> added the comment:
___________________________________________________
''', 'Generated message not correct')
- def xtestFollowupTitleMatch(self):
+ def testFollowupTitleMatch(self):
self.testNewIssue()
message = cStringIO.StringIO('''Content-Type: text/plain;
charset="iso-8859-1"
Message-Id: <followup_dummy_id>
In-Reply-To: <dummy_test_message_id>
X-Roundup-Name: Roundup issue tracker
+Content-Transfer-Encoding: quoted-printable
richard <richard@test> added the comment:
___________________________________________________
''') #, 'Generated message not correct')
- def xtestEnc01(self):
+ def testEnc01(self):
self.testNewIssue()
message = cStringIO.StringIO('''Content-Type: text/plain;
charset="iso-8859-1"
Message-Id: <followup_dummy_id>
In-Reply-To: <dummy_test_message_id>
X-Roundup-Name: Roundup issue tracker
+Content-Transfer-Encoding: quoted-printable
mary <mary@test> added the comment:
-A message with encoding (encoded oe ö)
+A message with encoding (encoded oe =F6)
----------
status: unread -> chatting
''', 'Generated message not correct')
- def xtestMultipartEnc01(self):
+ def testMultipartEnc01(self):
self.testNewIssue()
message = cStringIO.StringIO('''Content-Type: text/plain;
charset="iso-8859-1"
Message-Id: <followup_dummy_id>
In-Reply-To: <dummy_test_message_id>
X-Roundup-Name: Roundup issue tracker
+Content-Transfer-Encoding: quoted-printable
mary <mary@test> added the comment:
-A message with first part encoded (encoded oe ö)
+A message with first part encoded (encoded oe =F6)
----------
status: unread -> chatting
#
# $Log: not supported by cvs2svn $
+# Revision 1.13 2002/02/15 07:08:45 richard
+# . Alternate email addresses are now available for users. See the MIGRATION
+# file for info on how to activate the feature.
+#
# Revision 1.12 2002/02/15 00:13:38 richard
# . #503204 ] mailgw needs a default class
# - partially done - the setting of additional properties can wait for a