Post #3197861
2026-02-21 18:46 UTC
@Migueldeicaza@mastodon.social e.g., you might have something like this:
C: A1 FETCH 1:100 (BODY[])
C: A2 STORE 5 +FLAGS (\Seen)
S: * 42 EXISTS
S: * 5 FETCH (FLAGS (\Seen \Recent))
S: A2 OK STORE completed
S: A1 OK FETCH completed
The `* 42 EXISTS` is the server telling you a new message arrived.
The `* 5 FETCH` is from `A2`, which completes before `A1`.
Ideally, you'll also handle pipelining: some commands are safe to send concurrently and some are not. It's best to only use UIDs—never sequence numbers.
Replies (3)
-
@Migueldeicaza@mastodon.social 2026-02-21 22:06
@mdiep@mas.to Ok, fixed the parts that were easy. The pipelining is not something that MailKit supports, still thinking about it.
-
@Migueldeicaza@mastodon.social 2026-02-21 22:22
@mdiep@mas.to From the spec, it is not clear that the library should do a lot towards enforcing certain commands from being pipelined or not, seems like some are context sensitive, and the client needs to be aware of those. So for now, I am going to let people pipeline (with a few exceptions), and they need to ensure they are not violating the requirements on their own.
-
@Migueldeicaza@mastodon.social 2026-02-28 02:42
@mdiep@mas.to Forgot to follow up: I got pipelining working now. Look forward to your Swift-powered mail client using MailFoundation!