Add a Herald action to trigger "Must Encrypt" for mail

Summary: Depends on D18983. Ref T13053. Adds a new Herald action to activate the "must encrypt" flag and drop mail content.

Test Plan:
  - Created a new Herald rule:

{F5407075}

  - Created a "dog task" (woof woof, unsecure) and a "duck task" (quack quack, secure).
  - Viewed mail for both in `bin/mail` and web UI, saw appropriate security/encryption behavior.
  - Viewed "Must Encrypt" in "Headers" tab for the duck mail, saw why the mail was encrypted (link to Herald rule).

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13053

Differential Revision: https://secure.phabricator.com/D18984
This commit is contained in:
epriestley
2018-02-01 09:19:14 -08:00
parent 7b2b5cd91e
commit cbe4e68c07
7 changed files with 111 additions and 0 deletions

View File

@@ -175,6 +175,15 @@ final class PhabricatorMetaMTAMailViewController
$properties->addProperty($key, $value);
}
$encrypt_phids = $mail->getMustEncryptReasons();
if ($encrypt_phids) {
$properties->addProperty(
pht('Must Encrypt'),
$viewer->loadHandles($encrypt_phids)
->renderList());
}
return $properties;
}