From 6116b9af9245fa503eb577d294c4a3d9eb5661ec Mon Sep 17 00:00:00 2001 From: wmorgan Date: Wed, 13 Jun 2007 17:57:46 +0000 Subject: [PATCH] bugfix: capture message-ids that appear on the next line from the header git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@459 5c8cc53c-5e98-4d25-b20a-d8db53a31250 --- lib/sup/mbox.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/sup/mbox.rb b/lib/sup/mbox.rb index d978faf..894d563 100644 --- a/lib/sup/mbox.rb +++ b/lib/sup/mbox.rb @@ -22,12 +22,12 @@ module MBox /^(Bcc):\s+(.*?)\s*$/i, /^(Subject):\s+(.*?)\s*$/i, /^(Date):\s+(.*?)\s*$/i, - /^(Message-Id):\s+<(.*?)>\s*$/i, /^(References):\s+(.*?)\s*$/i, /^(In-Reply-To):\s+(.*?)\s*$/i, /^(Reply-To):\s+(.*?)\s*$/i, /^(List-Post):\s+(.*?)\s*$/i, /^(Status):\s+(.*?)\s*$/i: header[last = $1] = $2 + when /^(Message-Id):\s+(.*?)\s*$/i: header[mid_field = last = $1] = $2 ## these next three can occur multiple times, and we want the ## first one @@ -41,6 +41,11 @@ module MBox header[last] += " " + line.chomp.gsub(/^\s+/, "") if last end end + + if mid_field && header[mid_field] && header[mid_field] =~ /<(.*?)>/ + header[mid_field] = $1 + end + header end -- 2.45.2