From a468ce635c88b86416eeee8d3b16f18f4589cac8 Mon Sep 17 00:00:00 2001 From: Michal Horejsek Date: Wed, 9 Dec 2020 14:14:59 +0100 Subject: [PATCH] Pause event loop only for non-UID FETCHes --- internal/imap/mailbox_messages.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/imap/mailbox_messages.go b/internal/imap/mailbox_messages.go index c52fdf18..cc321d78 100644 --- a/internal/imap/mailbox_messages.go +++ b/internal/imap/mailbox_messages.go @@ -451,11 +451,13 @@ func (im *imapMailbox) ListMessages(isUID bool, seqSet *imap.SeqSet, items []ima im.panicHandler.HandlePanic() }() - // EXPUNGE cannot be sent during listing and can come only from - // the event loop, so we prevent any server side update to avoid - // the problem. - im.user.pauseEventLoop() - defer im.user.unpauseEventLoop() + if !isUID { + // EXPUNGE cannot be sent during listing and can come only from + // the event loop, so we prevent any server side update to avoid + // the problem. + im.user.pauseEventLoop() + defer im.user.unpauseEventLoop() + } var markAsReadIDs []string markAsReadMutex := &sync.Mutex{}