about summary refs log tree commit homepage
path: root/lib/PublicInbox/MID.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-08-27 04:34:00 +0000
committerEric Wong <e@80x24.org>2015-08-27 06:04:51 +0000
commite3c3cde22f57bf16bc47c50d8f9ac02416975cd3 (patch)
tree4daecdca7bdac3774ebe1c9c1eeba4879d67d09d /lib/PublicInbox/MID.pm
parent6fb2cbb34be7376a24bd00e0f8fd20114c18318c (diff)
downloadpublic-inbox-e3c3cde22f57bf16bc47c50d8f9ac02416975cd3.tar.gz
mid: extract Message-ID from inside '<>'
This is necessary for some mailers which include comment text
in in the In-Reply-To header, merely assuming there is nothing
outside of '<>' as we were doing is not enough.
Diffstat (limited to 'lib/PublicInbox/MID.pm')
-rw-r--r--lib/PublicInbox/MID.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/PublicInbox/MID.pm b/lib/PublicInbox/MID.pm
index 02ac7095..8ca3c579 100644
--- a/lib/PublicInbox/MID.pm
+++ b/lib/PublicInbox/MID.pm
@@ -12,8 +12,9 @@ sub mid_clean {
         my ($mid) = @_;
         defined($mid) or die "no Message-ID";
         # MDA->precheck did more checking for us
-        $mid =~ s/\A\s*<?//;
-        $mid =~ s/>?\s*\z//;
+        if ($mid =~ /<([^>]+)>/) {
+                $mid = $1;
+        }
         $mid;
 }