sub imapd_refresh_ibx { # pi_config->each_inbox cb
my ($ibx, $imapd) = @_;
my $ngname = $ibx->{newsgroup} or return;
- if (ref $ngname) {
- warn 'multiple newsgroups not supported: '.
- join(', ', @$ngname). "\n";
- return;
- } elsif ($ngname =~ m![^a-z0-9/_\.\-\~\@\+\=:]! ||
- $ngname =~ /\.[0-9]+\z/) {
+
+ # We require lower-case since IMAP mailbox names are
+ # case-insensitive (but -nntpd matches INN in being
+ # case-sensitive
+ if ($ngname =~ m![^a-z0-9/_\.\-\~\@\+\=:]! ||
+ # don't confuse with 50K slices
+ $ngname =~ /\.[0-9]+\z/) {
warn "mailbox name invalid: newsgroup=`$ngname'\n";
return;
}
$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;