Fix utf7 decode error not caught

Signed-off-by: Stéphane Albert <sheeprine@oh.its.fake.nullplace.com>
Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
Stéphane Albert 2016-10-31 15:47:00 +01:00 committed by Nicolas Sebrecht
parent 2d885fda4c
commit 75f16106da

View File

@ -368,5 +368,5 @@ def decode_mailbox_name(name):
try: try:
return ret.decode('utf-7').encode('utf-8') return ret.decode('utf-7').encode('utf-8')
except UnicodeEncodeError: except (UnicodeDecodeError, UnicodeEncodeError):
return name return name