@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final 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}