1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 09:42:41 +01:00
phorge-phorge/src/applications/metamta
epriestley 341079c3cf Move some received mail responsibility to applications
Summary:
Ref T1205. Continuation of D5915.

Currently, `PhabricatorMetaMTAReceivedMail` has //all// the logic for routing mail. In particular:

  - New mail receivers in applications must edit it.
  - Mail receivers don't drop out when applications are uninstalled.

Applications have some logic in subclasses of `PhabricatorMailReplyHandler`, but this class is a bit of a mess. It is also heavily based on the assumption that mail receivers are objects (like revisions), but this is not true in at least two cases today (creating new tasks with `bugs@`, creating a new Conpherence thread) and likely other cases in the future (e.g., revision-by-mail).

Move this logic into a new `PhabricatorMailReceiver` classtree. This is similar to `PhabricatorMailReplyHandler` but a bit cleaner and more general. I plan to heavily reduce the responsibilities of `PhabricatorMailReplyHandler` or possibly eliminate it entirely.

For now, the new classtree doesn't do much of interest. The only behavioral change this diff causes is that Phabricator will now reject mail to an application when that application is uninstalled.

I also moved all the `ReplyHandler` classes into `mail/` directories in their respective applications.

Test Plan: Unit tests, used receive test to route mail to various objects.

Reviewers: btrahan

Reviewed By: btrahan

CC: Afaque_Hussain, edward, aran

Maniphest Tasks: T1205

Differential Revision: https://secure.phabricator.com/D5922
2013-05-14 10:57:41 -07:00
..
__tests__ Delete license headers from files 2012-11-05 11:16:51 -08:00
adapter Apply lint rules to Phabricator 2013-02-19 13:33:10 -08:00
application Installation & Uninstallion of Applications 2013-01-29 09:17:24 -08:00
constants Move some received mail responsibility to applications 2013-05-14 10:57:41 -07:00
contentsource Convert simple phutil_render_tag() to phutil_tag() 2013-01-24 19:30:50 -08:00
controller Move some received mail responsibility to applications 2013-05-14 10:57:41 -07:00
exception Begin improving the soundness of received mail 2013-05-13 16:32:19 -07:00
management Introduce basic bin/mail with a resend workflow 2013-03-30 15:53:49 -07:00
receiver Move some received mail responsibility to applications 2013-05-14 10:57:41 -07:00
replyhandler Uniformized handle data 2013-04-04 13:10:19 -07:00
storage Move some received mail responsibility to applications 2013-05-14 10:57:41 -07:00
view Delete license headers from files 2012-11-05 11:16:51 -08:00
PhabricatorMail.php Require a viewer to load handles 2013-02-28 17:15:09 -08:00
PhabricatorMetaMTAEmailBodyParser.php Delete license headers from files 2012-11-05 11:16:51 -08:00
PhabricatorMetaMTAWorker.php Convert phutil_render_tag(X, Y, phutil_escape_html(Z)) to phutil_tag 2013-01-24 19:08:55 -08:00