diff --git a/conf/default.conf.php b/conf/default.conf.php index ef8575ad0a..13230ce01b 100644 --- a/conf/default.conf.php +++ b/conf/default.conf.php @@ -522,6 +522,13 @@ return array( 'differential.field-selector' => 'DifferentialDefaultFieldSelector', + // If you set this to true, users can "!accept" revisions via email (normally, + // they can take other actions but can not "!accept"). This action is disabled + // by default because email authentication can be configured to be very weak, + // and, socially, email "!accept" is kind of sketchy and implies revisions may + // not actually be receiving thorough review. + 'differential.enable-email-accept' => false, + // -- Maniphest ------------------------------------------------------------- // diff --git a/src/applications/differential/replyhandler/DifferentialReplyHandler.php b/src/applications/differential/replyhandler/DifferentialReplyHandler.php index a23b28f50e..7146b45d9f 100644 --- a/src/applications/differential/replyhandler/DifferentialReplyHandler.php +++ b/src/applications/differential/replyhandler/DifferentialReplyHandler.php @@ -88,7 +88,7 @@ class DifferentialReplyHandler extends PhabricatorMailReplyHandler { } public function getSupportedCommands() { - return array( + $actions = array( DifferentialAction::ACTION_COMMENT, DifferentialAction::ACTION_REJECT, DifferentialAction::ACTION_ABANDON, @@ -97,6 +97,12 @@ class DifferentialReplyHandler extends PhabricatorMailReplyHandler { DifferentialAction::ACTION_RETHINK, 'unsubscribe', ); + + if (PhabricatorEnv::getEnvConfig('differential.enable-email-accept')) { + $actions[] = DifferentialAction::ACTION_ACCEPT; + } + + return $actions; } public function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) {