diff options
Diffstat (limited to 'alot/db')
-rw-r--r-- | alot/db/utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/alot/db/utils.py b/alot/db/utils.py index bea7b0c6..5250577c 100644 --- a/alot/db/utils.py +++ b/alot/db/utils.py @@ -357,7 +357,10 @@ def decode_header(header, normalize=False): # some mailers send out incorrectly escaped headers # and double quote the escaped realname part again. remove those - value = re.sub(r'\"(.*?=\?.*?.*?)\"', r'\1', value) + # RFC: 2047 + regex = r'"(=\?.+?\?.+?\?[^ ?]+\?=)"' + value = re.sub(regex, r'\1', value) + logging.debug("unquoted header: |%s|", value) # otherwise we interpret RFC2822 encoding escape sequences valuelist = email.header.decode_header(value) |