djc / tokio-imap

Tokio-based IMAP implementation
Apache License 2.0
123 stars 42 forks source link

Allow trailing whitespace in search responses. #108

Closed rbartlensky closed 3 years ago

rbartlensky commented 3 years ago

Hello! I have a small PR here to fix an issue I found in the wild. Let me know if I need to change anything about it!

This relates to #34.

While working on a project, I tried to connect to Yahoo's IMAP server, and all SEARCH responses seemed to have a trailing whitespace. For example in the case below, there is a whitespace (even though it might not seem obvious) right after the last id:

C: a5 UID SEARCH ALL
S: * SEARCH 169654 169655 169656 169657 169658 169659 169660 169661
169662 169663 

I also happened to encounter this on empty SEARCH responses, which led me to the issue linked above.

djc commented 3 years ago

Thanks! I've added a comment about the spec deviation and published version 0.12.1 to crates.io.

rbartlensky commented 3 years ago

@djc Thank you for the quick review!