TheProjecter / ruby-msg

Automatically exported from code.google.com/p/ruby-msg
MIT License
0 stars 0 forks source link

Error is parsing headers - This is the fix #19

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. msg with header continuation lines that start with ' ' not \t
2. header are truncated. Now fixed
3.

What is the expected output? What do you see instead?

Headers should contain all continuation lines.

What version of the product are you using? On what operating system?

Bug effect 1.51 with Ruby 1.8

Please provide any additional information below.

Fix is in mime.rb

headers.to_s.scan(/^\S+:\s*.*(?:\n[\t| ].*)*/).each do |header|
    @headers[header[/(\S+):/, 1]] << header[/\S+:\s*(.*)/m, 1].gsub(/\s+/m, ' ').strip # this is kind of wrong
end

note the [\t| ] which allows for "\n\t" OR "\n " in the loop control line scan 
function.

Hope this helps.
Also I could possibly do maintenance, however cannot program Ruby, although 
seems not to hard.

Original issue reported on code.google.com by melbcy...@gmail.com on 17 Jul 2014 at 12:30

GoogleCodeExporter commented 9 years ago
Hi,

Thanks for the fix. Haven't really had any time for this project lately, but if 
you want to take on a maintenance role I'm happy to give you access. 
Alternatively the project is mirrored on github 
(https://github.com/aquasync/ruby-msg), so if you send me a pull request there 
I can merge it in.

Thanks

Original comment by aquas...@gmail.com on 29 Jul 2014 at 1:06