Skip to content

Commit 369dde4

Browse files
author
Richard Jones
committed
merge from HEAD
1 parent 87af7d2 commit 369dde4

File tree

6 files changed

+38
-10
lines changed

6 files changed

+38
-10
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ are given with the most recent entry first.
44
2004-??-?? 0.6.6
55
Fixed:
66
- don't insert spaces into designators, it just confuses users (sf bug 898087)
7+
- Eudora can't handle utf-8 headers. We love Eudora. (sf bug 900046)
78

89

910
2004-02-16 0.6.5

doc/customizing.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Customising Roundup
33
===================
44

5-
:Version: $Revision: 1.93.2.6 $
5+
:Version: $Revision: 1.93.2.7 $
66

77
.. This document borrows from the ZopeBook section on ZPT. The original is at:
88
http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
@@ -180,6 +180,12 @@ The configuration variables available are:
180180
Default class to use in the mailgw if one isn't supplied in email
181181
subjects. To disable, comment out the variable below or leave it blank.
182182

183+
**EMAIL_CHARSET** - ``utf-8`` (or ``iso-8859-1`` for Eudora users)
184+
Character set to encode email headers with. We use utf-8 by default, as
185+
it's the most flexible. Some mail readers (eg. Eudora) can't cope with
186+
that, so you might need to specify a more limited character set (eg.
187+
'iso-8859-1'.
188+
183189
The default config.py is given below - as you
184190
can see, the MAIL_DOMAIN must be edited before any interaction with the
185191
tracker is attempted.::
@@ -255,6 +261,13 @@ tracker is attempted.::
255261
MAIL_DEFAULT_CLASS = 'issue' # use "issue" class by default
256262
#MAIL_DEFAULT_CLASS = '' # disable (or just comment the var out)
257263

264+
# Character set to encode email headers with. We use utf-8 by default, as
265+
# it's the most flexible. Some mail readers (eg. Eudora) can't cope with
266+
# that, so you might need to specify a more limited character set (eg.
267+
# 'iso-8859-1'.
268+
EMAIL_CHARSET = 'utf-8'
269+
#EMAIL_CHARSET = 'iso-8859-1' # use this instead for Eudora users
270+
258271
#
259272
# SECURITY DEFINITIONS
260273
#

roundup/rfc2822.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def decode_header(hdr):
114114
outs += unicode(section[0], charset or 'iso-8859-1', 'replace')
115115
return outs.encode('utf-8')
116116

117-
def encode_header(header):
117+
def encode_header(header, charset='utf-8'):
118118
""" Will encode in quoted-printable encoding only if header
119119
contains non latin characters
120120
"""
@@ -127,7 +127,6 @@ def encode_header(header):
127127
if hqre.match(header):
128128
return header
129129

130-
charset = 'utf-8'
131130
quoted = ''
132131
#max_encoded = 76 - len(charset) - 7
133132
for c in header:

roundup/roundupdb.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: roundupdb.py,v 1.86.2.1 2003-09-18 07:29:56 kedder Exp $
18+
# $Id: roundupdb.py,v 1.86.2.2 2004-02-23 05:37:11 richard Exp $
1919

2020
__doc__ = """
2121
Extending hyperdb with types specific to issue-tracking.
@@ -273,11 +273,12 @@ def send_message(self, nodeid, msgid, note, sendto, from_address=None):
273273
message = cStringIO.StringIO()
274274
writer = MimeWriter.MimeWriter(message)
275275
writer.addheader('Subject', '[%s%s] %s'%(cn, nodeid,
276-
encode_header(title)))
276+
encode_header(title, self.db.config.EMAIL_CHARSET)))
277277
writer.addheader('To', ', '.join(sendto))
278-
writer.addheader('From', straddr((encode_header(authname) +
279-
from_tag, from_address)))
280-
tracker_name = encode_header(self.db.config.TRACKER_NAME)
278+
writer.addheader('From', straddr((encode_header(authname,
279+
self.db.config.EMAIL_CHARSET) + from_tag, from_address)))
280+
tracker_name = encode_header(self.db.config.TRACKER_NAME,
281+
self.db.config.EMAIL_CHARSET)
281282
writer.addheader('Reply-To', straddr((tracker_name, from_address)))
282283
writer.addheader('Date', time.strftime("%a, %d %b %Y %H:%M:%S +0000",
283284
time.gmtime()))

templates/classic/config.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: config.py,v 1.3 2003-04-24 07:19:59 richard Exp $
18+
# $Id: config.py,v 1.3.2.1 2004-02-23 05:37:11 richard Exp $
1919

2020
import os
2121

@@ -106,6 +106,13 @@
106106
MAIL_DEFAULT_CLASS = 'issue' # use "issue" class by default
107107
#MAIL_DEFAULT_CLASS = '' # disable (or just comment the var out)
108108

109+
# Character set to encode email headers with. We use utf-8 by default, as
110+
# it's the most flexible. Some mail readers (eg. Eudora) can't cope with
111+
# that, so you might need to specify a more limited character set (eg.
112+
# 'iso-8859-1'.
113+
EMAIL_CHARSET = 'utf-8'
114+
#EMAIL_CHARSET = 'iso-8859-1' # use this instead for Eudora users
115+
109116
#
110117
# SECURITY DEFINITIONS
111118
#

templates/minimal/config.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: config.py,v 1.2 2003-04-24 07:20:00 richard Exp $
18+
# $Id: config.py,v 1.2.2.1 2004-02-23 05:37:11 richard Exp $
1919

2020
import os
2121

@@ -110,4 +110,11 @@
110110
MAIL_DEFAULT_CLASS = 'issue' # use "issue" class by default
111111
#MAIL_DEFAULT_CLASS = '' # disable (or just comment the var out)
112112

113+
# Character set to encode email headers with. We use utf-8 by default, as
114+
# it's the most flexible. Some mail readers (eg. Eudora) can't cope with
115+
# that, so you might need to specify a more limited character set (eg.
116+
# 'iso-8859-1'.
117+
EMAIL_CHARSET = 'utf-8'
118+
#EMAIL_CHARSET = 'iso-8859-1' # use this instead for Eudora users
119+
113120
# vim: set filetype=python ts=4 sw=4 et si

0 commit comments

Comments
 (0)