mirror of
https://github.com/mjl-/mox.git
synced 2025-07-19 04:46:38 +03:00
imapserver: implement NOTIFY extension from RFC 5465
NOTIFY is like IDLE, but where IDLE watches just the selected mailbox, NOTIFY can watch all mailboxes. With NOTIFY, a client can also ask a server to immediately return configurable fetch attributes for new messages, e.g. a message preview, certain header fields, or simply the entire message. Mild testing with evolution and fairemail.
This commit is contained in:
@ -959,7 +959,7 @@ func serveEvents(ctx context.Context, log mlog.Log, accountPath string, w http.R
|
||||
case store.ChangeMailboxKeywords:
|
||||
taggedChanges = append(taggedChanges, [2]any{"ChangeMailboxKeywords", ChangeMailboxKeywords{c}})
|
||||
|
||||
case store.ChangeAddSubscription:
|
||||
case store.ChangeAddSubscription, store.ChangeRemoveSubscription:
|
||||
// Webmail does not care about subscriptions.
|
||||
|
||||
case store.ChangeAnnotation:
|
||||
@ -1111,7 +1111,12 @@ func serveEvents(ctx context.Context, log mlog.Log, accountPath string, w http.R
|
||||
}
|
||||
|
||||
case <-pending:
|
||||
xprocessChanges(comm.Get())
|
||||
overflow, changes := comm.Get()
|
||||
if overflow {
|
||||
writer.xsendEvent(ctx, log, "fatalErr", "out of sync, too many pending changes")
|
||||
return
|
||||
}
|
||||
xprocessChanges(changes)
|
||||
|
||||
case <-ctx.Done():
|
||||
// Work around go vet, it doesn't see defer cancelDrain.
|
||||
|
Reference in New Issue
Block a user