From 1880f7c26cd17a35d8b3b58cbc14d2b9ce1189ff Mon Sep 17 00:00:00 2001 From: Moritz Strohm Date: Thu, 2 Oct 2025 07:44:37 +0000 Subject: added DEBUG_MAIL_LOG_FILE_NAME config to config_defaults.inc.php and regard it in the debug_message extension of email_message_class, closes #5133 Closes #5133 Merge request studip/studip!3839 --- config/config_defaults.inc.php | 6 ++++++ vendor/email_message/debug_message.php | 12 +++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/config/config_defaults.inc.php b/config/config_defaults.inc.php index 632427f..c120e86 100644 --- a/config/config_defaults.inc.php +++ b/config/config_defaults.inc.php @@ -143,6 +143,12 @@ $MAIL_BULK_DELIVERY = FALSE; //try to improve the message $MAIL_VALIDATE_HOST = TRUE; //check for valid mail host when user enters email adress $MAIL_VALIDATE_BOX = FALSE; //check for valid mail account when user enters email adress; set to false if the webserver got no valid MX record +/** + * The file name in the temporary directory ($TMP_PATH) where debug mails shall be written into. + * This is only regarded when $MAIL_TRANSPORT is set to 'debug'. + */ +$DEBUG_MAIL_LOG_FILE_NAME = 'studip-mail-debug.log'; + $MESSAGING_FORWARD_AS_EMAIL = TRUE; //enable to forward every internal message to the user-mail (the user is able to deactivate this function in his personal settings) $MESSAGING_FORWARD_DEFAULT = 2; //the default setting: if 1, the user has to switch it on; if 2, every message will be forwarded; if 3 every message will be forwarded on request of the sender $MESSAGING_FORWARD_USE_REPLYTO = TRUE; //send forwarded messages as system user and add reply-to header diff --git a/vendor/email_message/debug_message.php b/vendor/email_message/debug_message.php index ea8bd6b..4882570 100644 --- a/vendor/email_message/debug_message.php +++ b/vendor/email_message/debug_message.php @@ -9,12 +9,14 @@ class debug_message_class extends email_message_class { + private $logfile = ''; - private $logfile =""; - - function __construct() { - $this->logfile = $GLOBALS['TMP_PATH'] . '/studip-mail-debug.log'; - } + function __construct() { + $this->logfile = implode('/', [ + $GLOBALS['TMP_PATH'], + $GLOBALS['DEBUG_MAIL_LOG_FILE_NAME'] ?? 'studip-mail-debug.log' + ]); + } function SendMail($to,$subject,$body,$headers,$return_path) { if ($log = fopen($this->logfile, "a")){ -- cgit v1.0