ProtonMail / proton-bridge

Proton Mail Bridge application
GNU General Public License v3.0
1.14k stars 155 forks source link

fetch does not return all items requested #360

Closed jknockaert closed 1 year ago

jknockaert commented 1 year ago

When running fetch the data items returned depend on the order of the items in the request. As an example if I request (BODY.PEEK[HEADER] FLAGS) I do not get the flags returned, but when I request (FLAGS BODY.PEEK[HEADER]) I do receive all the data items requested. I am not exactly an expert in RFC3501, but it seems to me that the order of items should not matter.

Expected Behavior

All fetched data items should be returned independently of the order in which they are specified.

Current Behavior

There is some dependency. If BODY.PEEK[HEADER] comes first then the following items are not processed.

Version Information

3.0.20 on macOS 13.2.1

Context (Environment)

Am writing a python script to analyse my mailbox.

LBeernaertProton commented 1 year ago

Hey @jknockaert how are you verifying this behavior? Our internal test show that the order of fetch items is preserved and that both of your queries are working as expected.

LBeernaertProton commented 1 year ago

Please be aware that if you are checking the log outputs with trace level, the IMAP client commands and responses are truncated. If you set the environment variable GLUON_LOG_IMAP_LINE_LIMIT=5000 you should see the full reply.

jknockaert commented 1 year ago

@LBeernaertProton Am using the imaplib module in python3. It may be that it is specific to this implementation expecting BODY.PEAK[] to come last in the results. Perhaps we can then close the issue.