diff options
author | Eric Wong <e@80x24.org> | 2015-08-27 04:34:00 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-08-27 06:04:51 +0000 |
commit | e3c3cde22f57bf16bc47c50d8f9ac02416975cd3 (patch) | |
tree | 4daecdca7bdac3774ebe1c9c1eeba4879d67d09d /lib/PublicInbox/MID.pm | |
parent | 6fb2cbb34be7376a24bd00e0f8fd20114c18318c (diff) | |
download | public-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.pm | 5 |
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; } |