- my ($self, $cb) = @_;
- if (my $section_order = $self->{-section_order}) {
- foreach my $section (@$section_order) {
- next if $section !~ m!\Apublicinbox\.([^/]+)\z!;
- $self->{"publicinbox.$1.mainrepo"} or next;
- my $ibx = lookup_name($self, $1) or next;
- $cb->($ibx);
- }
- } else {
- my %seen;
- foreach my $k (keys %$self) {
- $k =~ m!\Apublicinbox\.([^/]+)\.mainrepo\z! or next;
- next if $seen{$1};
- $seen{$1} = 1;
- my $ibx = lookup_name($self, $1) or next;
- $cb->($ibx);
- }
+ my ($self, $cb, $arg) = @_;
+ # may auto-vivify if config file is non-existent:
+ foreach my $section (@{$self->{-section_order}}) {
+ next if $section !~ m!\Apublicinbox\.([^/]+)\z!;
+ my $ibx = lookup_name($self, $1) or next;
+ $cb->($ibx, $arg);