mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 22:10:55 +01:00
Remove all application-specific reply handler domains
Summary: Ref T7199. These were a bad idea which got copy-pasted a bunch. - There is zero reason to ever set these to different things. - Unsurprisingly, I don't know of any install which has them set to different things. Unless I've completely forgotten about it, this option was not motivated by some obscure business need, it was just a bad decision which didn't catch anyone's attention at the time. We partially remedied the mistake at some point by introducing `metamta.reply-handler-domain`, which works as a default for all applications, but never cleaned this mess up. Test Plan: Sent some mail from applications, verified it picked up appropraite reply handler domains. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T7199 Differential Revision: https://secure.phabricator.com/D12231
This commit is contained in:
parent
0d99c84bd7
commit
bad645f1ec
16 changed files with 24 additions and 106 deletions
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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.')),
|
||||
);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -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!
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -16,10 +16,6 @@ final class OwnersPackageReplyHandler extends PhabricatorMailReplyHandler {
|
|||
return null;
|
||||
}
|
||||
|
||||
public function getReplyHandlerDomain() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -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.')),
|
||||
);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -12,10 +12,6 @@ final class PhabricatorRepositoryPushReplyHandler
|
|||
return null;
|
||||
}
|
||||
|
||||
public function getReplyHandlerDomain() {
|
||||
return null;
|
||||
}
|
||||
|
||||
protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
(<http://sendgrid.com/developer/reply>) 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
|
|||
(<http://lamsonproject.org/docs/getting_started.html>) 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:
|
||||
<http://lamsonproject.org/docs/deploying_oneshotblog.html>).
|
||||
|
||||
|
|
Loading…
Reference in a new issue