Changeset View
Changeset View
Standalone View
Standalone View
src/applications/config/check/PhabricatorSetupCheckMail.php
| Show All 35 Lines | switch ($adapter) { | ||||
| if (!PhabricatorEnv::getEnvConfig('amazon-ses.access-key')) { | if (!PhabricatorEnv::getEnvConfig('amazon-ses.access-key')) { | ||||
| $message = pht( | $message = pht( | ||||
| 'Amazon SES is selected as the mail adapter, but no SES access '. | 'Amazon SES is selected as the mail adapter, but no SES access '. | ||||
| 'key is configured. Provide an SES access key, or choose a '. | 'key is configured. Provide an SES access key, or choose a '. | ||||
| 'different mail adapter.'); | 'different mail adapter.'); | ||||
| $this->newIssue('config.amazon-ses.access-key') | $this->newIssue('config.amazon-ses.access-key') | ||||
| ->setName(pht("Amazon SES Access Key Not Set")) | ->setName(pht('Amazon SES Access Key Not Set')) | ||||
| ->setMessage($message) | ->setMessage($message) | ||||
| ->addRelatedPhabricatorConfig('metamta.mail-adapter') | ->addRelatedPhabricatorConfig('metamta.mail-adapter') | ||||
| ->addPhabricatorConfig('amazon-ses.access-key'); | ->addPhabricatorConfig('amazon-ses.access-key'); | ||||
| } | } | ||||
| if (!PhabricatorEnv::getEnvConfig('amazon-ses.secret-key')) { | if (!PhabricatorEnv::getEnvConfig('amazon-ses.secret-key')) { | ||||
| $message = pht( | $message = pht( | ||||
| 'Amazon SES is selected as the mail adapter, but no SES secret '. | 'Amazon SES is selected as the mail adapter, but no SES secret '. | ||||
| 'key is configured. Provide an SES secret key, or choose a '. | 'key is configured. Provide an SES secret key, or choose a '. | ||||
| 'different mail adapter.'); | 'different mail adapter.'); | ||||
| $this->newIssue('config.amazon-ses.secret-key') | $this->newIssue('config.amazon-ses.secret-key') | ||||
| ->setName(pht("Amazon SES Secret Key Not Set")) | ->setName(pht('Amazon SES Secret Key Not Set')) | ||||
| ->setMessage($message) | ->setMessage($message) | ||||
| ->addRelatedPhabricatorConfig('metamta.mail-adapter') | ->addRelatedPhabricatorConfig('metamta.mail-adapter') | ||||
| ->addPhabricatorConfig('amazon-ses.secret-key'); | ->addPhabricatorConfig('amazon-ses.secret-key'); | ||||
| } | } | ||||
| $address_key = 'metamta.default-address'; | $address_key = 'metamta.default-address'; | ||||
| $options = PhabricatorApplicationConfigOptions::loadAllOptions(); | $options = PhabricatorApplicationConfigOptions::loadAllOptions(); | ||||
| $default = $options[$address_key]->getDefault(); | $default = $options[$address_key]->getDefault(); | ||||
| $value = PhabricatorEnv::getEnvConfig($address_key); | $value = PhabricatorEnv::getEnvConfig($address_key); | ||||
| if ($default === $value) { | if ($default === $value) { | ||||
| $message = pht( | $message = pht( | ||||
| 'Amazon SES requires verification of the "From" address, but '. | 'Amazon SES requires verification of the "From" address, but '. | ||||
| 'you have not configured a "From" address. Configure and verify '. | 'you have not configured a "From" address. Configure and verify '. | ||||
| 'a "From" address, or choose a different mail adapter.'); | 'a "From" address, or choose a different mail adapter.'); | ||||
| $this->newIssue('config.metamta.default-address') | $this->newIssue('config.metamta.default-address') | ||||
| ->setName(pht("No SES From Address Configured")) | ->setName(pht('No SES From Address Configured')) | ||||
| ->setMessage($message) | ->setMessage($message) | ||||
| ->addRelatedPhabricatorConfig('metamta.mail-adapter') | ->addRelatedPhabricatorConfig('metamta.mail-adapter') | ||||
| ->addPhabricatorConfig('metamta.default-address'); | ->addPhabricatorConfig('metamta.default-address'); | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||