Skip to content

Commit 29923cc

Browse files
author
epriestley
committedFeb 20, 2020
Remove old code for sending email to external users who create objects via inbound mail
Summary: Ref T13493. I'm updating callers to `getAccountID()` to prepare to move it to a separate table. This callsite once supported this flow: - External users with no accounts send mail to `bugs@`. - This creates tasks in Maniphest. - They're CC'd when the tasks are updated. However, after T12237 we never actually send this mail (since their addresses are necessarily unverified). I left this code in in case this needed to be revisited, but it hasn't been an issue. Just remove it and treat these users as undeliverable. Test Plan: As a cursory test for nothing being horribly broken, sent some object mail. Maniphest Tasks: T13493 Differential Revision: https://secure.phabricator.com/D21007
1 parent 64cc4fe commit 29923cc

File tree

1 file changed

+0
-40
lines changed

1 file changed

+0
-40
lines changed
 

‎src/applications/metamta/query/PhabricatorMetaMTAActorQuery.php

-40
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ public function execute() {
3636
case PhabricatorPeopleUserPHIDType::TYPECONST:
3737
$this->loadUserActors($actors, $phids);
3838
break;
39-
case PhabricatorPeopleExternalPHIDType::TYPECONST:
40-
$this->loadExternalUserActors($actors, $phids);
41-
break;
4239
default:
4340
$this->loadUnknownActors($actors, $phids);
4441
break;
@@ -94,43 +91,6 @@ private function loadUserActors(array $actors, array $phids) {
9491
}
9592
}
9693

97-
private function loadExternalUserActors(array $actors, array $phids) {
98-
assert_instances_of($actors, 'PhabricatorMetaMTAActor');
99-
100-
$xusers = id(new PhabricatorExternalAccountQuery())
101-
->setViewer($this->getViewer())
102-
->withPHIDs($phids)
103-
->execute();
104-
$xusers = mpull($xusers, null, 'getPHID');
105-
106-
foreach ($phids as $phid) {
107-
$actor = $actors[$phid];
108-
109-
$xuser = idx($xusers, $phid);
110-
if (!$xuser) {
111-
$actor->setUndeliverable(PhabricatorMetaMTAActor::REASON_UNLOADABLE);
112-
continue;
113-
}
114-
115-
$actor->setName($xuser->getDisplayName());
116-
117-
if ($xuser->getAccountType() != 'email') {
118-
$actor->setUndeliverable(PhabricatorMetaMTAActor::REASON_EXTERNAL_TYPE);
119-
continue;
120-
}
121-
122-
$actor->setEmailAddress($xuser->getAccountID());
123-
124-
// Circa T7477, it appears that we never intentionally send email to
125-
// external users (even when they email "bugs@" to create a task).
126-
// Mark these users as unverified so mail to them is always dropped.
127-
// See also T12237. In the future, we might change this behavior.
128-
129-
$actor->setIsVerified(false);
130-
}
131-
}
132-
133-
13494
private function loadUnknownActors(array $actors, array $phids) {
13595
foreach ($phids as $phid) {
13696
$actor = $actors[$phid];

0 commit comments

Comments
 (0)
Failed to load comments.