From 9bf8c269a136484624e9f3a4275c7fb80221b04a Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 23 Nov 2023 17:56:33 +0100 Subject: plugins/base: send NOOP in listMessages() Without this, from the server PoV, we're not aware of any new message (so we can't FETCH them). --- plugins/base/imap.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'plugins/base') diff --git a/plugins/base/imap.go b/plugins/base/imap.go index 48b49df..e9636e3 100644 --- a/plugins/base/imap.go +++ b/plugins/base/imap.go @@ -427,9 +427,14 @@ func (msg *IMAPMessage) HasFlag(flag imap.Flag) bool { } func listMessages(conn *imapclient.Client, mboxName string, page, messagesPerPage int) (msgs []IMAPMessage, total int, err error) { + // A NOOP will ensure we notice any new message + noop := conn.Noop() if err := ensureMailboxSelected(conn, mboxName); err != nil { return nil, 0, err } + if err := noop.Wait(); err != nil { + return nil, 0, err + } mbox := conn.Mailbox() total = int(mbox.NumMessages) -- cgit v1.2.3-59-g8ed1b