Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for getting visible reply text from Windows 10 Mail messages #74

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/EmailReplyParser/Parser/EmailParser.php
Expand Up @@ -25,7 +25,7 @@ class EmailParser
*
* @var string
*/
private $signatureRegex = '/(?:^\s*--|^\s*__|^-\w|^-- $)|(?:^Sent from my (?:\s*\w+){1,4}$)|(?:^={30,}$)$/s';
private $signatureRegex = '/(?:^\s*--|^\s*__|^-\w|^-- $)|(?:^Sent from (my|Mail) (?:\s*\w+){1,4}$)|(?:^={30,}$)$/s';

/**
* @var string[]
Expand Down
7 changes: 7 additions & 0 deletions tests/EmailReplyParser/Tests/EmailReplyParserTest.php
Expand Up @@ -72,6 +72,13 @@ public function testParseOutSentFromBlackBerry()
$this->assertEquals('Here is another email', EmailReplyParser::parseReply($body));
}

public function testParseOutSentFromMailForWindows10()
{
$body = $this->getFixtures('email_w10_mail.txt');

$this->assertEquals("Great thanks Bort, going for a test now.\nBraxton", EmailReplyParser::parseReply($body));
}

public function testParseOutSendFromMultiwordMobileDevice()
{
$body = $this->getFixtures('email_multi_word_sent_from_my_mobile_device.txt');
Expand Down
16 changes: 16 additions & 0 deletions tests/Fixtures/email_w10_mail.txt
@@ -0,0 +1,16 @@
Great thanks Bort, going for a test now.
Braxton

Sent from Mail for Windows 10

From: Bort
Sent: April 9, 2020 2:02 PM
To: braxton@company.com
Subject: Re: [#000] Stuff pls

Tickets
[#000] Stuff pls
Bort replied:
Here is the stuff.
In case you are wondering about that other stuff - we don't do that.
Thanks!