Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Libraries to parse email into json, like what mailgun is doing

I'm looking for library that can parse email content into a json (or any structured data format). I know there are a number of services like mailgun providing this but I prefer to use my own email server and pass the email directly into my python script rather than having to expose another HTTP endpoint to receive json from service like mailgun. I have a number of side projects that accepting input through email and right now the processing is done in each project using the email module in standard lib. I plan to consolidate all the email processing into a single libraries so that each project only need to deal with json, instead of email format.

like image 850
k4ml Avatar asked Feb 16 '23 14:02

k4ml


1 Answers

We just open sourced our small python script to parse incoming mail to JSON and do a POST callback to a remote URL.

More details here: https://github.com/Newsman/MailToJson

like image 91
Catalin Avatar answered Feb 23 '23 13:02

Catalin