Add readme/license
emlparse: parse and extract bits from .eml files
Sometimes I get forwarded emails as attachments. These .eml files are generally rather annoying to deal with - usually I just want to get the text of the email!
emlparse solves this problem. For example:
$ ./emlparse email.eml
multipart/related
0 multipart/alternative
0.0 text/plain
0.1 text/html
1 image/png (image001.png)
2 image/png (image002.png)
3 image/png (image003.png)
This is the structure of the email message. To get the text/plain
part:
$ ./emlparse -x 0.0 email.eml
Maybe we would like to view the HTML part:
$ ./emlparse -x 0.1 email.eml | w3m -T text/html
Or maybe check what the attached images are:
$ ./emlparse email.eml -x 2 | feh -
The code is just a very simple wrapper around the python3 email
module.