Due to an off-by-one error, we were unable to read mailboxes
with only a single message of UID:1. Without this fix, the
message with UID:1 could only be read after UID:2 was created;
so there's no permanent data loss as long as a new message
showed up.
This affects all releases of public-inbox-watch with IMAP
support, though it probably went unnoticed because single
message inboxes are rare.
PublicInbox::IMAPTracker->new($url) : 0;
my ($l_uidval, $l_uid) = $itrk ? $itrk->get_last : ();
$l_uidval //= $r_uidval; # first time
PublicInbox::IMAPTracker->new($url) : 0;
my ($l_uidval, $l_uid) = $itrk ? $itrk->get_last : ();
$l_uidval //= $r_uidval; # first time
if ($l_uidval != $r_uidval) {
return "E: $url UIDVALIDITY mismatch\n".
"E: local=$l_uidval != remote=$r_uidval";
}
my $r_uid = $r_uidnext - 1;
if ($l_uidval != $r_uidval) {
return "E: $url UIDVALIDITY mismatch\n".
"E: local=$l_uidval != remote=$r_uidval";
}
my $r_uid = $r_uidnext - 1;
- if ($l_uid != 1 && $l_uid > $r_uid) {
return "E: $url local UID exceeds remote ($l_uid > $r_uid)\n".
"E: $url strangely, UIDVALIDLITY matches ($l_uidval)\n";
}
return if $l_uid >= $r_uid; # nothing to do
return "E: $url local UID exceeds remote ($l_uid > $r_uid)\n".
"E: $url strangely, UIDVALIDLITY matches ($l_uidval)\n";
}
return if $l_uid >= $r_uid; # nothing to do
warn "# $url fetching UID $l_uid:$r_uid\n" unless $self->{quiet};
$mic->Uid(1); # the default, we hope
warn "# $url fetching UID $l_uid:$r_uid\n" unless $self->{quiet};
$mic->Uid(1); # the default, we hope