jb55 / mbox-stream

Streaming mbox parser
4 stars 0 forks source link

Chunks regex #1

Closed johnkors closed 9 years ago

johnkors commented 9 years ago

Hi!

Been using your lib to parse a gmail export, and got into an issue regarding the regex splitting into chunks. The issue is if the text "From" is inside the mail contents / or quotes. This generates a rather ugly error out of the MailParser as it thinks there is a new mail halfway into a mail.

I'm currently using the regex /\nFrom\s/ instead, but then the first mail of the mbox is ignored (duh..). I haven't tested it, but it could be an option to do (^From|\nFrom)\s instead. Might be a performance hit, though..

Thanks for making the lib!

jb55 commented 9 years ago

Ah good catch, fixing

jb55 commented 9 years ago

published v2.0.0, let me know if that fixes your parsing issues

jb55 commented 9 years ago

make that 2.0.1

jb55 commented 9 years ago

make that 2.0.2 lol I'm retarded