+ # try to find the URL with Msgmap to avoid forking
+ my $num = $mm->num_for($ctx->{mid});
+ if (defined $num) {
+ push @{$ctx->{found}}, $other;
+ } else {
+ # no point in trying the fork fallback if we
+ # know Xapian is up-to-date but missing the
+ # message in the current repo
+ push @{$ctx->{again}}, $other;
+ }
+}
+
+sub ext_msg_step {
+ my ($pi_cfg, $section, $ctx) = @_;
+ if (defined($section)) {
+ return if $section !~ m!\Apublicinbox\.([^/]+)\z!;
+ my $ibx = $pi_cfg->lookup_name($1) or return;
+ ext_msg_i($ibx, $ctx);
+ } else { # undef == "EOF"
+ finalize_exact($ctx);
+ }
+}
+
+sub ext_msg_ALL ($) {
+ my ($ctx) = @_;
+ my $ALL = $ctx->{www}->{pi_cfg}->ALL or return;
+ my $by_eidx_key = $ctx->{www}->{pi_cfg}->{-by_eidx_key};
+ my $cur_key = eval { $ctx->{ibx}->eidx_key } //
+ return partial_response($ctx); # $cur->{ibx} == $ALL
+ my %seen = ($cur_key => 1);
+ my ($id, $prev);
+ while (my $x = $ALL->over->next_by_mid($ctx->{mid}, \$id, \$prev)) {
+ my $xr3 = $ALL->over->get_xref3($x->{num});
+ for my $k (@$xr3) {
+ $k =~ s/:[0-9]+:$x->{blob}\z// or next;
+ next if $k eq $cur_key;
+ my $ibx = $by_eidx_key->{$k} // next;
+ $ibx->base_url or next;
+ push(@{$ctx->{found}}, $ibx) unless $seen{$k}++;