From 83f5452d538d7cc8ad876cca694ddcfbfcd2128c Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 16 Jan 2013 15:06:39 -0800 Subject: [PATCH] Implement all remaining config options Summary: Resolves T2255. Test Plan: Looked at mail options. Saw no remaining "Setup Issues". Reviewers: codeblock, btrahan Reviewed By: codeblock CC: aran Maniphest Tasks: T2255 Differential Revision: https://secure.phabricator.com/D4477 --- src/__phutil_library_map__.php | 4 +- .../PhabricatorApplicationConfigOptions.php | 7 + .../option/PhabricatorCoreConfigOptions.php | 9 + .../PhabricatorMetaMTAConfigOptions.php | 327 ++++++++++++++++++ 4 files changed, 346 insertions(+), 1 deletion(-) create mode 100644 src/applications/config/option/PhabricatorMetaMTAConfigOptions.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index bf8bc2037d..dd7d756150 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -947,6 +947,7 @@ phutil_register_library_map(array( 'PhabricatorMenuView' => 'view/layout/PhabricatorMenuView.php', 'PhabricatorMercurialGraphStream' => 'applications/repository/daemon/PhabricatorMercurialGraphStream.php', 'PhabricatorMetaMTAAttachment' => 'applications/metamta/storage/PhabricatorMetaMTAAttachment.php', + 'PhabricatorMetaMTAConfigOptions' => 'applications/config/option/PhabricatorMetaMTAConfigOptions.php', 'PhabricatorMetaMTAController' => 'applications/metamta/controller/PhabricatorMetaMTAController.php', 'PhabricatorMetaMTADAO' => 'applications/metamta/storage/PhabricatorMetaMTADAO.php', 'PhabricatorMetaMTAEmailBodyParser' => 'applications/metamta/PhabricatorMetaMTAEmailBodyParser.php', @@ -2310,8 +2311,9 @@ phutil_register_library_map(array( 'PhabricatorMainMenuView' => 'AphrontView', 'PhabricatorManiphestConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorMarkupCache' => 'PhabricatorCacheDAO', - 'PhabricatorMenuItemView' => 'AphrontView', + 'PhabricatorMenuItemView' => 'AphrontTagView', 'PhabricatorMenuView' => 'AphrontTagView', + 'PhabricatorMetaMTAConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorMetaMTAController' => 'PhabricatorController', 'PhabricatorMetaMTADAO' => 'PhabricatorLiskDAO', 'PhabricatorMetaMTAEmailBodyParserTestCase' => 'PhabricatorTestCase', diff --git a/src/applications/config/option/PhabricatorApplicationConfigOptions.php b/src/applications/config/option/PhabricatorApplicationConfigOptions.php index 8c14f42370..c08758de3e 100644 --- a/src/applications/config/option/PhabricatorApplicationConfigOptions.php +++ b/src/applications/config/option/PhabricatorApplicationConfigOptions.php @@ -175,5 +175,12 @@ abstract class PhabricatorApplicationConfigOptions extends Phobject { return $options; } + /** + * Deformat a HEREDOC for use in remarkup by converting line breaks to + * spaces. + */ + final protected function deformat($string) { + return preg_replace('/(?<=\S)\n(?=\S)/', ' ', $string); + } } diff --git a/src/applications/config/option/PhabricatorCoreConfigOptions.php b/src/applications/config/option/PhabricatorCoreConfigOptions.php index 07bf393581..148d6e0dee 100644 --- a/src/applications/config/option/PhabricatorCoreConfigOptions.php +++ b/src/applications/config/option/PhabricatorCoreConfigOptions.php @@ -115,6 +115,15 @@ final class PhabricatorCoreConfigOptions $this->newOption('config.mask', 'set', array()) ->setLocked(true) ->setDescription(pht('Additional configuration options to mask.')), + $this->newOption('phabricator.env', 'string', null) + ->setLocked(true) + ->setDescription(pht('Internal.')), + $this->newOption('phabricator.version', 'string', null) + ->setLocked(true) + ->setDescription(pht('Internal / deprecated.')), + $this->newOption('phabricator.setup', 'bool', false) + ->setLocked(true) + ->setDescription(pht('Internal / deprecated.')), ); } diff --git a/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php b/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php new file mode 100644 index 0000000000..b3c188f335 --- /dev/null +++ b/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php @@ -0,0 +1,327 @@ +deformat(pht(<<deformat(pht(<<deformat(pht(<<deformat(pht(<<deformat(pht(<<deformat(pht(<<deformat(pht(<<deformat(pht(<<deformat(pht(<<deformat(pht(<<deformat(pht(<<deformat(pht(<<deformat(pht(<<deformat(pht(<<deformat(pht(<<' + - `real`: 'George Washington ' + - `full`: 'gwashington (George Washington) ' + +The default is `full`. +EODOC +)); + + return array( + $this->newOption( + 'metamta.default-address', + 'string', + 'noreply@phabricator.example.com') + ->setDescription(pht('Default "From" address.')), + $this->newOption( + 'metamta.domain', + 'string', + 'phabricator.example.com') + ->setDescription(pht('Domain used to generate Message-IDs.')), + $this->newOption( + 'metamta.mail-adapter', + 'class', + 'PhabricatorMailImplementationPHPMailerLiteAdapter') + ->setBaseClass('PhabricatorMailImplementationAdapter') + ->setSummary(pht('Control how mail is sent.')) + ->setDescription($adapter_description), + $this->newOption( + 'metamta.one-mail-per-recipient', + 'bool', + true) + ->setBoolOptions( + array( + pht("Send Mail To Each Recipient"), + pht("Send Mail To All Recipients"), + )) + ->setSummary( + pht( + 'Controls whether Phabricator sends one email with multiple '. + 'recipients in the "To:" line, or multiple emails, each with a '. + 'single recipient in the "To:" line.')) + ->setDescription($one_mail_per_recipient_desc), + $this->newOption('metamta.can-send-as-user', 'bool', false) + ->setBoolOptions( + array( + pht("Send as User Taking Action"), + pht("Send as Phabricator"), + )) + ->setSummary( + pht( + 'Controls whether Phabricator sends email "From" users.')) + ->setDescription($send_as_user_desc), + $this->newOption('metamta.reply.show-hints', 'bool', true) + ->setBoolOptions( + array( + pht("Show Reply Handler Hints"), + pht("No Reply Handler Hints"), + )) + ->setSummary(pht('Show hints about Herald rules in email.')) + ->setDescription($herald_hints_description), + $this->newOption('metamta.herald.show-hints', 'bool', true) + ->setBoolOptions( + array( + pht("Show Herald Hints"), + pht("No Herald Hints"), + )) + ->setSummary(pht('Show hints about reply handler actions in email.')) + ->setDescription($reply_hints_description), + $this->newOption('metamta.recipients.show-hints', 'bool', true) + ->setBoolOptions( + array( + pht("Show Recipient Hints"), + pht("No Recipient Hints"), + )) + ->setSummary(pht('Show "To:" and "Cc:" footer hints in email.')) + ->setDescription($recipient_hints_description), + $this->newOption('metamta.precedence-bulk', 'bool', false) + ->setBoolOptions( + array( + pht('Add "Precedence: bulk" Header'), + pht('No "Precedence: bulk" Header'), + )) + ->setSummary(pht('Control the "Precedence: bulk" header.')) + ->setDescription($bulk_description), + $this->newOption('metamta.re-prefix', 'bool', false) + ->setBoolOptions( + array( + pht('Force "Re:" Subject Prefix'), + pht('No "Re:" Subject Prefix'), + )) + ->setSummary(pht('Control "Re:" subject prefix, for Mail.app.')) + ->setDescription($re_prefix_description), + $this->newOption('metamta.vary-subjects', 'bool', true) + ->setBoolOptions( + array( + pht('Allow Varied Subjects'), + pht('Always Use the Same Thread Subject'), + )) + ->setSummary(pht('Control subject variance, for some mail clients.')) + ->setDescription($vary_subjects_description), + $this->newOption('metamta.insecure-auth-with-reply-to', 'bool', false) + ->setBoolOptions( + array( + pht('Allow Insecure Reply-To Auth'), + pht('Disallow Reply-To Auth'), + )) + ->setSummary(pht('Trust "Reply-To" headers for authentication.')) + ->setDescription($reply_to_description), + $this->newOption('metamta.send-immediately', 'bool', true) + ->setBoolOptions( + array( + pht('Send Immediately (Slow)'), + pht('Send Via Daemons (Must Run Daemons)'), + )) + ->setSummary(pht('Improve performance by sending email via daemons.')) + ->setDescription($immediately_description), + $this->newOption('metamta.placeholder-to-recipient', 'string', null) + ->setSummary(pht('Placeholder for mail with only CCs.')) + ->setDescription($placeholder_description), + $this->newOption('metamta.public-replies', 'bool', false) + ->setBoolOptions( + array( + pht('Use Public Replies (Less Secure)'), + pht('Use Private Replies (More Secure)'), + )) + ->setSummary( + pht( + 'Phabricator can use less-secure but mailing list friendly public '. + 'reply addresses.')) + ->setDescription($public_replies_description), + $this->newOption('metamta.single-reply-handler-prefix', 'string', null) + ->setSummary( + pht('Allow Phabricator to use a single mailbox for all replies.')) + ->setDescription($single_description), + // TODO: 'enum' + $this->newOption('metamta.user-address-format', 'string', 'full') + ->setSummary(pht('Control how Phabricator renders user names in mail.')) + ->setDescription($address_description), + ); + } + +}