Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
77a3a5a5
Commit
77a3a5a5
authored
Aug 14, 2009
by
Alec Mitchell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Be a little more tolerant of encoded headers when no charset is passed or inferrable.
parent
57785248
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
src/Products/MailHost/MailHost.py
src/Products/MailHost/MailHost.py
+8
-6
No files found.
src/Products/MailHost/MailHost.py
View file @
77a3a5a5
...
...
@@ -434,7 +434,9 @@ def _mungeHeaders(messageText, mto=None, mfrom=None, subject=None,
if subject:
# remove any existing header otherwise we get two
del mo['Subject']
mo['Subject'] = Header(subject, charset)
# Perhaps we should ignore errors here and pass 8bit strings
# on encoding errors
mo['Subject'] = Header(subject, charset, errors='replace')
elif not mo.get('Subject'):
mo['Subject'] = '[No Subject]'
...
...
@@ -491,9 +493,9 @@ def _encode_address_string(text, charset):
try:
name.decode('us-ascii')
except UnicodeDecodeError:
# Encoded strings need an extra space
# XXX: should we be this tolerant of encoding errors here?
charset = Charset(charset
)
name = charset.header_encode(name)
header.append(formataddr((name, addr)))
if charset:
charset = Charset(charset)
name = charset.header_encode(name
)
# We again replace rather than raise an error or pass an 8bit string
header.append(formataddr((name, addr))
, errors='replace'
)
return header
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment