- my $type = eval { local $/; <$fh> };
- close $fh;
- if ($? == 0 && $type eq "blob\n") {
- return r302($n->{url}, $mid);
- }
+ # no point in trying the fork fallback if we
+ # know Xapian is up-to-date but missing the
+ # message in the current repo
+ push @ibx, $other;
+ }
+ });
+
+ return exact($ctx, \@found, $mid) if @found;
+
+ # fall back to partial MID matching
+ my @partial;
+ my $n_partial = 0;
+ my $srch = $cur->search;
+ my $mids = search_partial($srch, $mid) if $srch;
+ if ($mids) {
+ $n_partial = scalar(@$mids);
+ push @partial, [ $cur, $mids ];
+ }
+
+ # can't find a partial match in current inbox, try the others:
+ if (!$n_partial && length($mid) >= 16) {
+ foreach my $ibx (@ibx) {
+ $srch = $ibx->search or next;
+ $mids = search_partial($srch, $mid) or next;
+ $n_partial += scalar(@$mids);
+ push @partial, [ $ibx, $mids];
+ last if $n_partial >= PARTIAL_MAX;