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].
This commit is contained in:
parent
ea8c0c6f3e
commit
1ff54e7a7c
@ -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:])
|
||||
|
Loading…
Reference in New Issue
Block a user