aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Net/IMAP/InterIMAP.pm
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2016-03-12 00:50:26 +0100
committerGuilhem Moulin <guilhem@fripost.org>2016-03-12 00:50:30 +0100
commit1b69b4b599d7acf03e426cfbb376e26bdba95c26 (patch)
tree8ee4c43a39146de81c8d47784993a28bd67162d8 /lib/Net/IMAP/InterIMAP.pm
parent5570af137725259a66043bcb747ecbdb3839a2d3 (diff)
Net::IMAP::InterIMAP optimisation: ignore a new message that's immediately expunged
(before we had a chance to sync it)
Diffstat (limited to 'lib/Net/IMAP/InterIMAP.pm')
-rw-r--r--lib/Net/IMAP/InterIMAP.pm2
1 files changed, 2 insertions, 0 deletions
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/) {