Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ignored headers + unnecessary major version check #206

Merged
merged 2 commits into from
Aug 10, 2021

Conversation

AT0myks
Copy link
Contributor

@AT0myks AT0myks commented Aug 10, 2021

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+.

The project this was copied from supports Python 2 but Imbox is 3.3+.
`data[1]` seems to only contain a closing parenthesis for some servers but for others it contains the flags, like for Outlook.
@martinrusev martinrusev merged commit 550a63f into martinrusev:master Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants