aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Strohm <strohm@data-quest.de>2025-10-02 07:44:37 +0000
committerMoritz Strohm <strohm@data-quest.de>2025-10-02 07:44:37 +0000
commit1880f7c26cd17a35d8b3b58cbc14d2b9ce1189ff (patch)
treecd868e9627d2fd5090482afaa8e1d7d70e557f9e
parent2dc5aaea055932df52d0b08992dfdd4b76718411 (diff)
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
-rw-r--r--config/config_defaults.inc.php6
-rw-r--r--vendor/email_message/debug_message.php12
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")){