aboutsummaryrefslogtreecommitdiffstats
path: root/Mailman/Handlers/SpamDetect.py
diff options
context:
space:
mode:
authorJim Popovitch <jimpop@gmail.com>2013-11-17 01:56:29 +0000
committerJim Popovitch <jimpop@gmail.com>2013-11-17 01:56:29 +0000
commit06d15b0a9949652f696d19903cef2a235ff3a428 (patch)
tree55a9c12de799cc056da986aafe3b8e66d0cbf94b /Mailman/Handlers/SpamDetect.py
parentbc05ad4e81bd2ce9ec0f36e5112eadf607a49195 (diff)
parentded18dda2b2f9ba00f8780b4eba6c398c5bff838 (diff)
downloadmailman2-06d15b0a9949652f696d19903cef2a235ff3a428.tar.gz
mailman2-06d15b0a9949652f696d19903cef2a235ff3a428.tar.xz
mailman2-06d15b0a9949652f696d19903cef2a235ff3a428.zip
Upstream changes
Diffstat (limited to 'Mailman/Handlers/SpamDetect.py')
-rw-r--r--Mailman/Handlers/SpamDetect.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Mailman/Handlers/SpamDetect.py b/Mailman/Handlers/SpamDetect.py
index 8d26da03..9e01f623 100644
--- a/Mailman/Handlers/SpamDetect.py
+++ b/Mailman/Handlers/SpamDetect.py
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2012 by the Free Software Foundation, Inc.
+# Copyright (C) 1998-2013 by the Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -27,6 +27,7 @@ TBD: This needs to be made more configurable and robust.
import re
+from email.Errors import HeaderParseError
from email.Header import decode_header
from Mailman import mm_cfg
@@ -68,7 +69,10 @@ def getDecodedHeaders(msg, cset='utf-8'):
headers = ''
for h, v in msg.items():
uvalue = u''
- v = decode_header(re.sub('\n\s', ' ', v))
+ try:
+ v = decode_header(re.sub('\n\s', ' ', v))
+ except HeaderParseError:
+ v = [(v, 'us-ascii')]
for frag, cs in v:
if not cs:
cs = 'us-ascii'