From c0174089f48d081bb84ce776d5b6ee0bf19a4fa1 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 16 Oct 2020 06:59:31 +0000 Subject: inbox: add uidvalidity method This will make it easier to deal with ExtSearchIdx, which won't have msgmap. --- lib/PublicInbox/IMAPD.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/IMAPD.pm') diff --git a/lib/PublicInbox/IMAPD.pm b/lib/PublicInbox/IMAPD.pm index 3c211ee1..bb705136 100644 --- a/lib/PublicInbox/IMAPD.pm +++ b/lib/PublicInbox/IMAPD.pm @@ -38,13 +38,13 @@ sub imapd_refresh_ibx { # pi_config->each_inbox cb } $ibx->over or return; $ibx->{over} = undef; - my $mm = $ibx->mm or return; - $ibx->{mm} = undef; # RFC 3501 2.3.1.1 - "A good UIDVALIDITY value to use in # this case is a 32-bit representation of the creation # date/time of the mailbox" - defined($ibx->{uidvalidity} = $mm->created_at) or return; + eval { $ibx->uidvalidity }; + my $mm = delete($ibx->{mm}) or return; + defined($ibx->{uidvalidity}) or return; PublicInbox::IMAP::ensure_slices_exist($imapd, $ibx, $mm->max // 0); # preload to avoid fragmentation: -- cgit v1.2.3-24-ge0c7