Page MenuHomePhabricator

MetaMTA - add (basic) application emails and deploy to Maniphest
ClosedPublic

Authored by btrahan on Jan 15 2015, 10:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 22, 9:24 AM
Unknown Object (File)
Sun, Apr 14, 8:57 PM
Unknown Object (File)
Thu, Apr 11, 7:56 AM
Unknown Object (File)
Wed, Apr 10, 11:55 PM
Unknown Object (File)
Mon, Apr 8, 6:21 PM
Unknown Object (File)
Sat, Mar 30, 9:35 PM
Unknown Object (File)
Fri, Mar 29, 11:59 AM
Unknown Object (File)
Feb 8 2024, 4:22 AM
Subscribers

Details

Summary

Ref T5952, T3404. This lays the basic plumbing for how this will work, all the way to deploying on Maniphest. Aside from what is mentioned on T5952, I think page(s) on editing application emails could use a little more helpful text about what's going on, similar to how the config page that's getting deprecated works.

Test Plan

ran migration and noted my create email address migrated successfully. used bin/mail to make a task. added another email and used bin/mail to make a task. deleted an email. edited an email. invoked various error states and they all looked good.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

btrahan retitled this revision from to MetaMTA - add application emails.
btrahan updated this object.
btrahan edited the test plan for this revision. (Show Details)
btrahan added a reviewer: epriestley.

Looks reasonable to me so far. Your reasoning on separate table + real PHIDs makes sense to me.

resources/sql/autopatches/20150115.applicationemails.sql
6

To fix the warning, use {$COLLATE_SORT} here. Basically:

  • text32, text64, etc: use {$COLLATE_TEXT}
  • sort32, sort64, etc: use {$COLLATE_SORT}
btrahan edited edge metadata.

working end to end in Maniphest

btrahan retitled this revision from MetaMTA - add application emails to MetaMTA - add (basic) application emails and deploy to Maniphest.Jan 16 2015, 11:36 PM
btrahan updated this object.
btrahan edited the test plan for this revision. (Show Details)
btrahan added a task: Restricted Maniphest Task.
epriestley edited edge metadata.

This is nice, and I'm really looking forward to it. A few inlines but nothing really substantive, most of it could probably be ignored or dealt with in followups.

UI-wise, it might be nice to let applications provide some kind of help or hint text somewhere in the UI, either on the main page or the edit page or both, since we don't actually say what the addresses do anywhere. Just having a one-liner like "Send mail to these addresses to create tasks. Learn More" with a link to the inbound mail docs would be good enough, I think, and then apps could customize it ("Send text to these addresses to create a paste.", etc).

resources/sql/autopatches/20150116.maniphestapplicationemails.php
6

This should probably be getEnvConfigIfExists(), because getEnvConfig() will start throwing after the option is removed.

11

Consider an initializeNew... method to reduce the chance we break this by accident if we add another property later which needs a default value, since no one is going to be able to / remember to test this.

src/applications/maniphest/mail/ManiphestCreateMailReceiver.php
12–15

This is probably way premature, but I wonder if we should support some kind of "role" for addresses.

I can't come up with a good example, which really suggests that this is ways out, but you could maaaybe imagine Calendar having, say, a "Create an event" address (event@..., "event" role) and a separate "send me a reminder" (reminder@..., "reminder" role) address. Well, that that example sucks. Nevermind. If we come up with an actual use case we could do this.

src/applications/meta/controller/PhabricatorApplicationEditEmailController.php
7–9

Instead, just require CAN_EDIT on the application itself (you already do this below). That's sufficient, slightly simpler, and will probably be more correct in the future.

Some day, when we have a use case, I imagine making that configurable -- so I could let a trusted PM reconfigure Maniphest, but only an Ops guy can reconfigure Almanac.

(And then CAN_EDIT on the meta-application would control who can control who can control applications.)

src/applications/metamta/storage/PhabricatorMetaMTAApplicationEmail.php
8

This is implicit if you specify AUX_PHID.

23–26

This key is implicit if you specify AUX_PHID.

59

We don't really need to do this, but ideally:

  • When loading the address, we would also load and attach the Application. (So if you can't see the application, you would not be able to see the address.)
  • Here, we'd proxy both policies through to the application: $this->getApplication()->getPolicy($capability).

That would give us:

  • Certainty that users who can't use the application can't send email to it. I'm like 95% sure they won't be able to do anything anyway, but we don't necessarily do these checks explicitly on object creation pathways.
  • Correct behavior in a future world where application edit policies are configurable, instead of being locked to ADMIN.
64

With the change above, this would also proxy.

src/applications/phid/PhabricatorMetaMTAApplicationEmailPHIDType.php
42

Just omit this, we'll correctly leave it unlinked.

This revision is now accepted and ready to land.Jan 19 2015, 6:10 PM
btrahan edited edge metadata.

updates - got 'em all except for the maybe some day role stuff

This revision was automatically updated to reflect the committed changes.