diff --git a/src/applications/metamta/parser/PhabricatorMetaMTAEmailBodyParser.php b/src/applications/metamta/parser/PhabricatorMetaMTAEmailBodyParser.php index 05133777aa..5138c1a2bd 100644 --- a/src/applications/metamta/parser/PhabricatorMetaMTAEmailBodyParser.php +++ b/src/applications/metamta/parser/PhabricatorMetaMTAEmailBodyParser.php @@ -135,9 +135,11 @@ 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? + // omits the leading newline and uses an em dash. This may or may not have + // the trailing space, but it's unique enough that there's no real ambiguity + // in detecting it. $body = preg_replace( - "/\s*\xE2\x80\x94 \nSent from Mailbox\s*\z/su", + "/\s*\xE2\x80\x94\s*\nSent from Mailbox\s*\z/su", '', $body); diff --git a/src/applications/metamta/parser/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php b/src/applications/metamta/parser/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php index 435243edd4..6a124e30f4 100644 --- a/src/applications/metamta/parser/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php +++ b/src/applications/metamta/parser/__tests__/PhabricatorMetaMTAEmailBodyParserTestCase.php @@ -246,6 +246,13 @@ EOMAIL <<