diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2015-07-26 15:53:13 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2015-07-26 15:54:43 +0200 |
commit | 464862335d1bc09437d4238214d30a1db7b829bd (patch) | |
tree | 191bebd200c0a14581ab08bc921a7568da9c634d /lib/Net/IMAP | |
parent | 0ceb23a6c85c1c77dfac5e8eac6bf66657d08d07 (diff) |
bugfix: Fetching new messages from local and adding them to remote modifies its UIDNEXT.
So we need to check again the first $source (remote) whenever the last
one (local) added new messages to it.
Diffstat (limited to 'lib/Net/IMAP')
-rw-r--r-- | lib/Net/IMAP/Sync.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Net/IMAP/Sync.pm b/lib/Net/IMAP/Sync.pm index 26303a6..bf56519 100644 --- a/lib/Net/IMAP/Sync.pm +++ b/lib/Net/IMAP/Sync.pm @@ -657,12 +657,12 @@ sub append($$@) { my @uids; foreach (split /,/, $uidset) { if (/\A([0-9]+)\z/) { - $UIDNEXT = $1 + 1 if $UIDNEXT <= $1; + $UIDNEXT = $1 + 1 if defined $UIDNEXT and $UIDNEXT <= $1; push @uids, $1; } elsif (/\A([0-9]+):([0-9]+)\z/) { my ($min, $max) = $1 <= $2 ? ($1,$2) : ($2,$1); push @uids, ($min .. $max); - $UIDNEXT = $max + 1 if $UIDNEXT <= $max; + $UIDNEXT = $max + 1 if defined $UIDNEXT and $UIDNEXT <= $max; } else { $self->panic($_); } |