diff options
author | Patrick Totzke <patricktotzke@gmail.com> | 2019-05-27 10:31:53 +0100 |
---|---|---|
committer | Patrick Totzke <patricktotzke@gmail.com> | 2019-05-27 10:31:53 +0100 |
commit | 7f800370151466fb07db1eba4b3b343cbd03561c (patch) | |
tree | d82636119118fb68a7443705451b49349ec347d6 | |
parent | 00e6ca8a87dcb23c423e088bec2057dcf5158f49 (diff) | |
parent | 72306c65a9ab423c089c2a77569b6f549a1ab58c (diff) |
Merge branch '0.8.1-reply-fixes'
-rw-r--r-- | alot/db/utils.py | 12 | ||||
-rw-r--r-- | tests/db/test_utils.py | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/alot/db/utils.py b/alot/db/utils.py index 94886148..75fc0178 100644 --- a/alot/db/utils.py +++ b/alot/db/utils.py @@ -526,15 +526,9 @@ def decode_header(header, normalize=False): :type normalize: bool :rtype: str """ - # some mailers send out incorrectly escaped headers - # and double quote the escaped realname part again. remove those - # RFC: 2047 - regex = r'"(=\?.+?\?.+?\?[^ ?]+\?=)"' - value = re.sub(regex, r'\1', header) - logging.debug("unquoted header: |%s|", value) - - # otherwise we interpret RFC2822 encoding escape sequences - valuelist = email.header.decode_header(value) + logging.debug("unquoted header: |%s|", header) + + valuelist = email.header.decode_header(header) decoded_list = [] for v, enc in valuelist: v = string_decode(v, enc) diff --git a/tests/db/test_utils.py b/tests/db/test_utils.py index f6249542..1e230aef 100644 --- a/tests/db/test_utils.py +++ b/tests/db/test_utils.py @@ -272,6 +272,12 @@ class TestDecodeHeader(unittest.TestCase): expected = u'first\nsecond third fourth fifth' actual = utils.decode_header(text, normalize=True) self.assertEqual(actual, expected) + + def test_exchange_quotes_remain(self): + # issue #1347 + expected = u'"Mouse, Michaƫl" <x@y.z>' + text = self._quote(expected, 'utf-8') + self._test(text, expected) class TestAddSignatureHeaders(unittest.TestCase): |