I was wondering why Outlook emails didn't have any flags. Turns out data[1] seems to contain the end of data[0][0]. For the 3 other servers I have tested, data[1] is just a single closing parenthesis but in the case of Outlook it contains the flags.
Here's the an example of the output of
print(data[0][0])
print(data[1])
for Gmail:
b'1 (UID 9854 FLAGS (\\Seen) BODY[] {25498}'
b')'
and here it is for Outlook:
b'1 (BODY[] {5984}'
b' FLAGS (\\Seen) UID 354)'
so the fix is to simply concatenate them.
I hope this doesn't break things for other servers, if it does we can just add a check for the length of data.
Also fixed a version check that's not necessary since Imbox is for 3.3+.
I was wondering why Outlook emails didn't have any flags. Turns out
data[1]
seems to contain the end ofdata[0][0]
. For the 3 other servers I have tested,data[1]
is just a single closing parenthesis but in the case of Outlook it contains the flags. Here's the an example of the output offor Gmail:
and here it is for Outlook:
so the fix is to simply concatenate them. I hope this doesn't break things for other servers, if it does we can just add a check for the length of
data
.Also fixed a version check that's not necessary since Imbox is for 3.3+.