FYI: new emails from phabricator can be replied to

Jun Wu quark at fb.com
Thu Sep 7 16:24:27 EDT 2017


Excerpts from Augie Fackler's message of 2017-09-07 14:54:56 -0400:
> Hopefully this means if you don't have a phabricator account, you can
> still get comments attached to phabricator-sent patches.

By default Phabricator requires "From" address to match an existing user.

I think we can patch Phabricator to allow replying using a dummy user
account if not registered.

diff --git a/src/applications/metamta/receiver/PhabricatorMailReceiver.php b/src/applications/metamta/receiver/PhabricatorMailReceiver.php
index 05b44f364..2beb88119 100644
--- a/src/applications/metamta/receiver/PhabricatorMailReceiver.php
+++ b/src/applications/metamta/receiver/PhabricatorMailReceiver.php
@@ -100,6 +100,11 @@ abstract class PhabricatorMailReceiver extends Phobject {
 
     // Try to find a user with this email address.
     $user = PhabricatorUser::loadOneWithEmailAddress($from);
+    if (!$user) {
+      // Use a predefined fallback user
+      $from = PhabricatorEnv::getEnvConfigIfExists('metamta.fallback-from');
+      $user = PhabricatorUser::loadOneWithEmailAddress($from);
+    }
     if ($user) {
       return $user;
     } else {



More information about the Mercurial-devel mailing list