From f790bf5ca946561c2d727d55a85a106a7d812c01 Mon Sep 17 00:00:00 2001 From: Olav Morken <olav.morken@uninett.no> Date: Thu, 3 Jul 2008 12:41:58 +0000 Subject: [PATCH] Error reporting: Add Reply-To header with the users email address to submittted error reports. git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@768 44740490-163a-0410-bde0-09ae8108e29a --- www/errorreport.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/www/errorreport.php b/www/errorreport.php index 2a98dcf88..bcc13f1a5 100644 --- a/www/errorreport.php +++ b/www/errorreport.php @@ -102,6 +102,16 @@ $message .= "where this report was sent.\n"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-Type: text/plain; charset="UTF-8"' . "\r\n"; +/* Add the email address of the submitter as the Reply-To address. */ +if(array_key_exists('email', $_POST)) { + $email = $_POST['email']; + $email = trim($email); + /* Check that it looks like a valid email address. */ + if(!preg_match('/\s/', $email) && strpos($email, '@') !== FALSE) { + $headers .= 'Reply-To: ' . $email . "\r\n"; + } +} + /* Send the email. */ $email = $config->getValue('technicalcontact_email', 'na@example.org'); if($email !== 'na@example.org') { -- GitLab