Changeset View
Changeset View
Standalone View
Standalone View
src/applications/metamta/receiver/PhabricatorMailReceiver.php
| Show All 10 Lines | abstract class PhabricatorMailReceiver extends Phobject { | ||||
| } | } | ||||
| public function getApplicationEmail() { | public function getApplicationEmail() { | ||||
| return $this->applicationEmail; | return $this->applicationEmail; | ||||
| } | } | ||||
| abstract public function isEnabled(); | abstract public function isEnabled(); | ||||
| abstract public function canAcceptMail(PhabricatorMetaMTAReceivedMail $mail); | abstract public function canAcceptMail(PhabricatorMetaMTAReceivedMail $mail); | ||||
| final protected function canAcceptApplicationMail( | |||||
| PhabricatorApplication $app, | |||||
| PhabricatorMetaMTAReceivedMail $mail) { | |||||
| $application_emails = id(new PhabricatorMetaMTAApplicationEmailQuery()) | |||||
| ->setViewer($this->getViewer()) | |||||
| ->withApplicationPHIDs(array($app->getPHID())) | |||||
| ->execute(); | |||||
| foreach ($mail->newTargetAddresses() as $address) { | |||||
| foreach ($application_emails as $application_email) { | |||||
| $create_address = $application_email->newAddress(); | |||||
| if (PhabricatorMailUtil::matchAddresses($create_address, $address)) { | |||||
| $this->setApplicationEmail($application_email); | |||||
| return true; | |||||
| } | |||||
| } | |||||
| } | |||||
| return false; | |||||
| } | |||||
| abstract protected function processReceivedMail( | abstract protected function processReceivedMail( | ||||
| PhabricatorMetaMTAReceivedMail $mail, | PhabricatorMetaMTAReceivedMail $mail, | ||||
| PhabricatorUser $sender); | PhabricatorUser $sender); | ||||
| final public function receiveMail( | final public function receiveMail( | ||||
| PhabricatorMetaMTAReceivedMail $mail, | PhabricatorMetaMTAReceivedMail $mail, | ||||
| PhabricatorUser $sender) { | PhabricatorUser $sender) { | ||||
| ▲ Show 20 Lines • Show All 142 Lines • Show Last 20 Lines | |||||