+# XXX consider sharing with V2Writable, this only requires read-only access
+sub content_exists ($$) {
+ my ($ibx, $eml) = @_;
+ my $over = $ibx->over or return;
+ my $mids = mids($eml);
+ my $chash = content_hash($eml);
+ my ($id, $prev);
+ for my $mid (@$mids) {
+ while (my $smsg = $over->next_by_mid($mid, \$id, \$prev)) {
+ my $cmp = $ibx->smsg_eml($smsg) or return;
+ return 1 if $chash eq content_hash($cmp);
+ }
+ }
+ undef;
+}
+