 |
Forums |
Admin Start New Thread
| Message: 37982 |
 |
BY: Maarten O. (maarteno) DATE: 2008-01-03 10:00 SUBJECT: parsing raw messages with CRLF 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. | |
Thread View
Post a followup to this message
|
 |