From: Guilhem Moulin Date: Fri, 11 Mar 2016 23:50:26 +0000 (+0100) Subject: Net::IMAP::InterIMAP optimisation: ignore a new message that's immediately expunged X-Git-Url: https://git.g-eek.se/?a=commitdiff_plain;h=1b69b4b599d7acf03e426cfbb376e26bdba95c26;p=interimap.git Net::IMAP::InterIMAP optimisation: ignore a new message that's immediately expunged (before we had a chance to sync it) --- 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/) {