@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+24 -106
-5
src/applications/audit/mail/PhabricatorAuditReplyHandler.php
··· 17 17 return $this->getDefaultPublicReplyHandlerEmailAddress('C'); 18 18 } 19 19 20 - public function getReplyHandlerDomain() { 21 - return $this->getCustomReplyHandlerDomainIfExists( 22 - 'metamta.diffusion.reply-handler-domain'); 23 - } 24 - 25 20 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 26 21 $commit = $this->getMailReceiver(); 27 22 $actor = $this->getActor();
+11
src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
··· 159 159 'option "%s". Use that option to configure which fields are shown.', 160 160 'differential.fields'); 161 161 162 + $reply_domain_reason = pht( 163 + 'Individual application reply handler domains have been removed. '. 164 + 'Configure a reply domain with "%s".', 165 + 'metamta.reply-handler-domain'); 166 + 162 167 $ancient_config += array( 163 168 'phid.external-loaders' => 164 169 pht( ··· 222 227 '`security.outbound-blacklist`.'), 223 228 'metamta.reply.show-hints' => pht( 224 229 'Phabricator no longer shows reply hints in mail.'), 230 + 231 + 'metamta.differential.reply-handler-domain' => $reply_domain_reason, 232 + 'metamta.diffusion.reply-handler-domain' => $reply_domain_reason, 233 + 'metamta.macro.reply-handler-domain' => $reply_domain_reason, 234 + 'metamta.maniphest.reply-handler-domain' => $reply_domain_reason, 235 + 'metamta.pholio.reply-handler-domain' => $reply_domain_reason, 225 236 ); 226 237 227 238 return $ancient_config;
+1 -3
src/applications/config/option/PhabricatorMetaMTAConfigOptions.php
··· 245 245 'string', 246 246 null) 247 247 ->setLocked(true) 248 - ->setDescription(pht( 249 - 'Domain used for reply email addresses. Some applications can '. 250 - 'override this configuration with a different domain.')) 248 + ->setDescription(pht('Domain used for reply email addresses.')) 251 249 ->addExample('phabricator.example.com', ''), 252 250 $this->newOption('metamta.herald.show-hints', 'bool', true) 253 251 ->setBoolOptions(
-7
src/applications/differential/config/PhabricatorDifferentialConfigOptions.php
··· 245 245 "Similar to `differential.days-fresh` but marks stale revisions. ". 246 246 "If the revision is even older than it is when marked as 'old'.")), 247 247 $this->newOption( 248 - 'metamta.differential.reply-handler-domain', 249 - 'string', 250 - null) 251 - ->setLocked(true) 252 - ->setDescription( 253 - pht('Inbound email domain for Differential replies.')), 254 - $this->newOption( 255 248 'metamta.differential.reply-handler', 256 249 'class', 257 250 'DifferentialReplyHandler')
-5
src/applications/differential/mail/DifferentialReplyHandler.php
··· 17 17 return $this->getDefaultPublicReplyHandlerEmailAddress('D'); 18 18 } 19 19 20 - public function getReplyHandlerDomain() { 21 - return $this->getCustomReplyHandlerDomainIfExists( 22 - 'metamta.differential.reply-handler-domain'); 23 - } 24 - 25 20 public function getSupportedCommands() { 26 21 $actions = array( 27 22 DifferentialAction::ACTION_COMMENT,
-9
src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php
··· 27 27 '[Diffusion]') 28 28 ->setDescription(pht('Subject prefix for Diffusion mail.')), 29 29 $this->newOption( 30 - 'metamta.diffusion.reply-handler-domain', 31 - 'string', 32 - null) 33 - ->setLocked(true) 34 - ->setDescription( 35 - pht( 36 - 'See {{metamta.maniphest.reply-handler}}. This does the same '. 37 - 'thing, but affects Diffusion.')), 38 - $this->newOption( 39 30 'metamta.diffusion.reply-handler', 40 31 'class', 41 32 'PhabricatorAuditReplyHandler')
-4
src/applications/macro/config/PhabricatorMacroConfigOptions.php
··· 21 21 22 22 public function getOptions() { 23 23 return array( 24 - $this->newOption('metamta.macro.reply-handler-domain', 'string', null) 25 - ->setLocked(true) 26 - ->setDescription(pht( 27 - 'As {{metamta.maniphest.reply-handler-domain}}, but affects Macro.')), 28 24 $this->newOption('metamta.macro.subject-prefix', 'string', '[Macro]') 29 25 ->setDescription(pht('Subject prefix for Macro email.')), 30 26 );
-5
src/applications/macro/mail/PhabricatorMacroReplyHandler.php
··· 17 17 return $this->getDefaultPublicReplyHandlerEmailAddress('MCRO'); 18 18 } 19 19 20 - public function getReplyHandlerDomain() { 21 - return $this->getCustomReplyHandlerDomainIfExists( 22 - 'metamta.macro.reply-handler-domain'); 23 - } 24 - 25 20 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 26 21 // TODO: Implement this. 27 22 return null;
-21
src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php
··· 273 273 '{{maniphest.priorities}} configuration option. The default value '. 274 274 '(`90`) corresponds to the default "Needs Triage" priority.')), 275 275 $this->newOption( 276 - 'metamta.maniphest.reply-handler-domain', 277 - 'string', 278 - null) 279 - ->setLocked(true) 280 - ->setSummary(pht('Enable replying to tasks via email.')) 281 - ->setDescription( 282 - pht( 283 - 'You can configure a reply handler domain so that email sent from '. 284 - 'Maniphest will have a special "Reply To" address like '. 285 - '"T123+82+af19f@example.com" that allows recipients to reply by '. 286 - 'email and interact with tasks. For instructions on configurating '. 287 - 'reply handlers, see the article "Configuring Inbound Email" in '. 288 - 'the Phabricator documentation. By default, this is set to `null` '. 289 - 'and Phabricator will use a generic `noreply@` address or the '. 290 - 'address of the acting user instead of a special reply handler '. 291 - 'address (see `metamta.default-address`). If you set a domain '. 292 - 'here, Phabricator will begin generating private reply handler '. 293 - 'addresses. See also `metamta.maniphest.reply-handler` to further '. 294 - 'configure behavior. This key should be set to the domain part '. 295 - 'after the @, like "example.com".')), 296 - $this->newOption( 297 276 'metamta.maniphest.reply-handler', 298 277 'class', 299 278 'ManiphestReplyHandler')
-5
src/applications/maniphest/mail/ManiphestReplyHandler.php
··· 17 17 return $this->getDefaultPublicReplyHandlerEmailAddress('T'); 18 18 } 19 19 20 - public function getReplyHandlerDomain() { 21 - return $this->getCustomReplyHandlerDomainIfExists( 22 - 'metamta.maniphest.reply-handler-domain'); 23 - } 24 - 25 20 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 26 21 // NOTE: We'll drop in here on both the "reply to a task" and "create a 27 22 // new task" workflows! Make sure you test both if you make changes!
+4 -12
src/applications/metamta/replyhandler/PhabricatorMailReplyHandler.php
··· 48 48 abstract public function validateMailReceiver($mail_receiver); 49 49 abstract public function getPrivateReplyHandlerEmailAddress( 50 50 PhabricatorObjectHandle $handle); 51 + 51 52 public function getReplyHandlerDomain() { 52 - return $this->getDefaultReplyHandlerDomain(); 53 - } 54 - protected function getCustomReplyHandlerDomainIfExists($config_key) { 55 - $domain = PhabricatorEnv::getEnvConfig($config_key); 56 - if ($domain) { 57 - return $domain; 58 - } 59 - return $this->getDefaultReplyHandlerDomain(); 60 - } 61 - private function getDefaultReplyHandlerDomain() { 62 - return PhabricatorEnv::getEnvConfig( 63 - 'metamta.reply-handler-domain'); 53 + return PhabricatorEnv::getEnvConfig('metamta.reply-handler-domain'); 64 54 } 65 55 66 56 abstract protected function receiveEmail( ··· 110 100 if (!PhabricatorEnv::getEnvConfig('metamta.public-replies')) { 111 101 return false; 112 102 } 103 + 113 104 if (!$this->getReplyHandlerDomain()) { 114 105 return false; 115 106 } 107 + 116 108 return (bool)$this->getPublicReplyHandlerEmailAddress(); 117 109 } 118 110
-4
src/applications/owners/mail/OwnersPackageReplyHandler.php
··· 16 16 return null; 17 17 } 18 18 19 - public function getReplyHandlerDomain() { 20 - return null; 21 - } 22 - 23 19 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 24 20 return; 25 21 }
-6
src/applications/pholio/config/PhabricatorPholioConfigOptions.php
··· 21 21 22 22 public function getOptions() { 23 23 return array( 24 - $this->newOption('metamta.pholio.reply-handler-domain', 'string', null) 25 - ->setLocked(true) 26 - ->setDescription( 27 - pht( 28 - 'Like {{metamta.maniphest.reply-handler-domain}}, but affects '. 29 - 'Pholio.')), 30 24 $this->newOption('metamta.pholio.subject-prefix', 'string', '[Pholio]') 31 25 ->setDescription(pht('Subject prefix for Pholio email.')), 32 26 );
-5
src/applications/pholio/mail/PholioReplyHandler.php
··· 17 17 return $this->getDefaultPublicReplyHandlerEmailAddress('M'); 18 18 } 19 19 20 - public function getReplyHandlerDomain() { 21 - return $this->getCustomReplyHandlerDomainIfExists( 22 - 'metamta.pholio.reply-handler-domain'); 23 - } 24 - 25 20 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 26 21 // TODO: Implement this. 27 22 return null;
-4
src/applications/repository/mail/PhabricatorRepositoryPushReplyHandler.php
··· 12 12 return null; 13 13 } 14 14 15 - public function getReplyHandlerDomain() { 16 - return null; 17 - } 18 - 19 15 protected function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) { 20 16 return; 21 17 }
+8 -11
src/docs/user/configuration/configuring_inbound_email.diviner
··· 135 135 inbound email. Provided you have such an account, configure it like this: 136 136 137 137 - Configure an MX record according to SendGrid's instructions, i.e. add 138 - ##phabricator.example.com MX 10 mx.sendgrid.net.## or similar. 138 + `phabricator.example.com MX 10 mx.sendgrid.net.` or similar. 139 139 - Go to the "Parse Incoming Emails" page on SendGrid 140 140 (<http://sendgrid.com/developer/reply>) and add the domain as the 141 141 "Hostname". 142 - - Add the URL ##https://phabricator.example.com/mail/sendgrid/## as the "Url", 142 + - Add the URL `https://phabricator.example.com/mail/sendgrid/` as the "Url", 143 143 using your domain (and HTTP instead of HTTPS if you are not configured with 144 144 SSL). 145 145 - If you get an error that the hostname "can't be located or verified", it 146 146 means your MX record is either incorrectly configured or hasn't propagated 147 147 yet. 148 - - Set ##metamta.maniphest.reply-handler-domain## and/or 149 - ##metamta.differential.reply-handler-domain## to 150 - "##phabricator.example.com##" (whatever you configured the MX record for), 151 - depending on whether you want to support email replies for Maniphest, 152 - Differential, or both. 148 + - Set `metamta.reply-handler-domain` to `phabricator.example.com`" 149 + (whatever you configured the MX record for). 153 150 154 151 That's it! If everything is working properly you should be able to send email 155 - to ##anything@phabricator.example.com## and it should appear in 152 + to `anything@phabricator.example.com` and it should appear in 156 153 `bin/mail list-inbound` within a few seconds. 157 154 158 155 = Local MTA: Installing Mailparse = ··· 211 208 212 209 sudo ln -s /path/to/phabricator/scripts/mail/mail_handler.php /etc/smrsh/ 213 210 214 - Finally, edit ##/etc/mail/virtusertable## and add an entry like this: 211 + Finally, edit `/etc/mail/virtusertable` and add an entry like this: 215 212 216 213 @yourdomain.com phabricator@localhost 217 214 218 215 That will forward all mail to @yourdomain.com to the Phabricator processing 219 - script. Run ##sudo /etc/mail/make## or similar and then restart sendmail with 216 + script. Run `sudo /etc/mail/make` or similar and then restart sendmail with 220 217 `sudo /etc/init.d/sendmail restart`. 221 218 222 219 = Local MTA: Configuring Lamson = ··· 232 229 (<http://lamsonproject.org/docs/getting_started.html>) to set up an instance. 233 230 One likely deployment issue is that binding to port 25 requires root 234 231 privileges. Lamson is capable of starting as root then dropping privileges, but 235 - you must supply ##-uid## and ##-gid## arguments to do so, as demonstrated by 232 + you must supply `-uid` and `-gid` arguments to do so, as demonstrated by 236 233 Step 8 in Lamson's deployment tutorial (located here: 237 234 <http://lamsonproject.org/docs/deploying_oneshotblog.html>). 238 235