Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15453039
D19940.id47603.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
27 KB
Referenced Files
None
Subscribers
None
D19940.id47603.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -3419,10 +3419,8 @@
'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',
- 'PhabricatorMailgunConfigOptions' => 'applications/config/option/PhabricatorMailgunConfigOptions.php',
'PhabricatorMainMenuBarExtension' => 'view/page/menu/PhabricatorMainMenuBarExtension.php',
'PhabricatorMainMenuSearchView' => 'view/page/menu/PhabricatorMainMenuSearchView.php',
'PhabricatorMainMenuView' => 'view/page/menu/PhabricatorMainMenuView.php',
@@ -3671,7 +3669,6 @@
'PhabricatorPHIDsSearchField' => 'applications/search/field/PhabricatorPHIDsSearchField.php',
'PhabricatorPHPASTApplication' => 'applications/phpast/application/PhabricatorPHPASTApplication.php',
'PhabricatorPHPConfigSetupCheck' => 'applications/config/check/PhabricatorPHPConfigSetupCheck.php',
- 'PhabricatorPHPMailerConfigOptions' => 'applications/config/option/PhabricatorPHPMailerConfigOptions.php',
'PhabricatorPHPPreflightSetupCheck' => 'applications/config/check/PhabricatorPHPPreflightSetupCheck.php',
'PhabricatorPackagesApplication' => 'applications/packages/application/PhabricatorPackagesApplication.php',
'PhabricatorPackagesController' => 'applications/packages/controller/PhabricatorPackagesController.php',
@@ -4326,7 +4323,6 @@
'PhabricatorSecuritySetupCheck' => 'applications/config/check/PhabricatorSecuritySetupCheck.php',
'PhabricatorSelectEditField' => 'applications/transactions/editfield/PhabricatorSelectEditField.php',
'PhabricatorSelectSetting' => 'applications/settings/setting/PhabricatorSelectSetting.php',
- 'PhabricatorSendGridConfigOptions' => 'applications/config/option/PhabricatorSendGridConfigOptions.php',
'PhabricatorSessionsSettingsPanel' => 'applications/settings/panel/PhabricatorSessionsSettingsPanel.php',
'PhabricatorSetConfigType' => 'applications/config/type/PhabricatorSetConfigType.php',
'PhabricatorSetting' => 'applications/settings/setting/PhabricatorSetting.php',
@@ -9248,10 +9244,8 @@
'PhabricatorMailReceiverTestCase' => 'PhabricatorTestCase',
'PhabricatorMailReplyHandler' => 'Phobject',
'PhabricatorMailRoutingRule' => 'Phobject',
- 'PhabricatorMailSetupCheck' => 'PhabricatorSetupCheck',
'PhabricatorMailStamp' => 'Phobject',
'PhabricatorMailTarget' => 'Phobject',
- 'PhabricatorMailgunConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorMainMenuBarExtension' => 'Phobject',
'PhabricatorMainMenuSearchView' => 'AphrontView',
'PhabricatorMainMenuView' => 'AphrontView',
@@ -9543,7 +9537,6 @@
'PhabricatorPHIDsSearchField' => 'PhabricatorSearchField',
'PhabricatorPHPASTApplication' => 'PhabricatorApplication',
'PhabricatorPHPConfigSetupCheck' => 'PhabricatorSetupCheck',
- 'PhabricatorPHPMailerConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorPHPPreflightSetupCheck' => 'PhabricatorSetupCheck',
'PhabricatorPackagesApplication' => 'PhabricatorApplication',
'PhabricatorPackagesController' => 'PhabricatorController',
@@ -10365,7 +10358,6 @@
'PhabricatorSecuritySetupCheck' => 'PhabricatorSetupCheck',
'PhabricatorSelectEditField' => 'PhabricatorEditField',
'PhabricatorSelectSetting' => 'PhabricatorSetting',
- 'PhabricatorSendGridConfigOptions' => 'PhabricatorApplicationConfigOptions',
'PhabricatorSessionsSettingsPanel' => 'PhabricatorSettingsPanel',
'PhabricatorSetConfigType' => 'PhabricatorTextConfigType',
'PhabricatorSetting' => 'Phobject',
diff --git a/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php b/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
--- a/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
+++ b/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
@@ -193,12 +193,15 @@
'in global settings.');
$dashboard_reason = pht(
- 'This option has been removed, you can use Dashboards to provide '.
- 'homepage customization. See T11533 for more details.');
+ 'This option has been removed, you can use Dashboards to provide '.
+ 'homepage customization. See T11533 for more details.');
$elastic_reason = pht(
- 'Elasticsearch is now configured with "%s".',
- 'cluster.search');
+ 'Elasticsearch is now configured with "%s".',
+ 'cluster.search');
+
+ $mailers_reason = pht(
+ 'Inbound and outbound mail is now configured with "cluster.mailers".');
$ancient_config += array(
'phid.external-loaders' =>
@@ -354,6 +357,21 @@
'search.elastic.host' => $elastic_reason,
'search.elastic.namespace' => $elastic_reason,
+ 'metamta.mail-adapter' => $mailers_reason,
+ 'amazon-ses.access-key' => $mailers_reason,
+ 'amazon-ses.secret-key' => $mailers_reason,
+ 'amazon-ses.endpoint' => $mailers_reason,
+ 'mailgun.domain' => $mailers_reason,
+ 'mailgun.api-key' => $mailers_reason,
+ 'phpmailer.mailer' => $mailers_reason,
+ 'phpmailer.smtp-host' => $mailers_reason,
+ 'phpmailer.smtp-port' => $mailers_reason,
+ 'phpmailer.smtp-protocol' => $mailers_reason,
+ 'phpmailer.smtp-user' => $mailers_reason,
+ 'phpmailer.smtp-password' => $mailers_reason,
+ 'phpmailer.smtp-encoding' => $mailers_reason,
+ 'sendgrid.api-user' => $mailers_reason,
+ 'sendgrid.api-key' => $mailers_reason,
);
return $ancient_config;
diff --git a/src/applications/config/check/PhabricatorMailSetupCheck.php b/src/applications/config/check/PhabricatorMailSetupCheck.php
deleted file mode 100644
--- a/src/applications/config/check/PhabricatorMailSetupCheck.php
+++ /dev/null
@@ -1,104 +0,0 @@
-<?php
-
-final class PhabricatorMailSetupCheck extends PhabricatorSetupCheck {
-
- public function getDefaultGroup() {
- return self::GROUP_OTHER;
- }
-
- protected function executeChecks() {
- if (PhabricatorEnv::getEnvConfig('cluster.mailers')) {
- return;
- }
-
- $adapter = PhabricatorEnv::getEnvConfig('metamta.mail-adapter');
-
- switch ($adapter) {
- case 'PhabricatorMailImplementationPHPMailerLiteAdapter':
- if (!Filesystem::pathExists('/usr/bin/sendmail') &&
- !Filesystem::pathExists('/usr/sbin/sendmail')) {
- $message = pht(
- 'Mail is configured to send via sendmail, but this system has '.
- 'no sendmail binary. Install sendmail or choose a different '.
- 'mail adapter.');
-
- $this->newIssue('config.metamta.mail-adapter')
- ->setShortName(pht('Missing Sendmail'))
- ->setName(pht('No Sendmail Binary Found'))
- ->setMessage($message)
- ->addRelatedPhabricatorConfig('metamta.mail-adapter');
- }
- break;
- case 'PhabricatorMailImplementationAmazonSESAdapter':
- if (PhabricatorEnv::getEnvConfig('metamta.can-send-as-user')) {
- $message = pht(
- 'Amazon SES does not support sending email as users. Disable '.
- 'send as user, or choose a different mail adapter.');
-
- $this->newIssue('config.can-send-as-user')
- ->setName(pht("SES Can't Send As User"))
- ->setMessage($message)
- ->addRelatedPhabricatorConfig('metamta.mail-adapter')
- ->addPhabricatorConfig('metamta.can-send-as-user');
- }
-
- if (!PhabricatorEnv::getEnvConfig('amazon-ses.access-key')) {
- $message = pht(
- 'Amazon SES is selected as the mail adapter, but no SES access '.
- 'key is configured. Provide an SES access key, or choose a '.
- 'different mail adapter.');
-
- $this->newIssue('config.amazon-ses.access-key')
- ->setName(pht('Amazon SES Access Key Not Set'))
- ->setMessage($message)
- ->addRelatedPhabricatorConfig('metamta.mail-adapter')
- ->addPhabricatorConfig('amazon-ses.access-key');
- }
-
- if (!PhabricatorEnv::getEnvConfig('amazon-ses.secret-key')) {
- $message = pht(
- 'Amazon SES is selected as the mail adapter, but no SES secret '.
- 'key is configured. Provide an SES secret key, or choose a '.
- 'different mail adapter.');
-
- $this->newIssue('config.amazon-ses.secret-key')
- ->setName(pht('Amazon SES Secret Key Not Set'))
- ->setMessage($message)
- ->addRelatedPhabricatorConfig('metamta.mail-adapter')
- ->addPhabricatorConfig('amazon-ses.secret-key');
- }
-
- if (!PhabricatorEnv::getEnvConfig('amazon-ses.endpoint')) {
- $message = pht(
- 'Amazon SES is selected as the mail adapter, but no SES endpoint '.
- 'is configured. Provide an SES endpoint or choose a different '.
- 'mail adapter.');
-
- $this->newIssue('config.amazon-ses.endpoint')
- ->setName(pht('Amazon SES Endpoint Not Set'))
- ->setMessage($message)
- ->addRelatedPhabricatorConfig('metamta.mail-adapter')
- ->addPhabricatorConfig('amazon-ses.endpoint');
- }
-
- $address_key = 'metamta.default-address';
- $options = PhabricatorApplicationConfigOptions::loadAllOptions();
- $default = $options[$address_key]->getDefault();
- $value = PhabricatorEnv::getEnvConfig($address_key);
- if ($default === $value) {
- $message = pht(
- 'Amazon SES requires verification of the "From" address, but '.
- 'you have not configured a "From" address. Configure and verify '.
- 'a "From" address, or choose a different mail adapter.');
-
- $this->newIssue('config.metamta.default-address')
- ->setName(pht('No SES From Address Configured'))
- ->setMessage($message)
- ->addRelatedPhabricatorConfig('metamta.mail-adapter')
- ->addPhabricatorConfig('metamta.default-address');
- }
- break;
- }
-
- }
-}
diff --git a/src/applications/config/option/PhabricatorAWSConfigOptions.php b/src/applications/config/option/PhabricatorAWSConfigOptions.php
--- a/src/applications/config/option/PhabricatorAWSConfigOptions.php
+++ b/src/applications/config/option/PhabricatorAWSConfigOptions.php
@@ -21,24 +21,6 @@
public function getOptions() {
return array(
- $this->newOption('amazon-ses.access-key', 'string', null)
- ->setLocked(true)
- ->setDescription(pht('Access key for Amazon SES.')),
- $this->newOption('amazon-ses.secret-key', 'string', null)
- ->setHidden(true)
- ->setDescription(pht('Secret key for Amazon SES.')),
- $this->newOption('amazon-ses.endpoint', 'string', null)
- ->setLocked(true)
- ->setDescription(
- pht(
- 'SES endpoint domain name. You can find a list of available '.
- 'regions and endpoints in the AWS documentation.'))
- ->addExample(
- 'email.us-east-1.amazonaws.com',
- pht('US East (N. Virginia, Older default endpoint)'))
- ->addExample(
- 'email.us-west-2.amazonaws.com',
- pht('US West (Oregon)')),
$this->newOption('amazon-s3.access-key', 'string', null)
->setLocked(true)
->setDescription(pht('Access key for Amazon S3.')),
diff --git a/src/applications/config/option/PhabricatorMailgunConfigOptions.php b/src/applications/config/option/PhabricatorMailgunConfigOptions.php
deleted file mode 100644
--- a/src/applications/config/option/PhabricatorMailgunConfigOptions.php
+++ /dev/null
@@ -1,38 +0,0 @@
-<?php
-
-final class PhabricatorMailgunConfigOptions
- extends PhabricatorApplicationConfigOptions {
-
- public function getName() {
- return pht('Integration with Mailgun');
- }
-
- public function getDescription() {
- return pht('Configure Mailgun integration.');
- }
-
- public function getIcon() {
- return 'fa-send-o';
- }
-
- public function getGroup() {
- return 'core';
- }
-
- public function getOptions() {
- return array(
- $this->newOption('mailgun.domain', 'string', null)
- ->setLocked(true)
- ->setDescription(
- pht(
- 'Mailgun domain name. See %s.',
- 'https://mailgun.com/cp/domains'))
- ->addExample('mycompany.com', pht('Use specific domain')),
- $this->newOption('mailgun.api-key', 'string', null)
- ->setHidden(true)
- ->setDescription(pht('Mailgun API key.')),
- );
-
- }
-
-}
diff --git a/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php b/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php
--- a/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php
+++ b/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php
@@ -208,13 +208,6 @@
'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',
diff --git a/src/applications/config/option/PhabricatorPHPMailerConfigOptions.php b/src/applications/config/option/PhabricatorPHPMailerConfigOptions.php
deleted file mode 100644
--- a/src/applications/config/option/PhabricatorPHPMailerConfigOptions.php
+++ /dev/null
@@ -1,72 +0,0 @@
-<?php
-
-final class PhabricatorPHPMailerConfigOptions
- extends PhabricatorApplicationConfigOptions {
-
- public function getName() {
- return pht('PHPMailer');
- }
-
- public function getDescription() {
- return pht('Configure PHPMailer.');
- }
-
- public function getIcon() {
- return 'fa-send-o';
- }
-
- public function getGroup() {
- return 'core';
- }
-
- public function getOptions() {
- return array(
- $this->newOption('phpmailer.mailer', 'string', 'smtp')
- ->setLocked(true)
- ->setSummary(pht('Configure mailer used by PHPMailer.'))
- ->setDescription(
- pht(
- "If you're using PHPMailer to send email, provide the mailer and ".
- "options here. PHPMailer is much more enormous than ".
- "PHPMailerLite, and provides more mailers and greater enormity. ".
- "You need it when you want to use SMTP instead of sendmail as the ".
- "mailer.")),
- $this->newOption('phpmailer.smtp-host', 'string', null)
- ->setLocked(true)
- ->setDescription(pht('Host for SMTP.')),
- $this->newOption('phpmailer.smtp-port', 'int', 25)
- ->setLocked(true)
- ->setDescription(pht('Port for SMTP.')),
- // TODO: Implement "enum"? Valid values are empty, 'tls', or 'ssl'.
- $this->newOption('phpmailer.smtp-protocol', 'string', null)
- ->setLocked(true)
- ->setSummary(pht('Configure TLS or SSL for SMTP.'))
- ->setDescription(
- pht(
- "Using PHPMailer with SMTP, you can set this to one of '%s' or ".
- "'%s' to use TLS or SSL, respectively. Leave it blank for ".
- "vanilla SMTP. If you're sending via Gmail, set it to '%s'.",
- 'tls',
- 'ssl',
- 'ssl')),
- $this->newOption('phpmailer.smtp-user', 'string', null)
- ->setLocked(true)
- ->setDescription(pht('Username for SMTP.')),
- $this->newOption('phpmailer.smtp-password', 'string', null)
- ->setHidden(true)
- ->setDescription(pht('Password for SMTP.')),
- $this->newOption('phpmailer.smtp-encoding', 'string', 'base64')
- ->setSummary(pht('Configure how mail is encoded.'))
- ->setDescription(
- pht(
- "Mail is normally encoded in `8bit`, which works correctly with ".
- "most MTAs. However, some MTAs do not work well with this ".
- "encoding. If you're having trouble with mail being mangled or ".
- "arriving with too many or too few newlines, you may try ".
- "adjusting this setting.\n\n".
- "Supported values are `8bit`, `quoted-printable`, ".
- "`7bit`, `binary` and `base64`.")),
- );
- }
-
-}
diff --git a/src/applications/config/option/PhabricatorSendGridConfigOptions.php b/src/applications/config/option/PhabricatorSendGridConfigOptions.php
deleted file mode 100644
--- a/src/applications/config/option/PhabricatorSendGridConfigOptions.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-final class PhabricatorSendGridConfigOptions
- extends PhabricatorApplicationConfigOptions {
-
- public function getName() {
- return pht('Integration with SendGrid');
- }
-
- public function getDescription() {
- return pht('Configure SendGrid integration.');
- }
-
- public function getIcon() {
- return 'fa-send-o';
- }
-
- public function getGroup() {
- return 'core';
- }
-
- public function getOptions() {
- return array(
- $this->newOption('sendgrid.api-user', 'string', null)
- ->setLocked(true)
- ->setDescription(pht('SendGrid API username.')),
- $this->newOption('sendgrid.api-key', 'string', null)
- ->setHidden(true)
- ->setDescription(pht('SendGrid API key.')),
- );
- }
-
-}
diff --git a/src/applications/metamta/adapter/PhabricatorMailImplementationAdapter.php b/src/applications/metamta/adapter/PhabricatorMailImplementationAdapter.php
--- a/src/applications/metamta/adapter/PhabricatorMailImplementationAdapter.php
+++ b/src/applications/metamta/adapter/PhabricatorMailImplementationAdapter.php
@@ -109,7 +109,6 @@
abstract protected function validateOptions(array $options);
abstract public function newDefaultOptions();
- abstract public function newLegacyOptions();
public function prepareForSend() {
return;
diff --git a/src/applications/metamta/adapter/PhabricatorMailImplementationAmazonSESAdapter.php b/src/applications/metamta/adapter/PhabricatorMailImplementationAmazonSESAdapter.php
--- a/src/applications/metamta/adapter/PhabricatorMailImplementationAmazonSESAdapter.php
+++ b/src/applications/metamta/adapter/PhabricatorMailImplementationAmazonSESAdapter.php
@@ -39,15 +39,6 @@
);
}
- public function newLegacyOptions() {
- return array(
- 'access-key' => PhabricatorEnv::getEnvConfig('amazon-ses.access-key'),
- 'secret-key' => PhabricatorEnv::getEnvConfig('amazon-ses.secret-key'),
- 'endpoint' => PhabricatorEnv::getEnvConfig('amazon-ses.endpoint'),
- 'encoding' => PhabricatorEnv::getEnvConfig('phpmailer.smtp-encoding'),
- );
- }
-
/**
* @phutil-external-symbol class SimpleEmailService
*/
diff --git a/src/applications/metamta/adapter/PhabricatorMailImplementationMailgunAdapter.php b/src/applications/metamta/adapter/PhabricatorMailImplementationMailgunAdapter.php
--- a/src/applications/metamta/adapter/PhabricatorMailImplementationMailgunAdapter.php
+++ b/src/applications/metamta/adapter/PhabricatorMailImplementationMailgunAdapter.php
@@ -89,13 +89,6 @@
);
}
- public function newLegacyOptions() {
- return array(
- 'api-key' => PhabricatorEnv::getEnvConfig('mailgun.api-key'),
- 'domain' => PhabricatorEnv::getEnvConfig('mailgun.domain'),
- );
- }
-
public function send() {
$key = $this->getOption('api-key');
$domain = $this->getOption('domain');
diff --git a/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerAdapter.php b/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerAdapter.php
--- a/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerAdapter.php
+++ b/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerAdapter.php
@@ -33,18 +33,6 @@
);
}
- public function newLegacyOptions() {
- return array(
- 'host' => PhabricatorEnv::getEnvConfig('phpmailer.smtp-host'),
- 'port' => PhabricatorEnv::getEnvConfig('phpmailer.smtp-port'),
- 'user' => PhabricatorEnv::getEnvConfig('phpmailer.smtp-user'),
- 'password' => PhabricatorEnv::getEnvConfig('phpmailer.smtp-password'),
- 'protocol' => PhabricatorEnv::getEnvConfig('phpmailer.smtp-protocol'),
- 'encoding' => PhabricatorEnv::getEnvConfig('phpmailer.smtp-encoding'),
- 'mailer' => PhabricatorEnv::getEnvConfig('phpmailer.mailer'),
- );
- }
-
/**
* @phutil-external-symbol class PHPMailer
*/
diff --git a/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerLiteAdapter.php b/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerLiteAdapter.php
--- a/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerLiteAdapter.php
+++ b/src/applications/metamta/adapter/PhabricatorMailImplementationPHPMailerLiteAdapter.php
@@ -24,12 +24,6 @@
);
}
- public function newLegacyOptions() {
- return array(
- 'encoding' => PhabricatorEnv::getEnvConfig('phpmailer.smtp-encoding'),
- );
- }
-
/**
* @phutil-external-symbol class PHPMailerLite
*/
diff --git a/src/applications/metamta/adapter/PhabricatorMailImplementationPostmarkAdapter.php b/src/applications/metamta/adapter/PhabricatorMailImplementationPostmarkAdapter.php
--- a/src/applications/metamta/adapter/PhabricatorMailImplementationPostmarkAdapter.php
+++ b/src/applications/metamta/adapter/PhabricatorMailImplementationPostmarkAdapter.php
@@ -94,10 +94,6 @@
);
}
- public function newLegacyOptions() {
- return array();
- }
-
public function send() {
$access_token = $this->getOption('access-token');
diff --git a/src/applications/metamta/adapter/PhabricatorMailImplementationSendGridAdapter.php b/src/applications/metamta/adapter/PhabricatorMailImplementationSendGridAdapter.php
--- a/src/applications/metamta/adapter/PhabricatorMailImplementationSendGridAdapter.php
+++ b/src/applications/metamta/adapter/PhabricatorMailImplementationSendGridAdapter.php
@@ -26,13 +26,6 @@
);
}
- public function newLegacyOptions() {
- return array(
- 'api-user' => PhabricatorEnv::getEnvConfig('sendgrid.api-user'),
- 'api-key' => PhabricatorEnv::getEnvConfig('sendgrid.api-key'),
- );
- }
-
public function setFrom($email, $name = '') {
$this->params['from'] = $email;
$this->params['from-name'] = $name;
@@ -97,18 +90,9 @@
}
public function send() {
-
$user = $this->getOption('api-user');
$key = $this->getOption('api-key');
- if (!$user || !$key) {
- throw new Exception(
- pht(
- "Configure '%s' and '%s' to use SendGrid for mail delivery.",
- 'sendgrid.api-user',
- 'sendgrid.api-key'));
- }
-
$params = array();
$ii = 0;
diff --git a/src/applications/metamta/adapter/PhabricatorMailImplementationTestAdapter.php b/src/applications/metamta/adapter/PhabricatorMailImplementationTestAdapter.php
--- a/src/applications/metamta/adapter/PhabricatorMailImplementationTestAdapter.php
+++ b/src/applications/metamta/adapter/PhabricatorMailImplementationTestAdapter.php
@@ -22,10 +22,6 @@
return array();
}
- public function newLegacyOptions() {
- return array();
- }
-
public function prepareForSend(array $config = array()) {
$this->config = $config;
}
diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php
--- a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php
+++ b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php
@@ -520,53 +520,38 @@
$mailers = array();
$config = PhabricatorEnv::getEnvConfig('cluster.mailers');
- if ($config === null) {
- $mailer = PhabricatorEnv::newObjectFromConfig('metamta.mail-adapter');
- $defaults = $mailer->newDefaultOptions();
- $options = $mailer->newLegacyOptions();
-
- $options = $options + $defaults;
-
- $mailer
- ->setKey('default')
- ->setPriority(-1)
- ->setOptions($options);
-
- $mailers[] = $mailer;
- } else {
- $adapters = PhabricatorMailImplementationAdapter::getAllAdapters();
- $next_priority = -1;
+ $adapters = PhabricatorMailImplementationAdapter::getAllAdapters();
+ $next_priority = -1;
- foreach ($config as $spec) {
- $type = $spec['type'];
- if (!isset($adapters[$type])) {
- throw new Exception(
- pht(
- 'Unknown mailer ("%s")!',
- $type));
- }
+ foreach ($config as $spec) {
+ $type = $spec['type'];
+ if (!isset($adapters[$type])) {
+ throw new Exception(
+ pht(
+ 'Unknown mailer ("%s")!',
+ $type));
+ }
- $key = $spec['key'];
- $mailer = id(clone $adapters[$type])
- ->setKey($key);
+ $key = $spec['key'];
+ $mailer = id(clone $adapters[$type])
+ ->setKey($key);
- $priority = idx($spec, 'priority');
- if (!$priority) {
- $priority = $next_priority;
- $next_priority--;
- }
- $mailer->setPriority($priority);
+ $priority = idx($spec, 'priority');
+ if (!$priority) {
+ $priority = $next_priority;
+ $next_priority--;
+ }
+ $mailer->setPriority($priority);
- $defaults = $mailer->newDefaultOptions();
- $options = idx($spec, 'options', array()) + $defaults;
- $mailer->setOptions($options);
+ $defaults = $mailer->newDefaultOptions();
+ $options = idx($spec, 'options', array()) + $defaults;
+ $mailer->setOptions($options);
- $mailer->setSupportsInbound(idx($spec, 'inbound', true));
- $mailer->setSupportsOutbound(idx($spec, 'outbound', true));
+ $mailer->setSupportsInbound(idx($spec, 'inbound', true));
+ $mailer->setSupportsOutbound(idx($spec, 'outbound', true));
- $mailers[] = $mailer;
- }
+ $mailers[] = $mailer;
}
// Remove mailers with the wrong types.
diff --git a/src/docs/user/configuration/configuration_locked.diviner b/src/docs/user/configuration/configuration_locked.diviner
--- a/src/docs/user/configuration/configuration_locked.diviner
+++ b/src/docs/user/configuration/configuration_locked.diviner
@@ -82,7 +82,7 @@
attacker who has gained access to an administrator account in order to gain
greater access.
-For example, an attacker who could modify `metamta.mail-adapter` (and other
+For example, an attacker who could modify `cluster.mailers` (and other
similar options), could potentially reconfigure Phabricator to send mail
through an evil server they controlled, then trigger password resets on other
user accounts to compromise them.
diff --git a/src/docs/user/configuration/configuring_inbound_email.diviner b/src/docs/user/configuration/configuring_inbound_email.diviner
--- a/src/docs/user/configuration/configuring_inbound_email.diviner
+++ b/src/docs/user/configuration/configuring_inbound_email.diviner
@@ -129,7 +129,7 @@
- Add a Mailgun route with a `catch_all()` rule which takes the action
`forward("https://phabricator.example.com/mail/mailgun/")`. Replace the
example domain with your actual domain.
- - Set the `mailgun.api-key` config key to your Mailgun API key.
+ - Configure a mailer in `cluster.mailers` with your Mailgun API key.
Postmark Setup
==============
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 30, 8:56 AM (2 w, 13 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7726877
Default Alt Text
D19940.id47603.diff (27 KB)
Attached To
Mode
D19940: Remove all legacy configuration options for mailers
Attached
Detach File
Event Timeline
Log In to Comment