Split email text into conversation

I am writing an email parser in Python and am looking for a way to extract all previous emails (forwarded, replies) from the body of the email. The script should support as many email clients as possible (gmail, Outlook, iphone, etc.). For example, if the body:

example email text On Jul 31, 2013, at 5:15 PM, John Doe < jdoe@gmail.com > wrote: > example email text > > > *From:* Me [mailto: me@gmail.com ] > *Sent:* Thursday, May 31, 2012 3:54 PM > *To:* John Doe > *Subject:* RE: subject > > example email text 

The result should be an array with 3 entries, each entry contains email text and as much metadata as possible (date, sender, subject, etc.).

Are there standard / modern ways to achieve this? Is there a supported list of responses from different clients? I searched for similar questions, but still have not satisfied the answer.

+4
source share
1 answer
0
source

Source: https://habr.com/ru/post/1501875/


All Articles