6.1. Content
The server can send EXISTS, EXPUNGE, FETCH, and other responses at any time. Every response relative to a mailbox MUST be preceded by the mailbox name. The server MAY send multiple responses in a single push notification.¶
As stated in RFC8291, the cleartext content of push notifications MUST NOT be longer than 3993 bytes. If the server wants to inform the client about a response longer than that, it MAY send a SYNC message.¶
If the server sends a FETCH response, it MUST include a UID FETCH item. Every EXISTS response MUST be followed by a FETCH response. The FETCH response SHOULD contain the UID, the ENVELOPE, and the BINARY if it fits in the message length limits, or SHOULD contain the UID and the ENVELOPE, if it fits in the limits.¶
So, when a new mail comes in, the server sends:¶
Example of a push notification containing multiple responses for the "INBOX" mailbox::¶
INBOX 2 FETCH (UID 2 FLAGS (\Deleted \Seen)) INBOX 2 EXPUNGE¶
Example of a push notification when a new mail arrives in the "New messages" mailbox:¶
"New Messages" 2 EXISTS "New Messages" 2 FETCH (UID 3 ENVELOPE \ ("Mon, 7 Feb 1994 21:52:25 -0800 (PST)" \ "afternoon meeting" \ (("Fred Foobar" NIL "foobar" "Blurdybloop.example")) \ (("Fred Foobar" NIL "foobar" "Blurdybloop.example")) \ (("Fred Foobar" NIL "foobar" "Blurdybloop.example")) \ ((NIL NIL "mooch" "owatagu.siam.edu.example")) \ NIL NIL NIL "<B27397-0100000@Blurdybloop.example>"))¶
Example of a push notification to inform about a response longer than 3993 bytes:¶
SYNC FLAGS¶