Skip to content
Snippets Groups Projects
Commit 97e6f95a authored by Tim van Dijen's avatar Tim van Dijen
Browse files

Add sendmail_from option

parent fdbaa79f
No related branches found
No related tags found
No related merge requests found
......@@ -54,6 +54,11 @@ $config = array(
'technicalcontact_name' => 'Administrator',
'technicalcontact_email' => 'na@example.org',
/*
* Sender email should use the same domain as your application domain to prevent SPF record filtering
*/
//'sendmail_from' => 'no-reply@example.org',
/*
* The timezone of the server. This option should be set to the timezone you want
* SimpleSAMLphp to report the time in. The default is to guess the timezone based
......
......@@ -101,10 +101,21 @@ $email = trim($email);
// check that it looks like a valid email address
if (!preg_match('/\s/', $email) && strpos($email, '@') !== false) {
$replyto = $email;
$from = $email;
} else {
$replyto = null;
$from = 'no-reply@simplesamlphp.org';
}
$from = $config->getString('sendmail_from', null);
if ($from === null || $from === '') {
$from = ini_get('sendmail_from');
if ($from === '' || $from === false) {
$from = 'no-reply@example.org';
}
}
// If no sender email was configured at least set some relevant from address
if ($from === 'no-reply@example.org' && $replyto !== null) {
$from = $replyto;
}
// send the email
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment