sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 6116b9af9245fa503eb577d294c4a3d9eb5661ec
parent eae1442fa02be6f7bab0fdb29091189f1bf10078
Author: wmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Date:   Wed, 13 Jun 2007 17:57:46 +0000

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

Diffstat:
M lib/sup/mbox.rb | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git 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