feat: read mail sender address from configuration

This commit is contained in:
Emmanuel BENOîT 2025-01-02 16:53:36 +01:00
parent b9bae69e6a
commit 31f5063a96
Signed by: Emmanuel BENOîT
SSH key fingerprint: SHA256:l7PFUUF5TCDsvYeQC9OnTNz08dFY7Fvf4Hv3neIqYpg
2 changed files with 6 additions and 2 deletions

View file

@ -29,10 +29,11 @@ class main_sendMail {
$mail = preg_replace($subst, $vals, $mail); $mail = preg_replace($subst, $vals, $mail);
$tmp = explode("\n", $mail); $tmp = explode("\n", $mail);
$subject = array_shift($tmp); $subject = array_shift($tmp);
$from = config::getParam('mailfrom');
$mail = join("\n", $tmp); $mail = join("\n", $tmp);
$header = "From: webmaster@legacyworlds.com\r\n" $header = "From: $from\r\n"
. "Reply-To: webmaster@legacyworlds.com\r\n" . "Reply-To: $from\r\n"
. "X-Mailer: LegacyWorlds\r\n" . "X-Mailer: LegacyWorlds\r\n"
. "Mime-Version: 1.0\r\n" . "Mime-Version: 1.0\r\n"
. "Content-Type: text/plain; charset=iso-8859-1"; . "Content-Type: text/plain; charset=iso-8859-1";

View file

@ -9,6 +9,9 @@
<Param name="dbuser" from-env="LW_DB_USER_NAME" value="legacyworlds" /> <Param name="dbuser" from-env="LW_DB_USER_NAME" value="legacyworlds" />
<Param name="dbpass" from-env="LW_DB_USER_PASS" /> <Param name="dbpass" from-env="LW_DB_USER_PASS" />
<!-- Mail sender -->
<Param name="mailfrom" from-env="LW_MAIL_FROM" value="legacyworlds@example.org" />
<!-- Cookies --> <!-- Cookies -->
<Param name="trackname" value="legacy_alpha_trk" /> <Param name="trackname" value="legacy_alpha_trk" />
<Param name="sessname" value="legacy_alpha_sid" /> <Param name="sessname" value="legacy_alpha_sid" />