Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15427156
D19018.id45614.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D19018.id45614.diff
View Options
diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php
--- a/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php
+++ b/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php
@@ -105,6 +105,7 @@
public function processReceivedMail() {
+ $sender = null;
try {
$this->dropMailFromPhabricator();
$this->dropMailAlreadyReceived();
@@ -140,7 +141,7 @@
// This error is explicitly ignored.
break;
default:
- $this->sendExceptionMail($ex);
+ $this->sendExceptionMail($ex, $sender);
break;
}
@@ -150,7 +151,7 @@
->save();
return $this;
} catch (Exception $ex) {
- $this->sendExceptionMail($ex);
+ $this->sendExceptionMail($ex, $sender);
$this
->setStatus(MetaMTAReceivedMailStatus::STATUS_UNHANDLED_EXCEPTION)
@@ -305,9 +306,14 @@
return head($accept);
}
- private function sendExceptionMail(Exception $ex) {
- $from = $this->getHeader('from');
- if (!strlen($from)) {
+ private function sendExceptionMail(
+ Exception $ex,
+ PhabricatorUser $viewer = null) {
+
+ // If we've failed to identify a legitimate sender, we don't send them
+ // an error message back. We want to avoid sending mail to unverified
+ // addresses. See T12491.
+ if (!$viewer) {
return;
}
@@ -364,9 +370,8 @@
$mail = id(new PhabricatorMetaMTAMail())
->setIsErrorEmail(true)
- ->setForceDelivery(true)
->setSubject($title)
- ->addRawTos(array($from))
+ ->addTos(array($viewer->getPHID()))
->setBody($body)
->saveAndSend();
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 24, 1:09 PM (3 d, 53 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7720257
Default Alt Text
D19018.id45614.diff (1 KB)
Attached To
Mode
D19018: Don't send error/exception mail to unverified addresses
Attached
Detach File
Event Timeline
Log In to Comment