Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread

 

By: Matt Armstrong
RE: parsing raw messages with CRLF [ reply ]  
2008-01-11 05:08
Thanks Maarten, yep the /r/n -vs- /n thing is a known issue people run into -- you are not the first. You found the right workaround. I have local patches to fix, but they are part of a major rewrite of the guts of the library, so they will need time to cook a little while longer.

And you're right, there is now sadly a rubymail.com that deals with email marketing. I think the above mentioned rewrite will be released under the RMail name. Then again, TMail looks like it is healthy and well maintained and I have little reason to "compete"...

By: Maarten O.
parsing raw messages with CRLF [ reply ]  
2008-01-03 10:00
Hi Matt,

I like the RubyMail library for it's completeness and simplicity. However I just found out that the parser does not handle emails well which are retrieved via Net::POP3.

Raw emails have lines ending in <CR><LF>, and Net::POP3 also returns lines ending with "\r\n". However the parser apparently expects lines ending in "\n", causing the body of a single part message not being separated from the header.

I managed to work around this by using:

raw = mail.pop
message = RMail::Parser.read(raw.delete("\r"))

Maarten

P.S. Did you notice that a NY company is (ab)using the name RubyMail for it's email marketing service? See www[dot]rubymail[dot]com.