diff --git a/scripts/install/install_ubuntu.sh b/scripts/install/install_ubuntu.sh index 69463c8039..105e9c2581 100755 --- a/scripts/install/install_ubuntu.sh +++ b/scripts/install/install_ubuntu.sh @@ -37,7 +37,7 @@ echo set +x sudo apt-get -qq update -sudo apt-get install git mysql-server apache2 php5 php5-mysql php5-gd php5-dev php-apc dpkg-dev +sudo apt-get install git mysql-server apache2 php5 php5-mysql php5-gd php5-dev php5-curl php-apc dpkg-dev HAVEPCNTL=`php -r "echo extension_loaded('pcntl');"` if [ $HAVEPCNTL != "1" ] diff --git a/src/applications/metamta/controller/send/PhabricatorMetaMTASendController.php b/src/applications/metamta/controller/send/PhabricatorMetaMTASendController.php index ee86d9e649..8b971b878f 100644 --- a/src/applications/metamta/controller/send/PhabricatorMetaMTASendController.php +++ b/src/applications/metamta/controller/send/PhabricatorMetaMTASendController.php @@ -45,14 +45,44 @@ class PhabricatorMetaMTASendController extends PhabricatorMetaMTAController { "Enter a number to simulate that many consecutive send failures before ". "really attempting to deliver via the underlying MTA."; + $doclink_href = PhabricatorEnv::getDoclink( + 'article/Configuring_Outbound_Email.html'); + + $doclink = phutil_render_tag( + 'a', + array( + 'href' => $doclink_href, + 'target' => '_blank', + ), + 'Configuring Outbound Email'); + $instructions = + '
This form will send a normal '. + 'email using the settings you have configured for Phabricator. For more '. + 'information, see '.$doclink.'.
'; + + $adapter = PhabricatorEnv::getEnvConfig('metamta.mail-adapter'); + $warning = null; + if ($adapter == 'PhabricatorMailImplementationTestAdapter') { + $warning = new AphrontErrorView(); + $warning->setTitle('Email is Disabled'); + $warning->setSeverity(AphrontErrorView::SEVERITY_WARNING); + $warning->appendChild( + 'This installation of Phabricator is currently set to use '. + 'PhabricatorMailImplementationTestAdapter to deliver '. + 'outbound email. This completely disables outbound email! All '. + 'outbound email will be thrown in a deep, dark hole until you '. + 'configure a real adapter.
'); + } $form = new AphrontFormView(); $form->setUser($request->getUser()); $form->setAction('/mail/send/'); $form + ->appendChild($instructions) ->appendChild( - 'This form will send a normal '. - 'email using MetaMTA as a transport mechanism.
') + id(new AphrontFormStaticControl()) + ->setLabel('Configured Adapter') + ->setValue($adapter)) ->appendChild( id(new AphrontFormTokenizerControl()) ->setLabel('To') @@ -97,7 +127,10 @@ class PhabricatorMetaMTASendController extends PhabricatorMetaMTAController { $panel->setWidth(AphrontPanelView::WIDTH_WIDE); return $this->buildStandardPageResponse( - $panel, + array( + $warning, + $panel, + ), array( 'title' => 'Send Mail', )); diff --git a/src/applications/metamta/controller/send/__init__.php b/src/applications/metamta/controller/send/__init__.php index a30c192610..d71faf02c8 100644 --- a/src/applications/metamta/controller/send/__init__.php +++ b/src/applications/metamta/controller/send/__init__.php @@ -9,14 +9,18 @@ phutil_require_module('phabricator', 'aphront/response/redirect'); phutil_require_module('phabricator', 'applications/metamta/controller/base'); phutil_require_module('phabricator', 'applications/metamta/storage/mail'); +phutil_require_module('phabricator', 'infrastructure/env'); phutil_require_module('phabricator', 'view/form/base'); phutil_require_module('phabricator', 'view/form/control/checkbox'); +phutil_require_module('phabricator', 'view/form/control/static'); phutil_require_module('phabricator', 'view/form/control/submit'); phutil_require_module('phabricator', 'view/form/control/text'); phutil_require_module('phabricator', 'view/form/control/textarea'); phutil_require_module('phabricator', 'view/form/control/tokenizer'); +phutil_require_module('phabricator', 'view/form/error'); phutil_require_module('phabricator', 'view/layout/panel'); +phutil_require_module('phutil', 'markup'); phutil_require_module('phutil', 'utils'); diff --git a/src/infrastructure/setup/PhabricatorSetup.php b/src/infrastructure/setup/PhabricatorSetup.php index d6185c2e7e..023de19800 100644 --- a/src/infrastructure/setup/PhabricatorSetup.php +++ b/src/infrastructure/setup/PhabricatorSetup.php @@ -37,6 +37,11 @@ class PhabricatorSetup { 'hash', 'json', 'openssl', + + // There is a chance we might not need this, but some configurations (like + // Amazon SES) will require it. Just mark it 'required' since it's widely + // available and relatively core. + 'curl', ); foreach ($extensions as $extension) { $ok = self::requireExtension($extension);