EricJWHuang / EmailReplyParser

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

mail from iOS doesn't parse out the original message #1

Open gregveres opened 6 years ago

gregveres commented 6 years ago

Hi @EricJWHuang

First off, thank you for providing this library.

I too have the same need to parse out the last response. I has started collecting emails from various email clients and had already started building a test suite when I found this library. So I NuGet'd your package and hooked it up. I found that a simple response to an html email on iOS didn't parse out the response at all.

Here is the text of the response from iOS:

string text = "Hi Adrian\r\n\r\nI can play on sunday.\r\n\r\nOn Jan 20, 2018, at 10:03 AM, SkyCourt <Notifications@example.com<mailto:Notifications@example.com>> wrote:\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";

When I run this through the parser I get

"Hi Adrian\n\nI can play on sunday.\n\nOn Jan 20, 2018, at 10:03 AM, SkyCourt <Notifications@example.com<mailto:Notifications@example.com>> wrote:\n\n\nA new message has been sent to you on SkyCourt from Adrian\n\nSaturday, Jan 20\nAdrian\n10:02 AM Squash tomorrow Sunday at 10:40 ? Let me know, Adrian. Thanks.\n\n\n\nPlease click this link to visit the site to reply or view new messages.<https://skycourt.ca/Player?showMessages=10968>\n\nGood luck on the court."

It didn't strip any of it away.

gregveres commented 6 years ago

The isQuoteHeader regex isn't matching that On Jan 20, ... wrote: line. I can't see why straight away. I think the regex is correct for matching this line.