Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/maniphest/mail/ManiphestCreateMailReceiver.php
12256 views
1
<?php
2
3
final class ManiphestCreateMailReceiver
4
extends PhabricatorApplicationMailReceiver {
5
6
protected function newApplication() {
7
return new PhabricatorManiphestApplication();
8
}
9
10
protected function processReceivedMail(
11
PhabricatorMetaMTAReceivedMail $mail,
12
PhutilEmailAddress $target) {
13
14
$author = $this->getAuthor();
15
$task = ManiphestTask::initializeNewTask($author);
16
17
$from_address = $mail->newFromAddress();
18
if ($from_address) {
19
$task->setOriginalEmailSource((string)$from_address);
20
}
21
22
$handler = new ManiphestReplyHandler();
23
$handler->setMailReceiver($task);
24
25
$handler->setActor($author);
26
$handler->setExcludeMailRecipientPHIDs(
27
$mail->loadAllRecipientPHIDs());
28
if ($this->getApplicationEmail()) {
29
$handler->setApplicationEmail($this->getApplicationEmail());
30
}
31
$handler->processEmail($mail);
32
33
$mail->setRelatedPHID($task->getPHID());
34
}
35
36
}
37
38