From 09b446b269f5cec0ba154872fddc354db44fd5e1 Mon Sep 17 00:00:00 2001 From: epriestley Date: Thu, 8 Feb 2018 17:48:59 -0800 Subject: [PATCH] Don't run older mail setup checks if "cluster.mailers" is configured Summary: Ref T12677. Skip these checks if we're doing the new stuff. Also, allow priority to be unspecified. Test Plan: Will deploy. Maniphest Tasks: T12677 Differential Revision: https://secure.phabricator.com/D19043 --- src/applications/config/check/PhabricatorMailSetupCheck.php | 4 ++++ .../cluster/config/PhabricatorClusterMailersConfigType.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/applications/config/check/PhabricatorMailSetupCheck.php b/src/applications/config/check/PhabricatorMailSetupCheck.php index 2b8e4e12d5..b3b6143ad0 100644 --- a/src/applications/config/check/PhabricatorMailSetupCheck.php +++ b/src/applications/config/check/PhabricatorMailSetupCheck.php @@ -7,6 +7,10 @@ final class PhabricatorMailSetupCheck extends PhabricatorSetupCheck { } protected function executeChecks() { + if (PhabricatorEnv::getEnvConfig('cluster.mailers')) { + return; + } + $adapter = PhabricatorEnv::getEnvConfig('metamta.mail-adapter'); switch ($adapter) { diff --git a/src/infrastructure/cluster/config/PhabricatorClusterMailersConfigType.php b/src/infrastructure/cluster/config/PhabricatorClusterMailersConfigType.php index 2a7550c419..b3b110298f 100644 --- a/src/infrastructure/cluster/config/PhabricatorClusterMailersConfigType.php +++ b/src/infrastructure/cluster/config/PhabricatorClusterMailersConfigType.php @@ -63,8 +63,8 @@ final class PhabricatorClusterMailersConfigType } $map[$key] = true; - $priority = idx($spec, 'priority', 0); - if ($priority <= 0) { + $priority = idx($spec, 'priority'); + if ($priority !== null && $priority <= 0) { throw $this->newException( pht( 'Mailer configuration ("%s") is invalid: priority must be '.