Does anyone know a good email parser library? Searching Google did not help much.
I have emails dropped locally in maildir format (one mail per file). I need to parse the file extracting body and from parts and save it in a database.
If there is no such thing I could try and write something myself learning on the way. Any advice on how to start would be appreciated. Do I need to learn parsec or is it easy to do without?
You could do it using, say, regular expressions. However, learning to write a parser using parsec (or attoparsec) is worth the effort, and this seems like a nice, straightforward example to start with. The next time you need to parse something, you will be glad you did. Parsers you write for parsec will work with attoparsec, and vice versa, as I recall, so it doesn't much matter which you choose. It may be a bit easier to start with parsec, because it automatically reports the location of an error.
I learned Parsec from the documentation. Don't be initimidated by the length of the documentation; you probably won't need to read past page 12 for this task.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With