diff options
author | 2023-11-23 17:56:33 +0100 | |
---|---|---|
committer | 2023-11-23 17:56:33 +0100 | |
commit | 9bf8c269a136484624e9f3a4275c7fb80221b04a (patch) | |
tree | 24a3dfab99252e270c4400503bf5b668ae941494 | |
parent | bbbdde82429af1899b66a11ab7f96c3143da7262 (diff) | |
download | alps-9bf8c269a136484624e9f3a4275c7fb80221b04a.tar.gz alps-9bf8c269a136484624e9f3a4275c7fb80221b04a.tar.bz2 alps-9bf8c269a136484624e9f3a4275c7fb80221b04a.zip |
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).
-rw-r--r-- | plugins/base/imap.go | 5 |
1 files changed, 5 insertions, 0 deletions
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) |