Skip to content

Commit

Permalink
fixes #12533 メール通知動作時にReturn-Pathを設定する
Browse files Browse the repository at this point in the history
  • Loading branch information
fuchigam1 committed Jun 25, 2016
1 parent 88bf7bd commit 69802a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions lib/Baser/Controller/BcAppController.php
Expand Up @@ -811,6 +811,14 @@ public function sendMail($to, $title = '', $body = '', $options = array()) {
'tls' => $tls
);

/**
* CakeEmailでは、return-path の正しい設定のためには additionalParameters を設定する必要がある
* @url http://norm-nois.com/blog/archives/2865
*/
if (!empty($options['additionalParameters'])) {
$config = Hash::merge($config, array('additionalParameters' => $options['additionalParameters']));
}

$cakeEmail = new CakeEmail($config);

// charset
Expand Down
6 changes: 4 additions & 2 deletions lib/Baser/Plugin/Mail/Controller/MailController.php
Expand Up @@ -569,7 +569,8 @@ protected function _sendEmail() {
'from' => $fromAdmin,
'template' => 'Mail.' . $mailContent['mail_template'],
'replyTo' => $fromAdmin,
'attachments' => $attachments
'attachments' => $attachments,
'additionalParameters' => '-f ' . $fromAdmin,
);
$this->sendMail($userMail, $mailContent['subject_user'], $data, $options);
}
Expand All @@ -584,7 +585,8 @@ protected function _sendEmail() {
'template' => 'Mail.' . $mailContent['mail_template'],
'bcc' => $mailContent['sender_2'],
'agentTemplate' => false,
'attachments' => $attachments
'attachments' => $attachments,
'additionalParameters' => '-f ' . $fromAdmin,
);
$this->sendMail($adminMail, $mailContent['subject_admin'], $data, $options);
}
Expand Down

0 comments on commit 69802a7

Please sign in to comment.