Skip to content

Commit

Permalink
Fixed translation from and to utf-7.
Browse files Browse the repository at this point in the history
see #85
  • Loading branch information
tonioo committed Jul 24, 2017
1 parent 908b348 commit b7d811e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions modoboa_webmail/lib/imaputils.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,15 +469,17 @@ def _listmboxes(self, topmailbox, mailboxes, until_mailbox=None):
continue
if type(mb) in [list, tuple]:
flags, delimiter, namelen = (
self.list_response_pattern_literal.match(mb[0]).groups()
self.list_response_pattern_literal.match(
mb[0].decode()).groups()
)
name = mb[1][0:int(namelen)]
else:
flags, delimiter, name, childinfo = (
self.listextended_response_pattern.match(
mb.decode()).groups())
flags = flags.split(' ')
# name = name.decode("imap4-utf-7")
flags = flags.split(" ")
name = bytearray(name, "utf-8")
name = name.decode("imap4-utf-7")
mdm_found = False
for idx, mdm in enumerate(mailboxes):
if mdm["name"] == name:
Expand Down

0 comments on commit b7d811e

Please sign in to comment.