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 @@ -1938,7 +1938,6 @@ 'PhabricatorMacroApplication' => 'applications/macro/application/PhabricatorMacroApplication.php', 'PhabricatorMacroAudioController' => 'applications/macro/controller/PhabricatorMacroAudioController.php', 'PhabricatorMacroCommentController' => 'applications/macro/controller/PhabricatorMacroCommentController.php', - 'PhabricatorMacroConfigOptions' => 'applications/macro/config/PhabricatorMacroConfigOptions.php', 'PhabricatorMacroController' => 'applications/macro/controller/PhabricatorMacroController.php', 'PhabricatorMacroDatasource' => 'applications/macro/typeahead/PhabricatorMacroDatasource.php', 'PhabricatorMacroDisableController' => 'applications/macro/controller/PhabricatorMacroDisableController.php', @@ -5263,7 +5262,6 @@ 'PhabricatorMacroApplication' => 'PhabricatorApplication', 'PhabricatorMacroAudioController' => 'PhabricatorMacroController', 'PhabricatorMacroCommentController' => 'PhabricatorMacroController', - 'PhabricatorMacroConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorMacroController' => 'PhabricatorController', 'PhabricatorMacroDatasource' => 'PhabricatorTypeaheadDatasource', 'PhabricatorMacroDisableController' => 'PhabricatorMacroController', diff --git a/src/applications/audit/mail/PhabricatorAuditReplyHandler.php b/src/applications/audit/mail/PhabricatorAuditReplyHandler.php --- a/src/applications/audit/mail/PhabricatorAuditReplyHandler.php +++ b/src/applications/audit/mail/PhabricatorAuditReplyHandler.php @@ -17,11 +17,6 @@ return $this->getDefaultPublicReplyHandlerEmailAddress('C'); } - public function getReplyHandlerDomain() { - return $this->getCustomReplyHandlerDomainIfExists( - 'metamta.diffusion.reply-handler-domain'); - } - protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { $commit = $this->getMailReceiver(); $actor = $this->getActor(); 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 @@ -159,6 +159,11 @@ 'option "%s". Use that option to configure which fields are shown.', 'differential.fields'); + $reply_domain_reason = pht( + 'Individual application reply handler domains have been removed. '. + 'Configure a reply domain with "%s".', + 'metamta.reply-handler-domain'); + $ancient_config += array( 'phid.external-loaders' => pht( @@ -222,6 +227,12 @@ '`security.outbound-blacklist`.'), 'metamta.reply.show-hints' => pht( 'Phabricator no longer shows reply hints in mail.'), + + 'metamta.differential.reply-handler-domain' => $reply_domain_reason, + 'metamta.diffusion.reply-handler-domain' => $reply_domain_reason, + 'metamta.macro.reply-handler-domain' => $reply_domain_reason, + 'metamta.maniphest.reply-handler-domain' => $reply_domain_reason, + 'metamta.pholio.reply-handler-domain' => $reply_domain_reason, ); return $ancient_config; 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 @@ -245,9 +245,7 @@ 'string', null) ->setLocked(true) - ->setDescription(pht( - 'Domain used for reply email addresses. Some applications can '. - 'override this configuration with a different domain.')) + ->setDescription(pht('Domain used for reply email addresses.')) ->addExample('phabricator.example.com', ''), $this->newOption('metamta.herald.show-hints', 'bool', true) ->setBoolOptions( diff --git a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php --- a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php +++ b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php @@ -245,13 +245,6 @@ "Similar to `differential.days-fresh` but marks stale revisions. ". "If the revision is even older than it is when marked as 'old'.")), $this->newOption( - 'metamta.differential.reply-handler-domain', - 'string', - null) - ->setLocked(true) - ->setDescription( - pht('Inbound email domain for Differential replies.')), - $this->newOption( 'metamta.differential.reply-handler', 'class', 'DifferentialReplyHandler') diff --git a/src/applications/differential/mail/DifferentialReplyHandler.php b/src/applications/differential/mail/DifferentialReplyHandler.php --- a/src/applications/differential/mail/DifferentialReplyHandler.php +++ b/src/applications/differential/mail/DifferentialReplyHandler.php @@ -17,11 +17,6 @@ return $this->getDefaultPublicReplyHandlerEmailAddress('D'); } - public function getReplyHandlerDomain() { - return $this->getCustomReplyHandlerDomainIfExists( - 'metamta.differential.reply-handler-domain'); - } - public function getSupportedCommands() { $actions = array( DifferentialAction::ACTION_COMMENT, diff --git a/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php b/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php --- a/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php +++ b/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php @@ -27,15 +27,6 @@ '[Diffusion]') ->setDescription(pht('Subject prefix for Diffusion mail.')), $this->newOption( - 'metamta.diffusion.reply-handler-domain', - 'string', - null) - ->setLocked(true) - ->setDescription( - pht( - 'See {{metamta.maniphest.reply-handler}}. This does the same '. - 'thing, but affects Diffusion.')), - $this->newOption( 'metamta.diffusion.reply-handler', 'class', 'PhabricatorAuditReplyHandler') diff --git a/src/applications/macro/config/PhabricatorMacroConfigOptions.php b/src/applications/macro/config/PhabricatorMacroConfigOptions.php deleted file mode 100644 --- a/src/applications/macro/config/PhabricatorMacroConfigOptions.php +++ /dev/null @@ -1,33 +0,0 @@ -newOption('metamta.macro.reply-handler-domain', 'string', null) - ->setLocked(true) - ->setDescription(pht( - 'As {{metamta.maniphest.reply-handler-domain}}, but affects Macro.')), - $this->newOption('metamta.macro.subject-prefix', 'string', '[Macro]') - ->setDescription(pht('Subject prefix for Macro email.')), - ); - } - -} diff --git a/src/applications/macro/mail/PhabricatorMacroReplyHandler.php b/src/applications/macro/mail/PhabricatorMacroReplyHandler.php --- a/src/applications/macro/mail/PhabricatorMacroReplyHandler.php +++ b/src/applications/macro/mail/PhabricatorMacroReplyHandler.php @@ -17,11 +17,6 @@ return $this->getDefaultPublicReplyHandlerEmailAddress('MCRO'); } - public function getReplyHandlerDomain() { - return $this->getCustomReplyHandlerDomainIfExists( - 'metamta.macro.reply-handler-domain'); - } - protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { // TODO: Implement this. return null; diff --git a/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php b/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php --- a/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php +++ b/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php @@ -273,27 +273,6 @@ '{{maniphest.priorities}} configuration option. The default value '. '(`90`) corresponds to the default "Needs Triage" priority.')), $this->newOption( - 'metamta.maniphest.reply-handler-domain', - 'string', - null) - ->setLocked(true) - ->setSummary(pht('Enable replying to tasks via email.')) - ->setDescription( - pht( - 'You can configure a reply handler domain so that email sent from '. - 'Maniphest will have a special "Reply To" address like '. - '"T123+82+af19f@example.com" that allows recipients to reply by '. - 'email and interact with tasks. For instructions on configurating '. - 'reply handlers, see the article "Configuring Inbound Email" in '. - 'the Phabricator documentation. By default, this is set to `null` '. - 'and Phabricator will use a generic `noreply@` address or the '. - 'address of the acting user instead of a special reply handler '. - 'address (see `metamta.default-address`). If you set a domain '. - 'here, Phabricator will begin generating private reply handler '. - 'addresses. See also `metamta.maniphest.reply-handler` to further '. - 'configure behavior. This key should be set to the domain part '. - 'after the @, like "example.com".')), - $this->newOption( 'metamta.maniphest.reply-handler', 'class', 'ManiphestReplyHandler') diff --git a/src/applications/maniphest/mail/ManiphestReplyHandler.php b/src/applications/maniphest/mail/ManiphestReplyHandler.php --- a/src/applications/maniphest/mail/ManiphestReplyHandler.php +++ b/src/applications/maniphest/mail/ManiphestReplyHandler.php @@ -17,11 +17,6 @@ return $this->getDefaultPublicReplyHandlerEmailAddress('T'); } - public function getReplyHandlerDomain() { - return $this->getCustomReplyHandlerDomainIfExists( - 'metamta.maniphest.reply-handler-domain'); - } - protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { // NOTE: We'll drop in here on both the "reply to a task" and "create a // new task" workflows! Make sure you test both if you make changes! diff --git a/src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php b/src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php --- a/src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php +++ b/src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php @@ -48,19 +48,9 @@ abstract public function validateMailReceiver($mail_receiver); abstract public function getPrivateReplyHandlerEmailAddress( PhabricatorObjectHandle $handle); + public function getReplyHandlerDomain() { - return $this->getDefaultReplyHandlerDomain(); - } - protected function getCustomReplyHandlerDomainIfExists($config_key) { - $domain = PhabricatorEnv::getEnvConfig($config_key); - if ($domain) { - return $domain; - } - return $this->getDefaultReplyHandlerDomain(); - } - private function getDefaultReplyHandlerDomain() { - return PhabricatorEnv::getEnvConfig( - 'metamta.reply-handler-domain'); + return PhabricatorEnv::getEnvConfig('metamta.reply-handler-domain'); } abstract protected function receiveEmail( @@ -110,9 +100,11 @@ if (!PhabricatorEnv::getEnvConfig('metamta.public-replies')) { return false; } + if (!$this->getReplyHandlerDomain()) { return false; } + return (bool)$this->getPublicReplyHandlerEmailAddress(); } diff --git a/src/applications/owners/mail/OwnersPackageReplyHandler.php b/src/applications/owners/mail/OwnersPackageReplyHandler.php --- a/src/applications/owners/mail/OwnersPackageReplyHandler.php +++ b/src/applications/owners/mail/OwnersPackageReplyHandler.php @@ -16,10 +16,6 @@ return null; } - public function getReplyHandlerDomain() { - return null; - } - protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { return; } diff --git a/src/applications/pholio/config/PhabricatorPholioConfigOptions.php b/src/applications/pholio/config/PhabricatorPholioConfigOptions.php --- a/src/applications/pholio/config/PhabricatorPholioConfigOptions.php +++ b/src/applications/pholio/config/PhabricatorPholioConfigOptions.php @@ -21,12 +21,6 @@ public function getOptions() { return array( - $this->newOption('metamta.pholio.reply-handler-domain', 'string', null) - ->setLocked(true) - ->setDescription( - pht( - 'Like {{metamta.maniphest.reply-handler-domain}}, but affects '. - 'Pholio.')), $this->newOption('metamta.pholio.subject-prefix', 'string', '[Pholio]') ->setDescription(pht('Subject prefix for Pholio email.')), ); diff --git a/src/applications/pholio/mail/PholioReplyHandler.php b/src/applications/pholio/mail/PholioReplyHandler.php --- a/src/applications/pholio/mail/PholioReplyHandler.php +++ b/src/applications/pholio/mail/PholioReplyHandler.php @@ -17,11 +17,6 @@ return $this->getDefaultPublicReplyHandlerEmailAddress('M'); } - public function getReplyHandlerDomain() { - return $this->getCustomReplyHandlerDomainIfExists( - 'metamta.pholio.reply-handler-domain'); - } - protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { // TODO: Implement this. return null; diff --git a/src/applications/repository/mail/PhabricatorRepositoryPushReplyHandler.php b/src/applications/repository/mail/PhabricatorRepositoryPushReplyHandler.php --- a/src/applications/repository/mail/PhabricatorRepositoryPushReplyHandler.php +++ b/src/applications/repository/mail/PhabricatorRepositoryPushReplyHandler.php @@ -12,10 +12,6 @@ return null; } - public function getReplyHandlerDomain() { - return null; - } - protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { return; } 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 @@ -135,24 +135,21 @@ inbound email. Provided you have such an account, configure it like this: - Configure an MX record according to SendGrid's instructions, i.e. add - ##phabricator.example.com MX 10 mx.sendgrid.net.## or similar. + `phabricator.example.com MX 10 mx.sendgrid.net.` or similar. - Go to the "Parse Incoming Emails" page on SendGrid () and add the domain as the "Hostname". - - Add the URL ##https://phabricator.example.com/mail/sendgrid/## as the "Url", + - Add the URL `https://phabricator.example.com/mail/sendgrid/` as the "Url", using your domain (and HTTP instead of HTTPS if you are not configured with SSL). - If you get an error that the hostname "can't be located or verified", it means your MX record is either incorrectly configured or hasn't propagated yet. - - Set ##metamta.maniphest.reply-handler-domain## and/or - ##metamta.differential.reply-handler-domain## to - "##phabricator.example.com##" (whatever you configured the MX record for), - depending on whether you want to support email replies for Maniphest, - Differential, or both. + - Set `metamta.reply-handler-domain` to `phabricator.example.com`" + (whatever you configured the MX record for). That's it! If everything is working properly you should be able to send email -to ##anything@phabricator.example.com## and it should appear in +to `anything@phabricator.example.com` and it should appear in `bin/mail list-inbound` within a few seconds. = Local MTA: Installing Mailparse = @@ -211,12 +208,12 @@ sudo ln -s /path/to/phabricator/scripts/mail/mail_handler.php /etc/smrsh/ -Finally, edit ##/etc/mail/virtusertable## and add an entry like this: +Finally, edit `/etc/mail/virtusertable` and add an entry like this: @yourdomain.com phabricator@localhost That will forward all mail to @yourdomain.com to the Phabricator processing -script. Run ##sudo /etc/mail/make## or similar and then restart sendmail with +script. Run `sudo /etc/mail/make` or similar and then restart sendmail with `sudo /etc/init.d/sendmail restart`. = Local MTA: Configuring Lamson = @@ -232,7 +229,7 @@ () to set up an instance. One likely deployment issue is that binding to port 25 requires root privileges. Lamson is capable of starting as root then dropping privileges, but -you must supply ##-uid## and ##-gid## arguments to do so, as demonstrated by +you must supply `-uid` and `-gid` arguments to do so, as demonstrated by Step 8 in Lamson's deployment tutorial (located here: ).