From dc85f4996192210cdd1ab3b2a43bccca59e7e52a Mon Sep 17 00:00:00 2001 From: Tomy Hsieh Date: Sat, 11 Feb 2023 21:49:21 +0800 Subject: [PATCH 01/94] =?UTF-8?q?=E2=9C=A8=20feat:=20Change=20FIDO2=20logi?= =?UTF-8?q?n=20to=20independent=20button?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/web/templates/index.twig | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/data/web/templates/index.twig b/data/web/templates/index.twig index e90a720a..45054b5f 100644 --- a/data/web/templates/index.twig +++ b/data/web/templates/index.twig @@ -38,15 +38,8 @@
-
-
- - - -
-
+ + {% if not oauth2_request %}
'; } - item.in_use = '
' + + item.in_use = { + sortBy: item.percent_in_use, + value: '
' + '
' + item.percent_in_use + '%' + '
'; + 'style="min-width:2em;width:' + item.percent_in_use + '%">' + item.percent_in_use + '%' + '
' + }; item.username = escapeHtml(item.username); if (Array.isArray(item.tags)){ @@ -994,10 +997,11 @@ jQuery(function($){ }, { title: lang.in_use, - data: 'in_use', + data: 'in_use.value', defaultContent: '', responsivePriority: 9, - className: 'dt-data-w100' + className: 'dt-data-w100', + orderData: 24 }, { title: lang.fname, @@ -1102,7 +1106,12 @@ jQuery(function($){ { title: "", data: 'quota.sortBy', - responsivePriority: 8, + defaultContent: '', + className: "d-none" + }, + { + title: "", + data: 'in_use.sortBy', defaultContent: '', className: "d-none" }, From 7f0dd7d0d7a52115c3b97bb8c634b4b67d0693bb Mon Sep 17 00:00:00 2001 From: Niklas Meyer Date: Fri, 17 Feb 2023 12:53:31 +0100 Subject: [PATCH 09/94] [Nextcloud] Added bzip2 as required package --- helper-scripts/nextcloud.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/helper-scripts/nextcloud.sh b/helper-scripts/nextcloud.sh index 31cdb6a4..50fcbab3 100755 --- a/helper-scripts/nextcloud.sh +++ b/helper-scripts/nextcloud.sh @@ -2,9 +2,12 @@ # renovate: datasource=github-releases depName=nextcloud/server versioning=semver extractVersion=^v(?.*)$ NEXTCLOUD_VERSION=25.0.3 -for bin in curl dirmngr; do - if [[ -z $(which ${bin}) ]]; then echo "Cannot find ${bin}, exiting..."; exit 1; fi +echo -ne "Checking prerequisites..." +sleep 1 +for bin in curl dirmngr tar bzip2; do + if [[ -z $(which ${bin}) ]]; then echo -ne "\r\033[31mCannot find ${bin}, exiting...\033[0m\n"; exit 1; fi done +echo -ne "\r\033[32mFound all prerequisites! Continuing...\033[0m\n" [[ -z ${1} ]] && NC_HELP=y @@ -215,5 +218,4 @@ elif [[ ${NC_RESETPW} == "y" ]]; then read -p "Enter the username: " NC_USER done docker exec -it -u www-data $(docker ps -f name=php-fpm-mailcow -q) /web/nextcloud/occ user:resetpassword ${NC_USER} - fi From 04403aaf70b106bdffa19614b1ce25f715d4d7c0 Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Fri, 17 Feb 2023 13:15:44 +0100 Subject: [PATCH 10/94] [Netfilter] fix setting SNAT Rule if chain is empty --- data/Dockerfiles/netfilter/server.py | 37 +++++++++++++++++----------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/data/Dockerfiles/netfilter/server.py b/data/Dockerfiles/netfilter/server.py index 1ccc150e..0b0e2a41 100644 --- a/data/Dockerfiles/netfilter/server.py +++ b/data/Dockerfiles/netfilter/server.py @@ -359,21 +359,28 @@ def snat4(snat_target): chain = iptc.Chain(table, 'POSTROUTING') table.autocommit = False new_rule = get_snat4_rule() - for position, rule in enumerate(chain.rules): - match = all(( - new_rule.get_src() == rule.get_src(), - new_rule.get_dst() == rule.get_dst(), - new_rule.target.parameters == rule.target.parameters, - new_rule.target.name == rule.target.name - )) - if position == 0: - if not match: - logInfo(f'Added POSTROUTING rule for source network {new_rule.src} to SNAT target {snat_target}') - chain.insert_rule(new_rule) - else: - if match: - logInfo(f'Remove rule for source network {new_rule.src} to SNAT target {snat_target} from POSTROUTING chain at position {position}') - chain.delete_rule(rule) + + if not chain.rules: + # if there are no rules in the chain, insert the new rule directly + logInfo(f'Added POSTROUTING rule for source network {new_rule.src} to SNAT target {snat_target}') + chain.insert_rule(new_rule) + else: + for position, rule in enumerate(chain.rules): + match = all(( + new_rule.get_src() == rule.get_src(), + new_rule.get_dst() == rule.get_dst(), + new_rule.target.parameters == rule.target.parameters, + new_rule.target.name == rule.target.name + )) + if position == 0: + if not match: + logInfo(f'Added POSTROUTING rule for source network {new_rule.src} to SNAT target {snat_target}') + chain.insert_rule(new_rule) + else: + if match: + logInfo(f'Remove rule for source network {new_rule.src} to SNAT target {snat_target} from POSTROUTING chain at position {position}') + chain.delete_rule(rule) + table.commit() table.autocommit = True except: From 1a4f11209a52ac38847ac9562cedf6972b25307b Mon Sep 17 00:00:00 2001 From: Niklas Meyer Date: Fri, 17 Feb 2023 13:22:23 +0100 Subject: [PATCH 11/94] Updated netfilter to 1.51 --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index d9bad657..7c6c5d6a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -425,7 +425,7 @@ services: - acme netfilter-mailcow: - image: mailcow/netfilter:1.50 + image: mailcow/netfilter:1.51 stop_grace_period: 30s depends_on: - dovecot-mailcow From 3e1cfe0d08726e7edb7a611e1db0ab2bea1943eb Mon Sep 17 00:00:00 2001 From: kritzl Date: Wed, 22 Feb 2023 00:11:56 +0100 Subject: [PATCH 12/94] Fix cursor style when hovering 'Aliases' tab --- data/web/templates/mailbox.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/web/templates/mailbox.twig b/data/web/templates/mailbox.twig index 1312441c..2f0a12bf 100644 --- a/data/web/templates/mailbox.twig +++ b/data/web/templates/mailbox.twig @@ -19,7 +19,7 @@ + {% if acl.spam_alias == 1 %} + {% endif %} + {% if acl.spam_score == 1 %} + {% endif %} + {% if acl.syncjobs == 1 %} + {% endif %} + {% if acl.app_passwds == 1 %} + {% endif %} + {% if acl.pushover == 1 %} + {% endif %}
@@ -25,11 +35,11 @@ {% include 'user/tab-user-auth.twig' %} {% include 'user/tab-user-details.twig' %} {% include 'user/tab-user-settings.twig' %} - {% include 'user/SpamAliases.twig' %} - {% include 'user/Spamfilter.twig' %} - {% include 'user/Syncjobs.twig' %} - {% include 'user/AppPasswds.twig' %} - {% include 'user/Pushover.twig' %} + {% if acl.spam_alias == 1 %}{% include 'user/SpamAliases.twig' %}{% endif %} + {% if acl.spam_score == 1 %}{% include 'user/Spamfilter.twig' %}{% endif %} + {% if acl.syncjobs == 1 %}{% include 'user/Syncjobs.twig' %}{% endif %} + {% if acl.app_passwds == 1 %}{% include 'user/AppPasswds.twig' %}{% endif %} + {% if acl.pushover == 1 %}{% include 'user/Pushover.twig' %}{% endif %}
From f3322c05772c8192160628c6e7a5e6477e87f7e6 Mon Sep 17 00:00:00 2001 From: Peter Date: Fri, 21 Apr 2023 19:43:20 +0200 Subject: [PATCH 86/94] Add IP Connect Inc --- data/conf/rspamd/custom/bad_asn.map | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/data/conf/rspamd/custom/bad_asn.map b/data/conf/rspamd/custom/bad_asn.map index 1858c55f..a8d49cf3 100644 --- a/data/conf/rspamd/custom/bad_asn.map +++ b/data/conf/rspamd/custom/bad_asn.map @@ -27,4 +27,5 @@ #197518 2 #Rackmarkt SL, Spain #197695 2 #Domain names registrar REG.RU Ltd, Russia #198068 2 #P.A.G.M. OU, Estonia -#201942 5 #Soltia Consulting SL, Spain \ No newline at end of file +#201942 5 #Soltia Consulting SL, Spain +#213373 4 #IP Connect Inc \ No newline at end of file From 0372a2150d438ad71c1acc853db2a8556486ee82 Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Fri, 21 Apr 2023 20:14:43 +0200 Subject: [PATCH 87/94] [Web] fix rspamd table on sm devices --- data/web/js/site/debug.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/data/web/js/site/debug.js b/data/web/js/site/debug.js index 55b6660b..542ba185 100644 --- a/data/web/js/site/debug.js +++ b/data/web/js/site/debug.js @@ -829,13 +829,10 @@ jQuery(function($){ url: '/api/v1/get/rspamd/actions', async: true, success: function(data){ - console.log(data); - var total = 0; $(data).map(function(){total += this[1];}); var labels = $.makeArray($(data).map(function(){return this[0] + ' ' + Math.round(this[1]/total * 100) + '%';})); var values = $.makeArray($(data).map(function(){return this[1];})); - console.log(values); var graphdata = { labels: labels, @@ -951,12 +948,15 @@ jQuery(function($){ title: 'Score', data: 'score', defaultContent: '', + class: 'text-nowrap', createdCell: function(td, cellData) { $(td).attr({ "data-order": cellData.sortBy, "data-sort": cellData.sortBy }); - $(td).html(cellData.value); + }, + render: function (data) { + return data.value; } }, { From 6b65f0fc74c6026dec1d8d0996e26cec74566ac4 Mon Sep 17 00:00:00 2001 From: milkmaker Date: Tue, 25 Apr 2023 20:59:05 +0200 Subject: [PATCH 88/94] [Web] Updated lang.ru-ru.json (#5210) Co-authored-by: Vakhtang --- data/web/lang/lang.ru-ru.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/web/lang/lang.ru-ru.json b/data/web/lang/lang.ru-ru.json index 65dd4bae..bad64184 100644 --- a/data/web/lang/lang.ru-ru.json +++ b/data/web/lang/lang.ru-ru.json @@ -336,7 +336,9 @@ "validate_license_now": "Получить лицензию на основе GUID с сервера лицензий", "verify": "Проверить", "yes": "✓", - "queue_unban": "разблокировать" + "queue_unban": "разблокировать", + "f2b_ban_time_increment": "Время бана увеличивается с каждым баном", + "f2b_max_ban_time": "Максимальное время блокировки" }, "danger": { "access_denied": "Доступ запрещён, или указаны неверные данные", From fd203abd473d15c6b0d178ba4711b4a12c1a0fb3 Mon Sep 17 00:00:00 2001 From: goodygh Date: Tue, 25 Apr 2023 22:11:04 +0200 Subject: [PATCH 89/94] Fix typo in mobileconfig redirect --- data/web/inc/triggers.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/web/inc/triggers.inc.php b/data/web/inc/triggers.inc.php index fde1507f..c40453a2 100644 --- a/data/web/inc/triggers.inc.php +++ b/data/web/inc/triggers.inc.php @@ -63,7 +63,7 @@ if (isset($_POST["login_user"]) && isset($_POST["pass_user"])) { unset($_SESSION['index_query_string']); if (in_array('mobileconfig', $http_parameters)) { if (in_array('only_email', $http_parameters)) { - header("Location: /mobileconfig.php?email_only"); + header("Location: /mobileconfig.php?only_email"); die(); } header("Location: /mobileconfig.php"); From fe4a418af45fd7e82df7facfb9cdfb71efd17fb3 Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Thu, 27 Apr 2023 10:45:11 +0200 Subject: [PATCH 90/94] [Web] fix rspamd table scan_time on sm devices --- data/web/js/site/debug.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/web/js/site/debug.js b/data/web/js/site/debug.js index 542ba185..0b42e2c7 100644 --- a/data/web/js/site/debug.js +++ b/data/web/js/site/debug.js @@ -979,7 +979,9 @@ jQuery(function($){ "data-order": cellData.sortBy, "data-sort": cellData.sortBy }); - $(td).html(cellData.value); + }, + render: function (data) { + return data.value; } }, { From b5acf56e20a79d36496619116af2e460d7e20a87 Mon Sep 17 00:00:00 2001 From: DerLinkman Date: Tue, 2 May 2023 16:08:58 +0000 Subject: [PATCH 91/94] Added Platform Information on Status Page --- data/Dockerfiles/dockerapi/dockerapi.py | 4 +++- data/web/js/site/debug.js | 8 +++++++- data/web/lang/lang.de-de.json | 4 +++- data/web/lang/lang.en-gb.json | 4 +++- data/web/templates/debug.twig | 8 +++++++- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/data/Dockerfiles/dockerapi/dockerapi.py b/data/Dockerfiles/dockerapi/dockerapi.py index 1ab651b5..63436b62 100644 --- a/data/Dockerfiles/dockerapi/dockerapi.py +++ b/data/Dockerfiles/dockerapi/dockerapi.py @@ -9,6 +9,7 @@ import os import json import asyncio import redis +import platform from datetime import datetime import logging from logging.config import dictConfig @@ -485,7 +486,8 @@ async def get_host_stats(wait=5): "swap": psutil.swap_memory() }, "uptime": time.time() - psutil.boot_time(), - "system_time": system_time.strftime("%d.%m.%Y %H:%M:%S") + "system_time": system_time.strftime("%d.%m.%Y %H:%M:%S"), + "architecture": platform.machine() } redis_client.set('host_stats', json.dumps(host_stats), ex=10) diff --git a/data/web/js/site/debug.js b/data/web/js/site/debug.js index 55b6660b..78a4ccaa 100644 --- a/data/web/js/site/debug.js +++ b/data/web/js/site/debug.js @@ -43,7 +43,7 @@ $(document).ready(function() { if (mailcow_info.branch === "master"){ check_update(mailcow_info.version_tag, mailcow_info.project_url); } - $("#maiclow_version").click(function(){ + $("#mailcow_version").click(function(){ if (mailcow_cc_role !== "admin" && mailcow_cc_role !== "domainadmin" || mailcow_info.branch !== "master") return; @@ -1302,6 +1302,12 @@ function update_stats(timeout=5){ $("#host_cpu_usage").text(parseInt(data.cpu.usage).toString() + "%"); $("#host_memory_total").text((data.memory.total / (1024 ** 3)).toFixed(2).toString() + "GB"); $("#host_memory_usage").text(parseInt(data.memory.usage).toString() + "%"); + if (data.architecture == "aarch64"){ + $("#host_architecture").html('' + data.architecture + ' ⚠️'); + } + else { + $("#host_architecture").html(data.architecture); + } // update cpu and mem chart var cpu_chart = Chart.getChart("host_cpu_chart"); diff --git a/data/web/lang/lang.de-de.json b/data/web/lang/lang.de-de.json index 4bd4b3fa..e1cfee1b 100644 --- a/data/web/lang/lang.de-de.json +++ b/data/web/lang/lang.de-de.json @@ -498,6 +498,7 @@ } }, "debug": { + "architecture": "Architektur", "chart_this_server": "Chart (dieser Server)", "containers_info": "Container-Information", "container_running": "Läuft", @@ -534,7 +535,8 @@ "update_available": "Es ist ein Update verfügbar", "no_update_available": "Das System ist auf aktuellem Stand", "update_failed": "Es konnte nicht nach einem Update gesucht werden", - "username": "Benutzername" + "username": "Benutzername", + "wip": "Aktuell noch in Arbeit" }, "diagnostics": { "cname_from_a": "Wert abgeleitet von A/AAAA-Eintrag. Wird unterstützt, sofern der Eintrag auf die korrekte Ressource zeigt.", diff --git a/data/web/lang/lang.en-gb.json b/data/web/lang/lang.en-gb.json index df83987c..56a5bf90 100644 --- a/data/web/lang/lang.en-gb.json +++ b/data/web/lang/lang.en-gb.json @@ -498,6 +498,7 @@ } }, "debug": { + "architecture": "Architecture", "chart_this_server": "Chart (this server)", "containers_info": "Container information", "container_running": "Running", @@ -534,7 +535,8 @@ "update_available": "There is an update available", "no_update_available": "The System is on the latest version", "update_failed": "Could not check for an Update", - "username": "Username" + "username": "Username", + "wip": "Currently Work in Progress" }, "diagnostics": { "cname_from_a": "Value derived from A/AAAA record. This is supported as long as the record points to the correct resource.", diff --git a/data/web/templates/debug.twig b/data/web/templates/debug.twig index d24d7ed6..adc19b26 100644 --- a/data/web/templates/debug.twig +++ b/data/web/templates/debug.twig @@ -49,6 +49,12 @@

{{ hostname }}

+ + {{ lang.debug.architecture }} +
+

-

+
+ IPs @@ -70,7 +76,7 @@ Version From 1265302a8e08a4f966ceb40df5d53a6d8ce4a71f Mon Sep 17 00:00:00 2001 From: DerLinkman Date: Tue, 2 May 2023 18:11:59 +0200 Subject: [PATCH 92/94] [DockerAPI] Update to 2.04 --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 23bd308f..2585cda4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -510,7 +510,7 @@ services: - watchdog dockerapi-mailcow: - image: mailcow/dockerapi:2.03 + image: mailcow/dockerapi:2.04 security_opt: - label=disable restart: always From ee607dc3cc5f996091b2f4f40ef5726fb6206b11 Mon Sep 17 00:00:00 2001 From: milkmaker Date: Tue, 2 May 2023 18:29:38 +0200 Subject: [PATCH 93/94] Translations update from Weblate (#5218) * [Web] Updated lang.en-gb.json Co-authored-by: Peter * [Web] Updated lang.cs-cz.json Co-authored-by: Peter * [Web] Updated lang.de-de.json Co-authored-by: Peter * [Web] Updated lang.fr-fr.json Co-authored-by: Peter * [Web] Updated lang.ro-ro.json Co-authored-by: Peter * [Web] Updated lang.sk-sk.json Co-authored-by: Peter * [Web] Updated lang.zh-cn.json Co-authored-by: Peter * [Web] Updated lang.it-it.json Co-authored-by: Peter * [Web] Updated lang.zh-tw.json Co-authored-by: Peter --------- Co-authored-by: Peter --- data/web/lang/lang.cs-cz.json | 2 +- data/web/lang/lang.de-de.json | 4 ++-- data/web/lang/lang.en-gb.json | 4 ++-- data/web/lang/lang.fr-fr.json | 2 +- data/web/lang/lang.it-it.json | 4 ++-- data/web/lang/lang.ro-ro.json | 2 +- data/web/lang/lang.sk-sk.json | 4 ++-- data/web/lang/lang.zh-cn.json | 4 ++-- data/web/lang/lang.zh-tw.json | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/data/web/lang/lang.cs-cz.json b/data/web/lang/lang.cs-cz.json index 712b8c77..d4f62495 100644 --- a/data/web/lang/lang.cs-cz.json +++ b/data/web/lang/lang.cs-cz.json @@ -541,7 +541,7 @@ "inactive": "Neaktivní", "kind": "Druh", "last_modified": "Naposledy změněn", - "lookup_mx": "Cíl je regulární výraz který se shoduje s MX záznamem (.*google\\.com směřuje veškerou poštu na MX které jsou cílem pro google.com přes tento skok)", + "lookup_mx": "Cíl je regulární výraz který se shoduje s MX záznamem (.*\\.google\\.com směřuje veškerou poštu na MX které jsou cílem pro google.com přes tento skok)", "mailbox": "Úprava mailové schránky", "mailbox_quota_def": "Výchozí kvóta schránky", "mailbox_relayhost_info": "Aplikované jen na uživatelskou schránku a přímé aliasy, přepisuje předávající server domény.", diff --git a/data/web/lang/lang.de-de.json b/data/web/lang/lang.de-de.json index e1cfee1b..6b280bbb 100644 --- a/data/web/lang/lang.de-de.json +++ b/data/web/lang/lang.de-de.json @@ -216,7 +216,7 @@ "loading": "Bitte warten...", "login_time": "Zeit", "logo_info": "Die hochgeladene Grafik wird für die Navigationsleiste auf eine Höhe von 40px skaliert. Für die Darstellung auf der Login-Maske beträgt die skalierte Breite maximal 250px. Eine frei skalierbare Grafik (etwa SVG) wird empfohlen.", - "lookup_mx": "Ziel mit MX vergleichen (Regex, etwa .*google\\.com, um alle Ziele mit MX *google.com zu routen)", + "lookup_mx": "Ziel mit MX vergleichen (Regex, etwa .*\\.google\\.com, um alle Ziele mit MX *google.com zu routen)", "main_name": "\"mailcow UI\" Name", "merged_vars_hint": "Ausgegraute Reihen wurden aus der Datei vars.(local.)inc.php gelesen und können hier nicht verändert werden.", "message": "Nachricht", @@ -595,7 +595,7 @@ "inactive": "Inaktiv", "kind": "Art", "last_modified": "Zuletzt geändert", - "lookup_mx": "Ziel mit MX vergleichen (Regex, etwa .*google\\.com, um alle Ziele mit MX *google.com zu routen)", + "lookup_mx": "Ziel mit MX vergleichen (Regex, etwa .*\\.google\\.com, um alle Ziele mit MX *google.com zu routen)", "mailbox": "Mailbox bearbeiten", "mailbox_quota_def": "Standard-Quota einer Mailbox", "mailbox_relayhost_info": "Wird auf eine Mailbox und direkte Alias-Adressen angewendet. Überschreibt die Einstellung einer Domain.", diff --git a/data/web/lang/lang.en-gb.json b/data/web/lang/lang.en-gb.json index 56a5bf90..e53fe896 100644 --- a/data/web/lang/lang.en-gb.json +++ b/data/web/lang/lang.en-gb.json @@ -218,7 +218,7 @@ "loading": "Please wait...", "login_time": "Login time", "logo_info": "Your image will be scaled to a height of 40px for the top navigation bar and a max. width of 250px for the start page. A scalable graphic is highly recommended.", - "lookup_mx": "Destination is a regular expression to match against MX name (.*google\\.com to route all mail targeted to a MX ending in google.com over this hop)", + "lookup_mx": "Destination is a regular expression to match against MX name (.*\\.google\\.com to route all mail targeted to a MX ending in google.com over this hop)", "main_name": "\"mailcow UI\" name", "merged_vars_hint": "Greyed out rows were merged from vars.(local.)inc.php and cannot be modified.", "message": "Message", @@ -595,7 +595,7 @@ "inactive": "Inactive", "kind": "Kind", "last_modified": "Last modified", - "lookup_mx": "Destination is a regular expression to match against MX name (.*google\\.com to route all mail targeted to a MX ending in google.com over this hop)", + "lookup_mx": "Destination is a regular expression to match against MX name (.*\\.google\\.com to route all mail targeted to a MX ending in google.com over this hop)", "mailbox": "Edit mailbox", "mailbox_quota_def": "Default mailbox quota", "mailbox_relayhost_info": "Applied to the mailbox and direct aliases only, does override a domain relayhost.", diff --git a/data/web/lang/lang.fr-fr.json b/data/web/lang/lang.fr-fr.json index d64f62f7..0bc0ba02 100644 --- a/data/web/lang/lang.fr-fr.json +++ b/data/web/lang/lang.fr-fr.json @@ -588,7 +588,7 @@ "unchanged_if_empty": "Si non modifié, laisser en blanc", "username": "Nom d'utilisateur", "validate_save": "Valider et sauver", - "lookup_mx": "La destination est une expression régulière qui doit correspondre avec le nom du MX (.*google\\.com pour acheminer tout le courrier destiné à un MX se terminant par google.com via ce saut)", + "lookup_mx": "La destination est une expression régulière qui doit correspondre avec le nom du MX (.*\\.google\\.com pour acheminer tout le courrier destiné à un MX se terminant par google.com via ce saut)", "mailbox_relayhost_info": "S'applique uniquement à la boîte aux lettres et aux alias directs, remplace le relayhost du domaine." }, "footer": { diff --git a/data/web/lang/lang.it-it.json b/data/web/lang/lang.it-it.json index 4d21547c..0d5b3f25 100644 --- a/data/web/lang/lang.it-it.json +++ b/data/web/lang/lang.it-it.json @@ -213,7 +213,7 @@ "loading": "Caricamento in corso...", "login_time": "Ora di accesso", "logo_info": "La tua immagine verrà ridimensionata a 40px di altezza, quando verrà usata nella barra di navigazione in alto, ed ad una larghezza massima di 250px nella schermata iniziale. È altamente consigliato l'utilizzo di un'immagine modulabile.", - "lookup_mx": "Destination is a regular expression to match against MX name (.*google\\.com to route all mail targeted to a MX ending in google.com over this hop)", + "lookup_mx": "Destination is a regular expression to match against MX name (.*\\.google\\.com to route all mail targeted to a MX ending in google.com over this hop)", "main_name": "Nome \"mailcow UI\"", "merged_vars_hint": "Greyed out rows were merged from vars.(local.)inc.php and cannot be modified.", "message": "Messaggio", @@ -554,7 +554,7 @@ "hostname": "Hostname", "inactive": "Inattivo", "kind": "Genere", - "lookup_mx": "Destination is a regular expression to match against MX name (.*google\\.com to route all mail targeted to a MX ending in google.com over this hop)", + "lookup_mx": "Destination is a regular expression to match against MX name (.*\\.google\\.com to route all mail targeted to a MX ending in google.com over this hop)", "mailbox": "Modifica casella di posta", "mailbox_quota_def": "Default mailbox quota", "mailbox_relayhost_info": "Applied to the mailbox and direct aliases only, does override a domain relayhost.", diff --git a/data/web/lang/lang.ro-ro.json b/data/web/lang/lang.ro-ro.json index 8e6e1d45..e6315db0 100644 --- a/data/web/lang/lang.ro-ro.json +++ b/data/web/lang/lang.ro-ro.json @@ -539,7 +539,7 @@ "inactive": "Inactiv", "kind": "Fel", "last_modified": "Ultima modificare", - "lookup_mx": "Destinația este o expresie regulată care potrivită cu numele MX (.*google\\.com pentru a direcționa toate e-mailurile vizate către un MX care se termină în google.com peste acest hop)", + "lookup_mx": "Destinația este o expresie regulată care potrivită cu numele MX (.*\\.google\\.com pentru a direcționa toate e-mailurile vizate către un MX care se termină în google.com peste acest hop)", "mailbox": "Editează căsuța poștală", "mailbox_quota_def": "Cota implicită a căsuței poștale", "mailbox_relayhost_info": "Aplicat numai căsuței poștale și aliasurilor directe, suprascrie un transport dependent de domeniu.", diff --git a/data/web/lang/lang.sk-sk.json b/data/web/lang/lang.sk-sk.json index 2b93650f..29b36c44 100644 --- a/data/web/lang/lang.sk-sk.json +++ b/data/web/lang/lang.sk-sk.json @@ -213,7 +213,7 @@ "loading": "Čakajte prosím ...", "login_time": "Čas prihlásenia", "logo_info": "Váš obrázok bude upravený na výšku 40px pre vrchný navigačný riadok a na maximálnu šírku 250px pre úvodnú stránku. Odporúča sa škálovateľná grafika.", - "lookup_mx": "Cieľ je regulárny výraz ktorý sa porovnáva s MX záznamom (.*google\\.com smeruje všetku poštu určenú pre MX ktoré sú cieľom pre google.com cez tento skok)", + "lookup_mx": "Cieľ je regulárny výraz ktorý sa porovnáva s MX záznamom (.*\\.google\\.com smeruje všetku poštu určenú pre MX ktoré sú cieľom pre google.com cez tento skok)", "main_name": "\"mailcow UI\" názov", "merged_vars_hint": "Sivé riadky boli načítané z vars.(local.)inc.php a nemôžu byť modifikované cez UI.", "message": "Správa", @@ -539,7 +539,7 @@ "inactive": "Neaktívny", "kind": "Druh", "last_modified": "Naposledy upravené", - "lookup_mx": "Cieľ je regulárny výraz ktorý sa zhoduje s MX záznamom (.*google\\.com smeruje všetku poštu na MX ktoré sú cieľom pre google.com cez tento skok)", + "lookup_mx": "Cieľ je regulárny výraz ktorý sa zhoduje s MX záznamom (.*\\.google\\.com smeruje všetku poštu na MX ktoré sú cieľom pre google.com cez tento skok)", "mailbox": "Upraviť mailovú schránku", "mailbox_quota_def": "Predvolená veľkosť mailovej schránky", "mailbox_relayhost_info": "Aplikované len na používateľské schránky a priame aliasy, prepisuje doménového preposielateľa.", diff --git a/data/web/lang/lang.zh-cn.json b/data/web/lang/lang.zh-cn.json index e57ea2a7..90888efd 100644 --- a/data/web/lang/lang.zh-cn.json +++ b/data/web/lang/lang.zh-cn.json @@ -213,7 +213,7 @@ "loading": "请等待...", "login_time": "登录时间", "logo_info": "你的图片将会在顶部导航栏被缩放为 40px 高,在起始页被缩放为最大 250px 高。强烈推荐使用能较好适应缩放的图片。", - "lookup_mx": "应当为一个正则表达式,用于匹配 MX 记录 (例如 .*google\\.com 将转发所有拥有以 google.com 结尾的 MX 记录的邮件)", + "lookup_mx": "应当为一个正则表达式,用于匹配 MX 记录 (例如 .*\\.google\\.com 将转发所有拥有以 google.com 结尾的 MX 记录的邮件)", "main_name": "Mailcow UI 的名称", "merged_vars_hint": "灰色行来自 vars.(local.)inc.php 文件并且无法修改。", "message": "消息", @@ -544,7 +544,7 @@ "hostname": "主机名", "inactive": "禁用", "kind": "类型", - "lookup_mx": "应当为一个正则表达式,用于匹配 MX 记录 (例如 .*google\\.com 将转发所有拥有以 google.com 结尾的 MX 记录的邮件)", + "lookup_mx": "应当为一个正则表达式,用于匹配 MX 记录 (例如 .*\\.google\\.com 将转发所有拥有以 google.com 结尾的 MX 记录的邮件)", "mailbox": "编辑邮箱", "mailbox_quota_def": "邮箱默认配额", "mailbox_relayhost_info": "只适用于邮箱和邮箱别名,不会覆盖域名的中继主机。", diff --git a/data/web/lang/lang.zh-tw.json b/data/web/lang/lang.zh-tw.json index 916188db..ff9ed334 100644 --- a/data/web/lang/lang.zh-tw.json +++ b/data/web/lang/lang.zh-tw.json @@ -213,7 +213,7 @@ "loading": "請稍等...", "login_time": "登入時間", "logo_info": "你的起始頁面圖片會在頂部導覽列的限制下被縮放為 40px 高,以及最大 250px 高度。強烈推薦使用能較好縮放的圖片。", - "lookup_mx": "目的地是可以用來匹配 MX 紀錄的正規表達式 (.*google\\.com 會將所有 MX 結尾於 google.com 的郵件轉發到此主機。)", + "lookup_mx": "目的地是可以用來匹配 MX 紀錄的正規表達式 (.*\\.google\\.com 會將所有 MX 結尾於 google.com 的郵件轉發到此主機。)", "main_name": "\"mailcow UI\" 名稱", "merged_vars_hint": "灰色列來自 vars.(local.)inc.php 並且不能修改。", "message": "訊息", @@ -540,7 +540,7 @@ "inactive": "停用", "kind": "種類", "last_modified": "上次修改時間", - "lookup_mx": "目的地是可以用來匹配 MX 紀錄的正規表達式 (.*google\\.com 會將所有 MX 結尾於 google.com 的郵件轉發到此主機。)", + "lookup_mx": "目的地是可以用來匹配 MX 紀錄的正規表達式 (.*\\.google\\.com 會將所有 MX 結尾於 google.com 的郵件轉發到此主機。)", "mailbox": "編輯信箱", "mailbox_quota_def": "預設信箱容量配額", "mailbox_relayhost_info": "只會套用於信箱和直接別名,不會覆寫域名中繼主機。", From aabcd1053969e7bd3601c0dd7e7aa3e5b333cb97 Mon Sep 17 00:00:00 2001 From: FreddleSpl0it Date: Wed, 3 May 2023 09:59:49 +0200 Subject: [PATCH 94/94] [Web] fix bcc localdest selectpicker --- data/web/js/site/mailbox.js | 56 ++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/data/web/js/site/mailbox.js b/data/web/js/site/mailbox.js index d7fca848..3ddeea94 100644 --- a/data/web/js/site/mailbox.js +++ b/data/web/js/site/mailbox.js @@ -1458,30 +1458,37 @@ jQuery(function($){ } function draw_bcc_table() { $.get("/api/v1/get/bcc-destination-options", function(data){ + var optgroup = ""; // Domains - var optgroup = ""; - $.each(data.domains, function(index, domain){ - optgroup += ""; - }); - optgroup += ""; - $('#bcc-local-dest').append(optgroup); - // Alias domains - var optgroup = ""; - $.each(data.alias_domains, function(index, alias_domain){ - optgroup += ""; - }); - optgroup += "" - $('#bcc-local-dest').append(optgroup); - // Mailboxes and aliases - $.each(data.mailboxes, function(mailbox, aliases){ - var optgroup = ""; - $.each(aliases, function(index, alias){ - optgroup += ""; + if (data.domains && data.domains.length > 0) { + optgroup = ""; + $.each(data.domains, function(index, domain){ + optgroup += ""; }); optgroup += ""; $('#bcc-local-dest').append(optgroup); - }); - // Finish + } + // Alias domains + if (data.alias_domains && data.alias_domains.length > 0) { + optgroup = ""; + $.each(data.alias_domains, function(index, alias_domain){ + optgroup += ""; + }); + optgroup += "" + $('#bcc-local-dest').append(optgroup); + } + // Mailboxes and aliases + if (data.mailboxes && Object.keys(data.mailboxes).length > 0) { + $.each(data.mailboxes, function(mailbox, aliases){ + optgroup = ""; + $.each(aliases, function(index, alias){ + optgroup += ""; + }); + optgroup += ""; + $('#bcc-local-dest').append(optgroup); + }); + } + // Recreate picker $('#bcc-local-dest').selectpicker('refresh'); }); @@ -2326,16 +2333,19 @@ jQuery(function($){ // detect element visibility changes function onVisible(element, callback) { $(document).ready(function() { - element_object = document.querySelector(element); + let element_object = document.querySelector(element); if (element_object === null) return; - new IntersectionObserver((entries, observer) => { + let observer = new IntersectionObserver((entries, observer) => { entries.forEach(entry => { if(entry.intersectionRatio > 0) { callback(element_object); + observer.unobserve(element_object); } }); - }).observe(element_object); + }) + + observer.observe(element_object); }); }