From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 1E689633811; Thu, 27 Aug 2015 04:34:06 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Cc: Eric Wong Subject: [PATCH 3/5] mid: extract Message-ID from inside '<>' Date: Thu, 27 Aug 2015 04:34:00 +0000 Message-Id: <1440650042-26176-4-git-send-email-e@80x24.org> In-Reply-To: <1440650042-26176-1-git-send-email-e@80x24.org> References: <1440650042-26176-1-git-send-email-e@80x24.org> List-Id: 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. --- lib/PublicInbox/MID.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/MID.pm b/lib/PublicInbox/MID.pm index 02ac709..8ca3c57 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*?\s*\z//; + if ($mid =~ /<([^>]+)>/) { + $mid = $1; + } $mid; } -- EW