diff --git a/data/Dockerfiles/dovecot/quarantine_notify.py b/data/Dockerfiles/dovecot/quarantine_notify.py index 1c250bd3..6aefcab0 100755 --- a/data/Dockerfiles/dovecot/quarantine_notify.py +++ b/data/Dockerfiles/dovecot/quarantine_notify.py @@ -86,11 +86,18 @@ def notify_rcpt(rcpt, msg_count, quarantine_acl): msg.attach(html_part) msg['To'] = str(rcpt) bcc = r.get('Q_BCC') or "" + redirect = r.get('Q_REDIRECT') or "" text = msg.as_string() if bcc == '': - server.sendmail(msg['From'], str(rcpt), text) + if redirect == '': + server.sendmail(msg['From'], str(rcpt), text) + else: + server.sendmail(msg['From'], str(redirect), text) else: - server.sendmail(msg['From'], [str(rcpt)] + [str(bcc)], text) + if redirect == '': + server.sendmail(msg['From'], [str(rcpt)] + [str(bcc)], text) + else: + server.sendmail(msg['From'], [str(redirect)] + [str(bcc)], text) server.quit() for res in meta_query: query_mysql('UPDATE quarantine SET notified = 1 WHERE id = "%d"' % (res['id']), update = True) diff --git a/data/web/admin.php b/data/web/admin.php index 811b0387..7e32a204 100644 --- a/data/web/admin.php +++ b/data/web/admin.php @@ -767,85 +767,82 @@ if (!isset($_SESSION['gal']) && $license_cache = $redis->Get('LICENSE_STATUS_CAC -
-
-
-
- - -
-
-
-
- - -
+ +
+ +
+
-
-
-
- - -
-
-
-
- - -
+
+ +
+
-
-
-
- - -
-
-
-
- - -
+
+ +
+

-
-
- - - -
- -
+
+ +
+
-
-
-
- - -
+
+ +
+
-
-
-
- -
+
+
+
+ +
+
+
+ +
+ +
+
+
+
+ +
+ +
+
+
+
+
+ +
+
+
+ + + +
+ +
diff --git a/data/web/css/site/admin.css b/data/web/css/site/admin.css index 76246669..81fe98c3 100644 --- a/data/web/css/site/admin.css +++ b/data/web/css/site/admin.css @@ -70,3 +70,6 @@ table tbody tr { table tbody tr td input[type="checkbox"] { cursor: pointer; } +#quarantine_template { + margin:20px; +} \ No newline at end of file diff --git a/data/web/inc/functions.quarantine.inc.php b/data/web/inc/functions.quarantine.inc.php index b14dd643..77498e9c 100644 --- a/data/web/inc/functions.quarantine.inc.php +++ b/data/web/inc/functions.quarantine.inc.php @@ -307,6 +307,12 @@ function quarantine($_action, $_data = null) { else { $bcc = $_data['bcc']; } + if (!filter_var($_data['redirect'], FILTER_VALIDATE_EMAIL)) { + $redirect = ''; + } + else { + $redirect = $_data['redirect']; + } if (!filter_var($_data['sender'], FILTER_VALIDATE_EMAIL)) { $sender = ''; } @@ -326,6 +332,7 @@ function quarantine($_action, $_data = null) { $redis->Set('Q_RELEASE_FORMAT', $release_format); $redis->Set('Q_SENDER', $sender); $redis->Set('Q_BCC', $bcc); + $redis->Set('Q_REDIRECT', $redirect); $redis->Set('Q_SUBJ', $subject); $redis->Set('Q_HTML', $html); } @@ -793,6 +800,7 @@ function quarantine($_action, $_data = null) { $settings['subject'] = $redis->Get('Q_SUBJ'); $settings['sender'] = $redis->Get('Q_SENDER'); $settings['bcc'] = $redis->Get('Q_BCC'); + $settings['redirect'] = $redis->Get('Q_REDIRECT'); $settings['html_tmpl'] = htmlspecialchars($redis->Get('Q_HTML')); if (empty($settings['html_tmpl'])) { $settings['html_tmpl'] = htmlspecialchars(file_get_contents("/tpls/quarantine.tpl")); diff --git a/data/web/lang/lang.de.json b/data/web/lang/lang.de.json index c5757825..92d4633c 100644 --- a/data/web/lang/lang.de.json +++ b/data/web/lang/lang.de.json @@ -223,6 +223,7 @@ "quarantine_notification_html": "Benachrichtigungs-E-Mail Inhalt:
Leer lassen, um Standard-Template wiederherzustellen.", "quarantine_notification_sender": "Benachrichtigungs-E-Mail Absender", "quarantine_notification_subject": "Benachrichtigungs-E-Mail Betreff", + "quarantine_redirect": "Alle Benachrichtigungen an folgendes Postfach umleiten:
Leer bedeutet deaktiviert. Unsignierte, ungeprüfte E-Mail. Sollte nur intern zugestellt werden.", "quarantine_release_format": "Format freigegebener Mails", "quarantine_release_format_att": "Als Anhang", "quarantine_release_format_raw": "Unverändertes Original", @@ -736,7 +737,7 @@ "check_hash": "Checksumme auf VirusTotal suchen", "confirm_delete": "Bestätigen Sie die Löschung dieses Elements.", "danger": "Gefahr", - "disabled_by_config": "Die derzeitige Konfiguration deaktiviert die Funktion des Quarantäne-Systems.", + "disabled_by_config": "Die derzeitige Konfiguration deaktiviert die Funktion des Quarantäne-Systems. Zur Funktion muss eine Anzahl an Rückhaltungen pro Mailbox sowie ein Limit für die maximale Größe pro Element definiert werden.", "download_eml": "Herunterladen (.eml)", "empty": "Keine Einträge", "high_danger": "Hohe Gefahr", diff --git a/data/web/lang/lang.en.json b/data/web/lang/lang.en.json index 94a5effa..348a643e 100644 --- a/data/web/lang/lang.en.json +++ b/data/web/lang/lang.en.json @@ -222,6 +222,7 @@ "quarantine_notification_html": "Notification email template:
Leave empty to restore default template.", "quarantine_notification_sender": "Notification email sender", "quarantine_notification_subject": "Notification email subject", + "quarantine_redirect": "Redirect all notifications to this recipient:
Leave empty to disable. Unsigned, unchecked mail. Should be delivered internally only.", "quarantine_release_format": "Format of released items", "quarantine_release_format_att": "As attachment", "quarantine_release_format_raw": "Unmodified original", @@ -736,7 +737,7 @@ "check_hash": "Search file hash @ VT", "confirm_delete": "Confirm the deletion of this element.", "danger": "Danger", - "disabled_by_config": "The current system configuration disables the quarantine functionality.", + "disabled_by_config": "The current system configuration disables the quarantine functionality. Please set \"retentions per mailbox\" and a \"maximum size\" for quarantine elements.", "download_eml": "Download (.eml)", "empty": "No results", "high_danger": "High", diff --git a/docker-compose.yml b/docker-compose.yml index 99743924..9c77b25d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -193,7 +193,7 @@ services: - sogo dovecot-mailcow: - image: mailcow/dovecot:1.126 + image: mailcow/dovecot:1.127 depends_on: - mysql-mailcow dns: