From 66075708d0d4730020771ba8d989fa317c041e5e Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 17 Mar 2015 14:43:21 -0700 Subject: [PATCH] Allow MetaMTAMail to send with a raw "From" address Summary: Ref T7607. Ref T7522. - For the import tools, I want to send from "Phacility Support ". - In the general case, I want to send billing mail from merchants (T7607) later on. Test Plan: Sent an email and saw the desired "From" address. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T7607, T7522 Differential Revision: https://secure.phabricator.com/D12100 --- .../metamta/storage/PhabricatorMetaMTAMail.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php index 59d2d563c9..e6d8e52c45 100644 --- a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php +++ b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php @@ -206,6 +206,11 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO { return $this; } + public function setRawFrom($raw_email, $raw_name) { + $this->setParam('raw-from', array($raw_email, $raw_name)); + return $this; + } + public function setReplyTo($reply_to) { $this->setParam('reply-to', $reply_to); return $this; @@ -430,6 +435,10 @@ final class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO { foreach ($params as $key => $value) { switch ($key) { + case 'raw-from': + list($from_email, $from_name) = $value; + $mailer->setFrom($from_email, $from_name); + break; case 'from': $from = $value; $actor_email = null;