Skip to content

Commit

Permalink
Add support for getting visible reply text from Windows 10 Mail messa…
Browse files Browse the repository at this point in the history
…ges (willdurand#74)
  • Loading branch information
AlbinoDrought authored Apr 12, 2021
1 parent 642bec1 commit 9ca135c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/EmailReplyParser/Parser/EmailParser.php
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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: [email protected]
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!

0 comments on commit 9ca135c

Please sign in to comment.