From 0a658f9b3818d2de7ed81f0960f3f5b4382dda4a Mon Sep 17 00:00:00 2001 From: ppp0 Date: Mon, 23 Mar 2015 18:04:24 +0100 Subject: [PATCH 1/3] Move getting MDA from config to protected function --- library/CM/Mail.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/library/CM/Mail.php b/library/CM/Mail.php index 0b34139ec..b1898bad2 100644 --- a/library/CM/Mail.php +++ b/library/CM/Mail.php @@ -355,6 +355,18 @@ protected function _render($language) { return $renderAdapter->fetch(); } + /** + * @return string|null + */ + protected function _getMailDeliveryAgent() { + return $this->_getConfig()->mailDeliveryAgent; + } + + /** + * @throws CM_Exception_Invalid + * @throws CM_Exception_NotAllowed + * @throws phpmailerException + */ protected function _send($subject, $text, $html = null) { if (!self::_getConfig()->send) { $this->_log($subject, $text); @@ -374,7 +386,7 @@ protected function _send($subject, $text, $html = null) { foreach ($this->_bcc as $bcc) { $mail->AddBCC($bcc['address'], $bcc['name']); } - if ($mailDeliveryAgent = $this->_getConfig()->mailDeliveryAgent) { + if ($mailDeliveryAgent = $this->_getMailDeliveryAgent()) { $mail->AddCustomHeader('X-MDA: ' . $mailDeliveryAgent); } $mail->SetFrom($this->_sender['address'], $this->_sender['name']); From 8ad0f4a8ae987cc16357bb1aa95338318a8791bd Mon Sep 17 00:00:00 2001 From: ppp0 Date: Tue, 24 Mar 2015 10:37:38 +0100 Subject: [PATCH 2/3] Reworked docu according to review --- library/CM/Mail.php | 1 - 1 file changed, 1 deletion(-) diff --git a/library/CM/Mail.php b/library/CM/Mail.php index b1898bad2..9e407e662 100644 --- a/library/CM/Mail.php +++ b/library/CM/Mail.php @@ -364,7 +364,6 @@ protected function _getMailDeliveryAgent() { /** * @throws CM_Exception_Invalid - * @throws CM_Exception_NotAllowed * @throws phpmailerException */ protected function _send($subject, $text, $html = null) { From 47da62dfa71b53ffdcd8abde1e6f0687118aca8a Mon Sep 17 00:00:00 2001 From: ppp0 Date: Tue, 24 Mar 2015 14:20:15 +0100 Subject: [PATCH 3/3] Reworked docu according to review --- library/CM/Mail.php | 1 - 1 file changed, 1 deletion(-) diff --git a/library/CM/Mail.php b/library/CM/Mail.php index 9e407e662..79620b9ea 100644 --- a/library/CM/Mail.php +++ b/library/CM/Mail.php @@ -364,7 +364,6 @@ protected function _getMailDeliveryAgent() { /** * @throws CM_Exception_Invalid - * @throws phpmailerException */ protected function _send($subject, $text, $html = null) { if (!self::_getConfig()->send) {