Page MenuHomePhabricator

D10629.diff
No OneTemporary

D10629.diff

diff --git a/src/applications/metamta/parser/PhabricatorMetaMTAEmailBodyParser.php b/src/applications/metamta/parser/PhabricatorMetaMTAEmailBodyParser.php
--- a/src/applications/metamta/parser/PhabricatorMetaMTAEmailBodyParser.php
+++ b/src/applications/metamta/parser/PhabricatorMetaMTAEmailBodyParser.php
@@ -103,6 +103,13 @@
'',
$body);
+ // Mailbox seems to make an attempt to comply with the "standard" but
+ // omits the leading newline and uses an em dash?
+ $body = preg_replace(
+ "/\s*\xE2\x80\x94 \nSent from Mailbox\s*\z/su",
+ '',
+ $body);
+
// HTC Mail application (mobile)
$body = preg_replace(
'/^\s*^Sent from my HTC smartphone.*/sm',
diff --git a/src/applications/metamta/parser/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php b/src/applications/metamta/parser/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php
--- a/src/applications/metamta/parser/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php
+++ b/src/applications/metamta/parser/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php
@@ -66,6 +66,7 @@
private function getEmailBodies() {
$trailing_space = ' ';
+ $emdash = "\xE2\x80\x94";
return array(
<<<EOEMAIL
@@ -177,6 +178,11 @@
>
> ...
EOMAIL
+,
+<<<EOMAIL
+OKAY {$emdash}{$trailing_space}
+Sent from Mailbox
+EOMAIL
);
}

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 29, 9:39 AM (6 d, 6 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7351215
Default Alt Text
D10629.diff (1 KB)

Event Timeline