ShugyoushaandGitHub f4383550ac imapclient/search: handle UID SEARCH results without hits
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.
2024-03-20 00:32:49 +01:00
2024-02-07 16:48:04 +01:00
2024-02-21 15:26:28 +01:00
2023-12-18 16:21:00 +01:00
2024-01-10 18:21:22 +01:00
2023-04-13 10:23:56 +02:00
2024-01-26 12:17:35 +01:00
2024-01-10 12:34:10 +01:00
2024-01-10 12:34:10 +01:00
2023-12-18 16:21:00 +01:00
2023-03-11 15:52:25 +01:00
2024-01-10 18:21:22 +01:00
2023-03-22 11:04:18 +01:00
2023-04-04 15:42:08 +02:00
2024-01-10 18:21:22 +01:00
2023-12-18 16:21:00 +01:00
2023-12-18 16:21:00 +01:00
2023-07-05 09:50:47 +02:00
2023-03-24 11:45:02 +01:00

go-imap

builds.sr.ht status Go Reference

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

S
Description
📥 An IMAP library for Go clients and servers
Readme MIT
3.7 MiB
Languages
Go 100%