From 1b69b4b599d7acf03e426cfbb376e26bdba95c26 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sat, 12 Mar 2016 00:50:26 +0100 Subject: [PATCH] Net::IMAP::InterIMAP optimisation: ignore a new message that's immediately expunged (before we had a chance to sync it) --- lib/Net/IMAP/InterIMAP.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Net/IMAP/InterIMAP.pm b/lib/Net/IMAP/InterIMAP.pm index cdc5697..1686448 100644 --- a/lib/Net/IMAP/InterIMAP.pm +++ b/lib/Net/IMAP/InterIMAP.pm @@ -2250,6 +2250,8 @@ sub _resp($$;&$$) { $self->panic("$1 <= $cache->{EXISTS}") if $1 <= $cache->{EXISTS}; # sanity check $self->fail("RFC 7162 violation! Got an EXPUNGE response with QRESYNC enabled."); } + # the new message was expunged before it was synced + $self->{_NEW} = 0 if $self->{_NEW} == 1 and $cache->{EXISTS} == $1; $cache->{EXISTS}--; # explicit EXISTS responses are optional } elsif (/\ASEARCH((?: [0-9]+)*)\z/) { -- 2.39.2