crisp-oss / email-forward-parser

🐛 Parses forwarded emails and extracts original content.
https://www.npmjs.com/package/email-forward-parser
MIT License
55 stars 23 forks source link

Would it be possible to get the layered forwarded emails? #4

Closed katlim-br closed 1 year ago

katlim-br commented 2 years ago

This is more a feasibility question.

If I have this email:

E2
  E1
    E0

Currently we get E0 information. This is good.

Would it be feasible to get E2 and E1 separately? Like in

const allFw = new EmailForwardParser().readAll(emailBodyAsText, emailSubject);

allFw[0] == E0
allFw[1] == E1
allFw[2] == E2

(backwards would also be ok)

I know the lib can't today, but the question would it be sound and feasible?

Thanks!

eliottvincent commented 2 years ago

Could you post a real-world example? I'm afraid this is outside of this library's scope.

katlim-br commented 2 years ago

We want to analyze the forward chain to see if a given recipient is in that chain. I know that sometimes we won't get it (since email clients sometimes delete the email addresses), but we still want to try.

E3 (from another@gm to another2@gm) E2 (from myuser@gm to another@gm) E1 (from y@yh to myuser@gm) E0 (from x@yh to y@yh

We want to verify if myuser@gm is there

eliottvincent commented 1 year ago

Closing as this is outside of the scope. The sole purpose of this library is to extract original content from forwarded emails (whether this content is a single email or a chain of emails). You'd then need to parse the original content to read the chain of emails.