summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 845fd75)
raw | patch | inline | side by side (parent: 845fd75)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 17 Mar 2009 22:56:38 +0000 (22:56 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Tue, 17 Mar 2009 22:56:38 +0000 (22:56 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4206 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
roundup/cgi/client.py | patch | blob | history | |
roundup/mailer.py | patch | blob | history | |
roundup/roundupdb.py | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 0072ce3e7bd379f8ff18b6c678398377f71682bd..fef50e946c6aeadebcab5e651198e949f25ab043 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
Fixes:
- bug introduced into CVS export and view
+- bugs introduced in the migration to the email package (issue 2550531)
2009-03-13 1.4.7 (r4202)
diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py
index 354be09ad2cc0ddcd3e21f6e7da1f42d203fa880..6b74e4be62f4a870891df681e8c93eeb7b4daebd 100644 (file)
--- a/roundup/cgi/client.py
+++ b/roundup/cgi/client.py
from roundup.exceptions import *
from roundup.cgi.exceptions import *
from roundup.cgi.form_parser import FormParser
-from roundup.mailer import Mailer, MessageSendError
+from roundup.mailer import Mailer, MessageSendError, encode_quopri
from roundup.cgi import accept_language
from roundup import xmlrpc
to = [self.mailer.config.ADMIN_EMAIL]
subject = "Templating Error: %s" % exc_info[1]
content = cgitb.pt_html()
- message, writer = self.mailer.get_standard_message(
- to, subject)
- writer.addheader('Content-Transfer-Encoding', 'quoted-printable')
- body = writer.startbody('text/html; charset=utf-8')
- content = StringIO(content)
- quopri.encode(content, body, 0)
- self.mailer.smtp_send(to, message)
+ message = self.mailer.get_standard_message(to, subject)
+ # delete existing content-type headers
+ del message['Content-type']
+ message['Content-type'] = 'text/html; charset=utf-8'
+ message.set_payload(content)
+ encode_quopri(message)
+ self.mailer.smtp_send(to, str(message))
# Now report the error to the user.
return self._(error_message)
except:
diff --git a/roundup/mailer.py b/roundup/mailer.py
index 9c70852317f36fd6a35f087d65d8d11c482f7b95..f52e20c4078911a5fe7c4953708d307f1e64f74b 100644 (file)
--- a/roundup/mailer.py
+++ b/roundup/mailer.py
orig = msg.get_payload()
encdata = quopri.encodestring(orig)
msg.set_payload(encdata)
+ del msg['Content-Transfer-Encoding']
msg['Content-Transfer-Encoding'] = 'quoted-printable'
class Mailer:
Subject and author are encoded using the EMAIL_CHARSET from the
config (default UTF-8).
- Returns a Message object and body part writer.
+ Returns a Message object.
'''
# encode header values if they need to be
charset = getattr(self.config, 'EMAIL_CHARSET', 'utf-8')
message = MIMEMultipart()
else:
message = Message()
+ message.set_type('text/plain')
message.set_charset(charset)
- message['Content-Type'] = 'text/plain; charset="%s"'%charset
try:
message['Subject'] = subject.encode('ascii')
"""
message = self.get_standard_message(to, subject, author)
message.set_payload(content)
+ encode_quopri(message)
self.smtp_send(to, str(message))
def bounce_message(self, bounced_message, to, error,
diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py
index 7c3106c5889dbbf477e2f38a0be529e2a4f51ff3..fe9c8e315b947cd9b0ce4f8b2090560f1dcc4d47 100644 (file)
--- a/roundup/roundupdb.py
+++ b/roundup/roundupdb.py
encode_quopri(message)
if first:
- mailer.smtp_send(sendto + bcc_sendto, message)
+ mailer.smtp_send(sendto + bcc_sendto, str(message))
else:
- mailer.smtp_send(sendto, message)
+ mailer.smtp_send(sendto, str(message))
first = False
def email_signature(self, nodeid, msgid):