]> git.notmuchmail.org Git - sup/commitdiff
bugfix: capture message-ids that appear on the next line from the header
authorwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Wed, 13 Jun 2007 17:57:46 +0000 (17:57 +0000)
committerwmorgan <wmorgan@5c8cc53c-5e98-4d25-b20a-d8db53a31250>
Wed, 13 Jun 2007 17:57:46 +0000 (17:57 +0000)
git-svn-id: svn://rubyforge.org/var/svn/sup/trunk@459 5c8cc53c-5e98-4d25-b20a-d8db53a31250

lib/sup/mbox.rb

index d978faf8fc12eab195d99e6d96daff4ed2be7fee..894d56303ea959ce707754c5a4bd0492d0f8198b 100644 (file)
@@ -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