Changeset View
Changeset View
Standalone View
Standalone View
src/applications/metamta/query/PhabricatorMetaMTAActorQuery.php
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | foreach ($phids as $phid) { | ||||
// deny all other types of mail. | // deny all other types of mail. | ||||
} | } | ||||
$email = idx($emails, $phid); | $email = idx($emails, $phid); | ||||
if (!$email) { | if (!$email) { | ||||
$actor->setUndeliverable(PhabricatorMetaMTAActor::REASON_NO_ADDRESS); | $actor->setUndeliverable(PhabricatorMetaMTAActor::REASON_NO_ADDRESS); | ||||
} else { | } else { | ||||
$actor->setEmailAddress($email->getAddress()); | $actor->setEmailAddress($email->getAddress()); | ||||
$actor->setIsVerified($email->getIsVerified()); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
private function loadExternalUserActors(array $actors, array $phids) { | private function loadExternalUserActors(array $actors, array $phids) { | ||||
assert_instances_of($actors, 'PhabricatorMetaMTAActor'); | assert_instances_of($actors, 'PhabricatorMetaMTAActor'); | ||||
$xusers = id(new PhabricatorExternalAccountQuery()) | $xusers = id(new PhabricatorExternalAccountQuery()) | ||||
Show All 14 Lines | foreach ($phids as $phid) { | ||||
$actor->setName($xuser->getDisplayName()); | $actor->setName($xuser->getDisplayName()); | ||||
if ($xuser->getAccountType() != 'email') { | if ($xuser->getAccountType() != 'email') { | ||||
$actor->setUndeliverable(PhabricatorMetaMTAActor::REASON_EXTERNAL_TYPE); | $actor->setUndeliverable(PhabricatorMetaMTAActor::REASON_EXTERNAL_TYPE); | ||||
continue; | continue; | ||||
} | } | ||||
$actor->setEmailAddress($xuser->getAccountID()); | $actor->setEmailAddress($xuser->getAccountID()); | ||||
// NOTE: This effectively drops all outbound mail to unrecognized | |||||
// addresses unless "phabricator.allow-email-users" is set. See T12237 | |||||
// for context. | |||||
$allow_key = 'phabricator.allow-email-users'; | |||||
$allow_value = PhabricatorEnv::getEnvConfig($allow_key); | |||||
$actor->setIsVerified((bool)$allow_value); | |||||
} | } | ||||
} | } | ||||
private function loadUnknownActors(array $actors, array $phids) { | private function loadUnknownActors(array $actors, array $phids) { | ||||
foreach ($phids as $phid) { | foreach ($phids as $phid) { | ||||
$actor = $actors[$phid]; | $actor = $actors[$phid]; | ||||
$actor->setUndeliverable(PhabricatorMetaMTAActor::REASON_UNMAILABLE); | $actor->setUndeliverable(PhabricatorMetaMTAActor::REASON_UNMAILABLE); | ||||
Show All 29 Lines |