@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.

Persist excluded recipients when saving mail

Summary:
Fixes T5185. The fundamental issue is that this `excludePHIDs` property was not saved, so the logic went like this:

- Generate `excludePHIDs` correctly.
- Pass `excludePHIDs` through the stack.
- Perform some other computations correctly.
- Queue the mail for the daemons, throwing it away. {icon bomb}
- Daemons process mail with empty `excludePHIDs` list.

Store it in the persistent properties array instead.

Also remove the "override self mail" thing, since it's only used by `bin/mail send-test` and suffers from the same issue. I think it's too useless to fix, since even if you get caught by it, `bin/mail` makes it clear why the message was dropped.

Test Plan:
Notable:

- `exclude` present in properties
- Exclusion reason under RECIPIENTS header

{P1229}

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5185

Differential Revision: https://secure.phabricator.com/D10234

+5 -16
-1
src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
··· 117 117 ->addCCs($ccs) 118 118 ->setSubject($subject) 119 119 ->setBody($body) 120 - ->setOverrideNoSelfMailPreference(true) 121 120 ->setIsHTML($is_html) 122 121 ->setIsBulk($is_bulk) 123 122 ->setMailTags($tags);
+5 -15
src/applications/metamta/storage/PhabricatorMetaMTAMail.php
··· 17 17 protected $message; 18 18 protected $relatedPHID; 19 19 20 - private $excludePHIDs = array(); 21 - private $overrideNoSelfMail = false; 22 20 private $recipientExpansionMap; 23 21 24 22 public function __construct() { ··· 115 113 return $this; 116 114 } 117 115 118 - public function setExcludeMailRecipientPHIDs($exclude) { 119 - $this->excludePHIDs = $exclude; 116 + public function setExcludeMailRecipientPHIDs(array $exclude) { 117 + $this->setParam('exclude', $exclude); 120 118 return $this; 121 119 } 122 - private function getExcludeMailRecipientPHIDs() { 123 - return $this->excludePHIDs; 124 - } 125 120 126 - public function getOverrideNoSelfMailPreference() { 127 - return $this->overrideNoSelfMail; 128 - } 129 - 130 - public function setOverrideNoSelfMailPreference($override) { 131 - $this->overrideNoSelfMail = $override; 132 - return $this; 121 + private function getExcludeMailRecipientPHIDs() { 122 + return $this->getParam('exclude', array()); 133 123 } 134 124 135 125 public function getTranslation(array $objects) { ··· 828 818 ->withPHIDs(array($from_phid)) 829 819 ->execute(); 830 820 $from_user = head($from_user); 831 - if ($from_user && !$this->getOverrideNoSelfMailPreference()) { 821 + if ($from_user) { 832 822 $pref_key = PhabricatorUserPreferences::PREFERENCE_NO_SELF_MAIL; 833 823 $exclude_self = $from_user 834 824 ->loadPreferences()