From 56c6c2fe3690f65d5aff419a909ab1db3f1243d7 Mon Sep 17 00:00:00 2001 From: josef radinger Date: Tue, 9 Feb 2021 13:27:04 +0100 Subject: [PATCH 1/2] add from-adress to logs --- lib/Compose.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/Compose.php b/lib/Compose.php index 92279a058..de0c39062 100644 --- a/lib/Compose.php +++ b/lib/Compose.php @@ -1429,10 +1429,11 @@ protected function _prepSendMessageAssert(Horde_Mail_Rfc822_List $email) Horde::permissionDeniedError('imp', 'max_timelimit'); throw new IMP_Compose_Exception(sprintf( ngettext( - "You are not allowed to send messages to more than %d recipient within %d hours.", - "You are not allowed to send messages to more than %d recipients within %d hours.", + "You (%s) are not allowed to send messages to more than %d recipient within %d hours.", + "You (%s) are not allowed to send messages to more than %d recipients within %d hours.", $imp_imap->max_compose_timelimit ), + $headers['from'], $imp_imap->max_compose_timelimit, $injector->getInstance('IMP_Sentmail')->limit_period )); @@ -1444,10 +1445,11 @@ protected function _prepSendMessageAssert(Horde_Mail_Rfc822_List $email) Horde::permissionDeniedError('imp', 'max_recipients'); throw new IMP_Compose_Exception(sprintf( ngettext( - "You are not allowed to send messages to more than %d recipient.", - "You are not allowed to send messages to more than %d recipients.", + "You (%s) are not allowed to send messages to more than %d recipient.", + "You (%s) are not allowed to send messages to more than %d recipients.", $imp_imap->max_compose_recipients ), + $headers['from'], $imp_imap->max_compose_recipients )); } From ba2b8993777a1674ac6d2a454426d905e6ec2206 Mon Sep 17 00:00:00 2001 From: cheese1 Date: Thu, 25 Feb 2021 14:05:08 +0100 Subject: [PATCH 2/2] better to use getAuth() maybe better to use getAuth() than the from-header, as the enduser cannot modify/fake that (i assume) --- lib/Compose.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Compose.php b/lib/Compose.php index de0c39062..7544c3625 100644 --- a/lib/Compose.php +++ b/lib/Compose.php @@ -1433,7 +1433,7 @@ protected function _prepSendMessageAssert(Horde_Mail_Rfc822_List $email) "You (%s) are not allowed to send messages to more than %d recipients within %d hours.", $imp_imap->max_compose_timelimit ), - $headers['from'], + $GLOBALS['registry']->getAuth(), $imp_imap->max_compose_timelimit, $injector->getInstance('IMP_Sentmail')->limit_period )); @@ -1449,7 +1449,7 @@ protected function _prepSendMessageAssert(Horde_Mail_Rfc822_List $email) "You (%s) are not allowed to send messages to more than %d recipients.", $imp_imap->max_compose_recipients ), - $headers['from'], + $GLOBALS['registry']->getAuth(), $imp_imap->max_compose_recipients )); }