diff --git a/src/applications/audit/mail/PhabricatorAuditReplyHandler.php b/src/applications/audit/mail/PhabricatorAuditReplyHandler.php index 7214943f76..1b51feaee0 100644 --- a/src/applications/audit/mail/PhabricatorAuditReplyHandler.php +++ b/src/applications/audit/mail/PhabricatorAuditReplyHandler.php @@ -17,11 +17,6 @@ final class PhabricatorAuditReplyHandler extends PhabricatorMailReplyHandler { 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 index 550574a199..df60dab08d 100644 --- a/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php +++ b/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php @@ -159,6 +159,11 @@ final class PhabricatorExtraConfigSetupCheck extends PhabricatorSetupCheck { '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 @@ final class PhabricatorExtraConfigSetupCheck extends PhabricatorSetupCheck { '`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 index 7c0b990992..1bc8d21bdb 100644 --- a/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php +++ b/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php @@ -245,9 +245,7 @@ EODOC '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 index 72596bf71a..08492aa644 100644 --- a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php +++ b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php @@ -244,13 +244,6 @@ final class PhabricatorDifferentialConfigOptions pht( "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', diff --git a/src/applications/differential/mail/DifferentialReplyHandler.php b/src/applications/differential/mail/DifferentialReplyHandler.php index 05a92cd4ff..c9bca29d2f 100644 --- a/src/applications/differential/mail/DifferentialReplyHandler.php +++ b/src/applications/differential/mail/DifferentialReplyHandler.php @@ -17,11 +17,6 @@ final class DifferentialReplyHandler extends PhabricatorMailReplyHandler { 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 index 8bf13db16e..f6dfb92762 100644 --- a/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php +++ b/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php @@ -26,15 +26,6 @@ final class PhabricatorDiffusionConfigOptions 'string', '[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', diff --git a/src/applications/macro/config/PhabricatorMacroConfigOptions.php b/src/applications/macro/config/PhabricatorMacroConfigOptions.php index 95f322d96d..2ab913a733 100644 --- a/src/applications/macro/config/PhabricatorMacroConfigOptions.php +++ b/src/applications/macro/config/PhabricatorMacroConfigOptions.php @@ -21,10 +21,6 @@ final class PhabricatorMacroConfigOptions public function getOptions() { return array( - $this->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 index 1b70b8872a..380b3cb3d0 100644 --- a/src/applications/macro/mail/PhabricatorMacroReplyHandler.php +++ b/src/applications/macro/mail/PhabricatorMacroReplyHandler.php @@ -17,11 +17,6 @@ final class PhabricatorMacroReplyHandler extends PhabricatorMailReplyHandler { 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 index a77f4ef089..cef998fb66 100644 --- a/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php +++ b/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php @@ -272,27 +272,6 @@ EOTEXT 'review and adjust available priorities by using the '. '{{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', diff --git a/src/applications/maniphest/mail/ManiphestReplyHandler.php b/src/applications/maniphest/mail/ManiphestReplyHandler.php index e4bfc5c319..78f9dae251 100644 --- a/src/applications/maniphest/mail/ManiphestReplyHandler.php +++ b/src/applications/maniphest/mail/ManiphestReplyHandler.php @@ -17,11 +17,6 @@ final class ManiphestReplyHandler extends PhabricatorMailReplyHandler { 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 index d3518fe65c..bc31707f53 100644 --- a/src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php +++ b/src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php @@ -48,19 +48,9 @@ abstract class PhabricatorMailReplyHandler { 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 @@ abstract class PhabricatorMailReplyHandler { 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 index 3eb8a8a3c4..b0f397249e 100644 --- a/src/applications/owners/mail/OwnersPackageReplyHandler.php +++ b/src/applications/owners/mail/OwnersPackageReplyHandler.php @@ -16,10 +16,6 @@ final class OwnersPackageReplyHandler extends PhabricatorMailReplyHandler { 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 index 4fe6255769..db079a4b2b 100644 --- a/src/applications/pholio/config/PhabricatorPholioConfigOptions.php +++ b/src/applications/pholio/config/PhabricatorPholioConfigOptions.php @@ -21,12 +21,6 @@ final class PhabricatorPholioConfigOptions 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 index 0e8249f78d..0c842d8285 100644 --- a/src/applications/pholio/mail/PholioReplyHandler.php +++ b/src/applications/pholio/mail/PholioReplyHandler.php @@ -17,11 +17,6 @@ final class PholioReplyHandler extends PhabricatorMailReplyHandler { 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 index d902396d56..d418fa3445 100644 --- a/src/applications/repository/mail/PhabricatorRepositoryPushReplyHandler.php +++ b/src/applications/repository/mail/PhabricatorRepositoryPushReplyHandler.php @@ -12,10 +12,6 @@ final class PhabricatorRepositoryPushReplyHandler 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 index 5b823741c4..7d57f01e3a 100644 --- a/src/docs/user/configuration/configuring_inbound_email.diviner +++ b/src/docs/user/configuration/configuring_inbound_email.diviner @@ -135,24 +135,21 @@ To use SendGrid, you need a SendGrid account with access to the "Parse API" for 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 @@ this script into `/etc/smrsh/`: 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 get started, follow the provided instructions () 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: ).