Skip to content

Commit

Permalink
Fix cmsimple-xh#283: Mailform should use fixed From address
Browse files Browse the repository at this point in the history
Presently, mails sent via the built-in mailform use the submitted email
address as From header.  However, unknown senders may be blocked on
shared hosting servers, and therefore we set the From header to the
configured email address (which easily can be whitelisted, if
necessary), and set the Reply-To header to the submitted email address.
  • Loading branch information
cmb69 committed Oct 21, 2017
1 parent 3ecf3b1 commit 9ef369f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmsimple/classes/Mailform.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ public function submit()
global $cf, $tx;

$this->mail->setTo($cf['mailform']['email']);
$this->mail->addHeader('From', $this->sender);
$this->mail->addHeader('From', $cf['mailform']['email']);
$this->mail->addHeader('Reply-To', $this->sender);
$this->mail->addHeader('X-Remote', sv('REMOTE_ADDR'));
$this->mail->setSubject($this->subject);
$this->mail->setMessage(
Expand Down

0 comments on commit 9ef369f

Please sign in to comment.