From b98d46ce7d28c27ac8653e80a03a23d866eeb322 Mon Sep 17 00:00:00 2001 From: Austin McKinley Date: Fri, 11 Jan 2019 14:21:11 -0800 Subject: [PATCH] Resurrect setup check for cluster.mailers Summary: D19940 removed this file entirely, which has led to at least one user who was unsure how to proceed now that `cluster.mailers` is required for outbound mail: https://discourse.phabricator-community.org/t/invalid-argument-supplied-for-foreach-phabricatormetamtamail-php/2287 This isn't //always// a setup issue for installs that don't care about sending mail, but this at least this gives a sporting chance to users who don't follow the changelogs. Also, I'm not sure if there's a way to use `pht()` to generate links; right now the phurl is just in plain text. Test Plan: Removed `cluster.mailers` config; observed expected setup issue. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D19964 --- src/__phutil_library_map__.php | 2 ++ .../check/PhabricatorMailSetupCheck.php | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 src/applications/config/check/PhabricatorMailSetupCheck.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 07ecac9a17..d2a7dcb3d8 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -3411,6 +3411,7 @@ phutil_register_library_map(array( 'PhabricatorMailReceiverTestCase' => 'applications/metamta/receiver/__tests__/PhabricatorMailReceiverTestCase.php', 'PhabricatorMailReplyHandler' => 'applications/metamta/replyhandler/PhabricatorMailReplyHandler.php', 'PhabricatorMailRoutingRule' => 'applications/metamta/constants/PhabricatorMailRoutingRule.php', + 'PhabricatorMailSetupCheck' => 'applications/config/check/PhabricatorMailSetupCheck.php', 'PhabricatorMailStamp' => 'applications/metamta/stamp/PhabricatorMailStamp.php', 'PhabricatorMailTarget' => 'applications/metamta/replyhandler/PhabricatorMailTarget.php', 'PhabricatorMailUtil' => 'applications/metamta/util/PhabricatorMailUtil.php', @@ -9223,6 +9224,7 @@ phutil_register_library_map(array( 'PhabricatorMailReceiverTestCase' => 'PhabricatorTestCase', 'PhabricatorMailReplyHandler' => 'Phobject', 'PhabricatorMailRoutingRule' => 'Phobject', + 'PhabricatorMailSetupCheck' => 'PhabricatorSetupCheck', 'PhabricatorMailStamp' => 'Phobject', 'PhabricatorMailTarget' => 'Phobject', 'PhabricatorMailUtil' => 'Phobject', diff --git a/src/applications/config/check/PhabricatorMailSetupCheck.php b/src/applications/config/check/PhabricatorMailSetupCheck.php new file mode 100644 index 0000000000..c89e0036a2 --- /dev/null +++ b/src/applications/config/check/PhabricatorMailSetupCheck.php @@ -0,0 +1,24 @@ +newIssue('cluster.mailers') + ->setName(pht('Mailers Not Configured')) + ->setMessage($message) + ->addPhabricatorConfig('cluster.mailers'); + } +}