1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +01:00

Strip email signatures from Mailbox

Summary: thanks mailbox

Test Plan: unit tests

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D10629
This commit is contained in:
epriestley 2014-10-02 12:33:43 -07:00
parent 410c2ecbfd
commit e333017c3e
2 changed files with 13 additions and 0 deletions

View file

@ -103,6 +103,13 @@ final class PhabricatorMetaMTAEmailBodyParser {
'',
$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',

View file

@ -66,6 +66,7 @@ EOEMAIL;
private function getEmailBodies() {
$trailing_space = ' ';
$emdash = "\xE2\x80\x94";
return array(
<<<EOEMAIL
@ -176,6 +177,11 @@ OKAY
> -----Original Message-----
>
> ...
EOMAIL
,
<<<EOMAIL
OKAY {$emdash}{$trailing_space}
Sent from Mailbox
EOMAIL
);
}