EricJWHuang / EmailReplyParser

A .NET clone of github email_reply_parser
24 stars 13 forks source link

mail from Windows 10 mail client leaves the "Sent from Mail" footer #2

Open gregveres opened 6 years ago

gregveres commented 6 years ago

Hi @EricJWHuang

One of the other clients I am trying is the Windows 10 client. I don't know if they changed anything in the fall creator version, but that is what I am running.

Here is the original email text:

string text = "Hi Adrian\r\n\r\nI can play on sunday.\r\n\r\nSent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10\r\n\r\n________________________________\r\nFrom: SkyCourt <Notifications@example.com>\r\nSent: Saturday, January 20, 2018 10:02:58 AM\r\nTo: Greg\r\nSubject: SkyCourt - New message from Adrian\r\n\r\n\r\nA new message has been sent to you on SkyCourt from Adrian\r\n\r\nSaturday, Jan 20\r\nAdrian\r\n10:02 AM Squash tomorrow Sunday at 10:40 ? Let me know, Adrian. Thanks.\r\n\r\n\r\n\r\nPlease click this link to visit the site to reply or view new messages.<https://skycourt.ca/Player?showMessages=10968>\r\n\r\nGood luck on the court.\r\n\r\n";

The string that is returned is: "Hi Adrian\n\nI can play on sunday.\n\nSent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

rather than what should be returned: "Hi Adrian\n\nI can play on sunday."

gregveres commented 6 years ago

Looking at the code, I think the problem is the line extension isSignature is looking for Sent from my. But Microsoft isn't using that phrase. It isn't using my.

Also, looking through the code, I see that this doesn't handle any language other than english. That works for me right now, but I might come back and create a PR to handle some other languages.