mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 08:52:39 +01:00
Added Outlook boundaries for email parser
Summary: Outlook wraps a message in 5 dashes on each side when doing replies. This strips english and danish versions. Test Plan: Tried parsing emails with different messages and saw the expected behaviour with patch applied. Ran arc unit, and saw test passed. Reviewers: epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: 1239
This commit is contained in:
parent
673f0d6c81
commit
5f1b3937e5
2 changed files with 28 additions and 0 deletions
|
@ -30,6 +30,18 @@ final class PhabricatorMetaMTAEmailBodyParser {
|
|||
'',
|
||||
$body);
|
||||
|
||||
// Outlook english
|
||||
$body = preg_replace(
|
||||
'/^\s*-----Original Message-----.*?/msU',
|
||||
'',
|
||||
$body);
|
||||
|
||||
// Outlook danish
|
||||
$body = preg_replace(
|
||||
'/^\s*-----Oprindelig Meddelelse-----.*?/msU',
|
||||
'',
|
||||
$body);
|
||||
|
||||
return rtrim($body);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,6 +57,22 @@ On Fri, May 27, 2011 at 9:39 AM, Someone
|
|||
|
||||
> ...
|
||||
|
||||
EOEMAIL
|
||||
,
|
||||
<<<EOEMAIL
|
||||
OKAY
|
||||
|
||||
-----Oprindelig Meddelelse-----
|
||||
|
||||
> ...
|
||||
EOEMAIL
|
||||
,
|
||||
<<<EOEMAIL
|
||||
OKAY
|
||||
|
||||
-----Original Message-----
|
||||
|
||||
> ...
|
||||
EOEMAIL
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue