summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 11595e9)
raw | patch | inline | side by side (parent: 11595e9)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 23 Feb 2004 05:29:06 +0000 (05:29 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Mon, 23 Feb 2004 05:29:06 +0000 (05:29 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2103 57a73879-2fb5-44c3-a270-3262357dd7e2
diff --git a/CHANGES.txt b/CHANGES.txt
index 36aa268bbd59a2826f16e7bd5fa8bb87c7b3bbfe..aebccff66c86bb7c024dd0b08527114f969fa0fc 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
2004-??-?? 0.6.6
Fixed:
- don't insert spaces into designators, it just confuses users (sf bug 898087)
+- Eudora can't handle utf-8 headers. We love Eudora. (sf bug 900046)
2004-02-16 0.6.5
diff --git a/doc/customizing.txt b/doc/customizing.txt
index 4e6dc27f81a8d3a5bafd5ca09c5c1551bdc303b2..5607cdddec29339a9a63f4f32bf5db3a04629299 100644 (file)
--- a/doc/customizing.txt
+++ b/doc/customizing.txt
Customising Roundup
===================
-:Version: $Revision: 1.115 $
+:Version: $Revision: 1.116 $
.. This document borrows from the ZopeBook section on ZPT. The original is at:
http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
wish to make them xhtml, then you'll need to change this var to 'xhtml'
too so all auto-generated HTML is compliant.
+**EMAIL_CHARSET** - ``utf-8`` (or ``iso-8859-1`` for Eudora users)
+ Character set to encode email headers with. We use utf-8 by default, as
+ it's the most flexible. Some mail readers (eg. Eudora) can't cope with
+ that, so you might need to specify a more limited character set (eg.
+ 'iso-8859-1'.
+
The default config.py is given below - as you
can see, the MAIL_DOMAIN must be edited before any interaction with the
tracker is attempted.::
# too so all auto-generated HTML is compliant.
HTML_VERSION = 'html4' # either 'html4' or 'xhtml'
+ # Character set to encode email headers with. We use utf-8 by default, as
+ # it's the most flexible. Some mail readers (eg. Eudora) can't cope with
+ # that, so you might need to specify a more limited character set (eg.
+ # 'iso-8859-1'.
+ EMAIL_CHARSET = 'utf-8'
+ #EMAIL_CHARSET = 'iso-8859-1' # use this instead for Eudora users
+
#
# SECURITY DEFINITIONS
#
diff --git a/roundup/mailer.py b/roundup/mailer.py
index ec5951ed87b12c8bd88289da049dbc51ce81cd7a..ea51fe5fb2af0fde6c62f358648c409bb784e233 100644 (file)
--- a/roundup/mailer.py
+++ b/roundup/mailer.py
"""Sending Roundup-specific mail over SMTP.
"""
__docformat__ = 'restructuredtext'
-# $Id: mailer.py,v 1.5 2004-02-11 23:55:08 richard Exp $
+# $Id: mailer.py,v 1.6 2004-02-23 05:29:05 richard Exp $
import time, quopri, os, socket, smtplib, re
self.config.ADMIN_EMAIL))
message = StringIO()
writer = MimeWriter(message)
- writer.addheader('Subject', encode_header(subject))
+ writer.addheader('Subject', encode_header(subject,
+ self.config.EMAIL_CHARSET))
writer.addheader('To', ', '.join(to))
writer.addheader('From', author)
writer.addheader('Date', time.strftime("%a, %d %b %Y %H:%M:%S +0000",
diff --git a/roundup/rfc2822.py b/roundup/rfc2822.py
index a54d34f3371ac1ac3b201b31a23f9425e3337af7..8fba2ad819de83f806b61960f6819063f5392d27 100644 (file)
--- a/roundup/rfc2822.py
+++ b/roundup/rfc2822.py
outs += unicode(section[0], charset or 'iso-8859-1', 'replace')
return outs.encode('utf-8')
-def encode_header(header):
+def encode_header(header, charset='utf-8'):
""" Will encode in quoted-printable encoding only if header
contains non latin characters
"""
if hqre.match(header):
return header
- charset = 'utf-8'
quoted = ''
#max_encoded = 76 - len(charset) - 7
for c in header:
diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py
index 761f1ae4f8a5da4e93a1316737bd63e149373e5f..61608475c65804226275b79193dcf63f42ba943c 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.97 2004-02-11 23:55:08 richard Exp $
+# $Id: roundupdb.py,v 1.98 2004-02-23 05:29:05 richard Exp $
"""Extending hyperdb with types specific to issue-tracking.
"""
if from_tag:
from_tag = ' ' + from_tag
- subject = '[%s%s] %s' % (cn, nodeid, encode_header(title))
- author = straddr((encode_header(authname) + from_tag, from_address))
+ subject = '[%s%s] %s' % (cn, nodeid, encode_header(title,
+ self.db.config.EMAIL_CHARSET))
+ author = straddr((encode_header(authname, self.db.config.EMAIL_CHARSET)
+ + from_tag, from_address))
# create the message
mailer = Mailer(self.db.config)
message, writer = mailer.get_standard_message(sendto, subject, author)
- tracker_name = encode_header(self.db.config.TRACKER_NAME)
+ tracker_name = encode_header(self.db.config.TRACKER_NAME,
+ self.db.config.EMAIL_CHARSET)
writer.addheader('Reply-To', straddr((tracker_name, from_address)))
if messageid:
writer.addheader('Message-Id', messageid)
index e6f61334bcdbf579d020f4646c9734946b935791..f53678451525edb9fc864d8668da72c544b50ab6 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: config.py,v 1.4 2003-12-06 00:00:54 richard Exp $
+# $Id: config.py,v 1.5 2004-02-23 05:29:05 richard Exp $
import os
# too so all auto-generated HTML is compliant.
HTML_VERSION = 'html4' # either 'html4' or 'xhtml'
+# Character set to encode email headers with. We use utf-8 by default, as
+# it's the most flexible. Some mail readers (eg. Eudora) can't cope with
+# that, so you might need to specify a more limited character set (eg.
+# 'iso-8859-1'.
+EMAIL_CHARSET = 'utf-8'
+#EMAIL_CHARSET = 'iso-8859-1' # use this instead for Eudora users
+
+
#
# SECURITY DEFINITIONS
#
index a3ceeb601a1d1359f6610b82ebc116b8c16b297c..cf82f22fda20d0ae72868fc12d30c1e436b414d1 100644 (file)
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
#
-# $Id: config.py,v 1.3 2003-12-06 00:00:54 richard Exp $
+# $Id: config.py,v 1.4 2004-02-23 05:29:06 richard Exp $
import os
# too so all auto-generated HTML is compliant.
HTML_VERSION = 'html4' # either 'html4' or 'xhtml'
+# Character set to encode email headers with. We use utf-8 by default, as
+# it's the most flexible. Some mail readers (eg. Eudora) can't cope with
+# that, so you might need to specify a more limited character set (eg.
+# 'iso-8859-1'.
+EMAIL_CHARSET = 'utf-8'
+#EMAIL_CHARSET = 'iso-8859-1' # use this instead for Eudora users
+
# vim: set filetype=python ts=4 sw=4 et si