From 1ff54e7a7cdbc1efb87a11b26a1f15b4c4de10c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolfo=20Garc=C3=ADa=20Pe=C3=B1as=20=28kix=29?= Date: Tue, 1 Sep 2020 17:37:52 +0200 Subject: [PATCH] IMAP.py Get the server response right Now, the server response is in a list of strings. We need the second string, so we need read the [1]. Previously, was a list of tuples, so, we used [0][1]. --- offlineimap/folder/IMAP.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index b8c9829..78e0621 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -323,10 +323,9 @@ class IMAPFolder(BaseFolder): data = self._fetch_from_imap(str(uid), self.retrycount) # Data looks now e.g. - # [('320 (UID 17061 BODY[] {2565}','msgbody....')] - # We only asked for one message, and that msg is in data[0]. msbody is - # in [0][1]. - data = data[0][1].replace(CRLF, "\n") + # ['320 (17061 BODY[] {2565}','msgbody....'] + # Is a list of two elements. Message is at [1] + data = data[1].replace(CRLF, "\n") if len(data) > 200: dbg_output = "%s...%s" % (str(data)[:150], str(data)[-50:])