mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-11 23:31:03 +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:
parent
410c2ecbfd
commit
e333017c3e
2 changed files with 13 additions and 0 deletions
|
@ -103,6 +103,13 @@ final class PhabricatorMetaMTAEmailBodyParser {
|
||||||
'',
|
'',
|
||||||
$body);
|
$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)
|
// HTC Mail application (mobile)
|
||||||
$body = preg_replace(
|
$body = preg_replace(
|
||||||
'/^\s*^Sent from my HTC smartphone.*/sm',
|
'/^\s*^Sent from my HTC smartphone.*/sm',
|
||||||
|
|
|
@ -66,6 +66,7 @@ EOEMAIL;
|
||||||
|
|
||||||
private function getEmailBodies() {
|
private function getEmailBodies() {
|
||||||
$trailing_space = ' ';
|
$trailing_space = ' ';
|
||||||
|
$emdash = "\xE2\x80\x94";
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
<<<EOEMAIL
|
<<<EOEMAIL
|
||||||
|
@ -176,6 +177,11 @@ OKAY
|
||||||
> -----Original Message-----
|
> -----Original Message-----
|
||||||
>
|
>
|
||||||
> ...
|
> ...
|
||||||
|
EOMAIL
|
||||||
|
,
|
||||||
|
<<<EOMAIL
|
||||||
|
OKAY {$emdash}{$trailing_space}
|
||||||
|
Sent from Mailbox
|
||||||
EOMAIL
|
EOMAIL
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue