diff --git a/www/errorreport.php b/www/errorreport.php index 2a98dcf88730c5a5f3f30104f1a544ec4672c1b3..bcc13f1a52470edbc810b197946c0c29e4f73e2b 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') {