]> git.cworth.org Git - sup/blobdiff - lib/sup/mbox.rb
handle carriage returns in mbox files
[sup] / lib / sup / mbox.rb
index 0ce52fe24fd9ff8bbba19bea2141dfd8e4d4625d..2494897f1166f1411ea6bae1323c85968a13f177 100644 (file)
@@ -41,8 +41,8 @@ module MBox
         /^(X-Original-To):\s+(.*)$/i,
         /^(Envelope-To):\s+(.*)$/i: header[last = $1] ||= $2
 
-      when /^$/: break
-      when /^\S+: /: last = nil # some other header we don't care about
+      when /^\r*$/: break
+      when /^\S+:/: last = nil # some other header we don't care about
       else
         header[last] += " " + line.chomp.gsub(/^\s+/, "") if last
       end
@@ -65,6 +65,7 @@ module MBox
     header
   end
   
+  ## never actually called
   def read_body f
     body = []
     f.each_line do |l|