about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-29 09:57:55 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-29 10:00:07 +0000
commita11bcd26245427e16f7e62d99b9707522e2d64e2 (patch)
tree5b62ad19fd791163ff6d2475d98901672c6f192e /lib
parentd2f3227c622174b96db8c2dc69dbc1fa3df50fcd (diff)
downloadpublic-inbox-a11bcd26245427e16f7e62d99b9707522e2d64e2.tar.gz
We can avoid a small amount of overhead and use the "preferred"
Message-ID based on what is in the SearchMsg object.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/Mbox.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/PublicInbox/Mbox.pm b/lib/PublicInbox/Mbox.pm
index 381bcada..1b68f027 100644
--- a/lib/PublicInbox/Mbox.pm
+++ b/lib/PublicInbox/Mbox.pm
@@ -92,7 +92,7 @@ sub emit_raw {
 }
 
 sub msg_str {
-        my ($ctx, $simple) = @_; # Email::Simple object
+        my ($ctx, $simple, $mid) = @_; # Email::Simple object
         my $header_obj = $simple->header_obj;
 
         # drop potentially confusing headers, ssoma already should've dropped
@@ -102,7 +102,7 @@ sub msg_str {
         }
         my $ibx = $ctx->{-inbox};
         my $base = $ibx->base_url($ctx->{env});
-        my $mid = mid_clean($header_obj->header('Message-ID'));
+        $mid = $ctx->{mid} unless defined $mid;
         $mid = mid_escape($mid);
         my @append = (
                 'Archived-At', "<$base$mid/>",
@@ -225,7 +225,8 @@ sub getline {
                 while (defined(my $smsg = shift @{$self->{msgs}})) {
                         my $msg = eval { $ibx->msg_by_smsg($smsg) } or next;
                         $msg = Email::Simple->new($msg);
-                        $gz->write(PublicInbox::Mbox::msg_str($ctx, $msg));
+                        $gz->write(PublicInbox::Mbox::msg_str($ctx, $msg,
+                                                                $smsg->mid));
 
                         # use subject of first message as subject
                         if (my $hdr = delete $self->{hdr}) {