From a3c811f281a09a6df6c0f91c52334b6be2efc27e Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 12 Nov 2013 21:23:23 -0800 Subject: [PATCH] Accept case-insensitive mail replies Summary: Mailbox sometimes (?) changes the case of the email address (?). Be more liberal in what we accept. Also fix a minor output bug. Test Plan: Sent mail to `e1+...` instead of `E1+...`, verified it arrived. Reviewers: btrahan Reviewed By: btrahan CC: aran Differential Revision: https://secure.phabricator.com/D7575 --- .../PhabricatorMailManagementShowInboundWorkflow.php | 3 +++ .../metamta/receiver/PhabricatorObjectMailReceiver.php | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php index 5226bd2dc2..ea2bf197dd 100644 --- a/src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php +++ b/src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php @@ -63,6 +63,9 @@ final class PhabricatorMailManagementShowInboundWorkflow $info[] = null; $info[] = pht('HEADERS'); foreach ($message->getHeaders() as $key => $value) { + if (is_array($value)) { + $value = implode("\n", $value); + } $info[] = pht('%s: %s', $key, $value); } diff --git a/src/applications/metamta/receiver/PhabricatorObjectMailReceiver.php b/src/applications/metamta/receiver/PhabricatorObjectMailReceiver.php index 9202e710f5..8c88e4e1f5 100644 --- a/src/applications/metamta/receiver/PhabricatorObjectMailReceiver.php +++ b/src/applications/metamta/receiver/PhabricatorObjectMailReceiver.php @@ -156,7 +156,7 @@ abstract class PhabricatorObjectMailReceiver extends PhabricatorMailReceiver { '(?P\w+)'. '\\+'. '(?P[a-f0-9]{16})'. - '$)U'; + '$)Ui'; return $regexp; } @@ -166,7 +166,9 @@ abstract class PhabricatorObjectMailReceiver extends PhabricatorMailReceiver { PhabricatorUser $sender) { $parts = $this->matchObjectAddressInMail($mail); - return $this->loadObject($parts['pattern'], $sender); + return $this->loadObject( + phutil_utf8_strtoupper($parts['pattern']), + $sender); } public static function computeMailHash($mail_key, $phid) {