mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
Fixing encoding issue.
This commit is contained in:
@@ -225,6 +225,9 @@ class ImapEmail(Email):
|
||||
value = getattr(IMAPheader, "parse_%s" % key)(msg[name], full=addrfull)
|
||||
except AttributeError:
|
||||
value = msg[name]
|
||||
result = chardet.detect(value)
|
||||
if result['encoding'] != 'ascii':
|
||||
value = value.decode(result['encoding'])
|
||||
if hdr[1]:
|
||||
self.headers += [{"name" : label, "value" : value}]
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user