mirror of
https://github.com/emersion/go-imap
synced 2026-07-05 03:38:30 +00:00
v2.0.0-beta.2
When searching for unseen mails we can get the following error if there are none. > in response-data: imapwire: expected SP, got "\r" The reason is that the IMAP server is sending a response like this in case there are no search hits. T7 UID SEARCH RETURN (ALL) (UNSEEN) * ESEARCH (TAG "T7") UID T7 OK SEARCH completed (Success) The wire protocol parser is expecting a search option (like "ALL") to be present in any search result. As we can see above, this is not the case if there are no results, which results in the parser hitting a CRLF when it expected a space. To account for this we peek into the reply of the server to see whether there is a CRLF after the "UID" atom. If there is, we assume there were no results and return an empty result.
go-imap
An IMAP4rev2 library for Go.
Note
This is the README for go-imap v2. This new major version is still in development. For go-imap v1, see the v1 branch.
Usage
To add go-imap to your project, run:
go get github.com/emersion/go-imap/v2
Documentation and examples for the module are available here:
License
MIT
Languages
Go
100%