+ if (my $listids = $ibx->{listid}) {
+ # RFC2919 section 6 stipulates "case insensitive equality"
+ foreach my $list_id (@$listids) {
+ $self->{-by_list_id}->{lc($list_id)} = $ibx;
+ }
+ }
+ if (defined(my $ngname = $ibx->{newsgroup})) {
+ if (ref($ngname)) {
+ delete $ibx->{newsgroup};
+ warn 'multiple newsgroups not supported: '.
+ join(', ', @$ngname). "\n";
+ # Newsgroup name needs to be compatible with RFC 3977
+ # wildmat-exact and RFC 3501 (IMAP) ATOM-CHAR.
+ # Leave out a few chars likely to cause problems or conflicts:
+ # '|', '<', '>', ';', '#', '$', '&',
+ } elsif ($ngname =~ m![^A-Za-z0-9/_\.\-\~\@\+\=:]! ||
+ $ngname eq '') {
+ delete $ibx->{newsgroup};
+ warn "newsgroup name invalid: `$ngname'\n";
+ } else {
+ # PublicInbox::NNTPD does stricter ->nntp_usable
+ # checks, keep this lean for startup speed
+ $self->{-by_newsgroup}->{$ngname} = $ibx;
+ }
+ }
+ unless (defined $ibx->{newsgroup}) { # for ->eidx_key
+ my $abs = rel2abs_collapsed($dir);
+ if ($abs ne $dir) {
+ warn "W: `$dir' canonicalized to `$abs'\n";
+ $ibx->{inboxdir} = $abs;
+ }