package PublicInbox::IMAPD;
use strict;
use PublicInbox::Config;
+use PublicInbox::ConfigIter;
use PublicInbox::InboxIdle;
use PublicInbox::IMAP;
use PublicInbox::DummyInbox;
}
$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;
- PublicInbox::IMAP::ensure_slices_exist($imapd, $ibx, $mm->max // 0);
+ eval { $ibx->uidvalidity };
+ my $mm = delete($ibx->{mm}) or return;
+ defined($ibx->{uidvalidity}) or return;
+ PublicInbox::IMAP::ensure_slices_exist($imapd, $ibx, $mm->max);
# preload to avoid fragmentation:
$ibx->description;
my $pi_config = PublicInbox::Config->new;
if ($sig) { # SIGHUP is handled through the event loop
$self->{imapd_next} = { dummies => {}, mailboxes => {} };
- $pi_config->iterate_start(\&imapd_refresh_step, $self);
- PublicInbox::DS::requeue($pi_config); # call event_step
+ my $iter = PublicInbox::ConfigIter->new($pi_config,
+ \&imapd_refresh_step, $self);
+ $iter->event_step;
} else { # initial start is synchronous
$self->{dummies} = {};
$pi_config->each_inbox(\&imapd_refresh_ibx, $self);