mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-02 01:48:23 +01:00
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
This commit is contained in:
parent
64cc4fe915
commit
29923cc71a
1 changed files with 0 additions and 40 deletions
|
@ -36,9 +36,6 @@ final class PhabricatorMetaMTAActorQuery extends PhabricatorQuery {
|
|||
case PhabricatorPeopleUserPHIDType::TYPECONST:
|
||||
$this->loadUserActors($actors, $phids);
|
||||
break;
|
||||
case PhabricatorPeopleExternalPHIDType::TYPECONST:
|
||||
$this->loadExternalUserActors($actors, $phids);
|
||||
break;
|
||||
default:
|
||||
$this->loadUnknownActors($actors, $phids);
|
||||
break;
|
||||
|
@ -94,43 +91,6 @@ final class PhabricatorMetaMTAActorQuery extends PhabricatorQuery {
|
|||
}
|
||||
}
|
||||
|
||||
private function loadExternalUserActors(array $actors, array $phids) {
|
||||
assert_instances_of($actors, 'PhabricatorMetaMTAActor');
|
||||
|
||||
$xusers = id(new PhabricatorExternalAccountQuery())
|
||||
->setViewer($this->getViewer())
|
||||
->withPHIDs($phids)
|
||||
->execute();
|
||||
$xusers = mpull($xusers, null, 'getPHID');
|
||||
|
||||
foreach ($phids as $phid) {
|
||||
$actor = $actors[$phid];
|
||||
|
||||
$xuser = idx($xusers, $phid);
|
||||
if (!$xuser) {
|
||||
$actor->setUndeliverable(PhabricatorMetaMTAActor::REASON_UNLOADABLE);
|
||||
continue;
|
||||
}
|
||||
|
||||
$actor->setName($xuser->getDisplayName());
|
||||
|
||||
if ($xuser->getAccountType() != 'email') {
|
||||
$actor->setUndeliverable(PhabricatorMetaMTAActor::REASON_EXTERNAL_TYPE);
|
||||
continue;
|
||||
}
|
||||
|
||||
$actor->setEmailAddress($xuser->getAccountID());
|
||||
|
||||
// Circa T7477, it appears that we never intentionally send email to
|
||||
// external users (even when they email "bugs@" to create a task).
|
||||
// Mark these users as unverified so mail to them is always dropped.
|
||||
// See also T12237. In the future, we might change this behavior.
|
||||
|
||||
$actor->setIsVerified(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private function loadUnknownActors(array $actors, array $phids) {
|
||||
foreach ($phids as $phid) {
|
||||
$actor = $actors[$phid];
|
||||
|
|
Loading…
Add table
Reference in a new issue