diff --git a/data/Dockerfiles/sogo/reconf-domains.sh b/data/Dockerfiles/sogo/reconf-domains.sh index f4cd26aa..7ec4e173 100755 --- a/data/Dockerfiles/sogo/reconf-domains.sh +++ b/data/Dockerfiles/sogo/reconf-domains.sh @@ -8,10 +8,9 @@ while mysqladmin ping --host mysql --silent; do mysql --host mysql -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "DROP VIEW IF EXISTS sogo_view" mysql --host mysql -u ${DBUSER} -p${DBPASS} ${DBNAME} << EOF -CREATE VIEW sogo_view (c_uid, domain, c_name, c_password, c_cn, mail, aliases, ad_aliases, senderacl, home, kind, multiple_bookings) AS -SELECT mailbox.username, mailbox.domain, mailbox.username, mailbox.password, mailbox.name, mailbox.username, IFNULL(ga.aliases, ''), IFNULL(gda.ad_alias, ''), IFNULL(gs.send_as, ''), CONCAT('/var/vmail/', maildir), mailbox.kind, mailbox.multiple_bookings FROM mailbox +CREATE VIEW sogo_view (c_uid, domain, c_name, c_password, c_cn, mail, aliases, ad_aliases, home, kind, multiple_bookings) AS +SELECT mailbox.username, mailbox.domain, mailbox.username, mailbox.password, mailbox.name, mailbox.username, IFNULL(ga.aliases, ''), IFNULL(gda.ad_alias, ''), CONCAT('/var/vmail/', maildir), mailbox.kind, mailbox.multiple_bookings FROM mailbox LEFT OUTER JOIN grouped_mail_aliases ga ON ga.username = mailbox.username -LEFT OUTER JOIN grouped_sender_acl gs ON gs.username = mailbox.username LEFT OUTER JOIN grouped_domain_alias_address gda ON gda.username = mailbox.username WHERE mailbox.active = '1'; EOF @@ -50,11 +49,10 @@ EOF # Generate multi-domain setup while read line do - DOMAIN_SANE=$(echo ${line} | tr '-' 'b' | tr '.' 'p' | tr -cd '[[:alnum:]]') echo " ${line} SOGoMailDomain - ${DOMAIN_SANE} + ${line} SOGoUserSources @@ -62,7 +60,6 @@ while read line aliases ad_aliases - senderacl KindFieldName kind @@ -98,4 +95,4 @@ chmod 600 /var/lib/sogo/GNUstep/Defaults/sogod.plist sleep 99999 -done; +done diff --git a/data/conf/nginx/site.conf b/data/conf/nginx/site.conf index b349adc1..467b56e4 100644 --- a/data/conf/nginx/site.conf +++ b/data/conf/nginx/site.conf @@ -39,7 +39,7 @@ server { rewrite ^(/save.+)$ /rspamd$1 last; location /rspamd/ { - proxy_pass http://rspamd:11334/; + proxy_pass http://172.22.1.253:11334/; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; add_header Strict-Transport-Security "max-age=31536000; includeSubdomains"; @@ -61,7 +61,7 @@ server { } location ^~ /Microsoft-Server-ActiveSync { - proxy_pass http://sogo:20000/SOGo/Microsoft-Server-ActiveSync; + proxy_pass http://172.22.1.252:20000/SOGo/Microsoft-Server-ActiveSync; proxy_connect_timeout 1000; proxy_next_upstream timeout error; proxy_send_timeout 1000; @@ -83,7 +83,7 @@ server { } location ^~ /SOGo { - proxy_pass http://sogo:20000; + proxy_pass http://172.22.1.252:20000; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; @@ -105,7 +105,7 @@ server { } location /SOGo.woa/WebServerResources/ { - proxy_pass http://sogo:9192/WebServerResources/; + proxy_pass http://172.22.1.252:9192/WebServerResources/; proxy_set_header Host $host; proxy_cache sogo; proxy_cache_valid 200 1d; @@ -115,7 +115,7 @@ server { } location /SOGo/WebServerResources/ { - proxy_pass http://sogo:9192/WebServerResources/; + proxy_pass http://172.22.1.252:9192/WebServerResources/; proxy_set_header Host $host; proxy_cache sogo; proxy_cache_valid 200 1d; @@ -125,7 +125,7 @@ server { } location (^/SOGo/so/ControlPanel/Products/[^/]*UI/Resources/.*\.(jpg|png|gif|css|js)$ { - proxy_pass http://sogo:9192/$1.SOGo/Resources/$2; + proxy_pass http://172.22.1.252:9192/$1.SOGo/Resources/$2; proxy_set_header Host $host; proxy_cache sogo; proxy_cache_valid 200 1d; diff --git a/data/conf/rspamd/dynmaps/tags.php b/data/conf/rspamd/dynmaps/tags.php index cc6435fe..a084d141 100644 --- a/data/conf/rspamd/dynmaps/tags.php +++ b/data/conf/rspamd/dynmaps/tags.php @@ -14,4 +14,9 @@ $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); while ($row = array_shift($rows)) { echo strtolower(trim($row['username'])) . PHP_EOL; } -?> \ No newline at end of file +$stmt = $pdo->query("SELECT CONCAT(mailbox.local_part, '@', alias_domain.alias_domain) as `tag_ad` FROM `mailbox` INNER JOIN `alias_domain` ON mailbox.domain = alias_domain.target_domain WHERE mailbox.wants_tagged_subject='1';"); +$rows = $stmt->fetchAll(PDO::FETCH_ASSOC); +while ($row = array_shift($rows)) { + echo strtolower(trim($row['tag_ad'])) . PHP_EOL; +} +?> diff --git a/data/conf/rspamd/lua/rspamd.local.lua b/data/conf/rspamd/lua/rspamd.local.lua index 7e254d3b..0d74e9d0 100644 --- a/data/conf/rspamd/lua/rspamd.local.lua +++ b/data/conf/rspamd/lua/rspamd.local.lua @@ -27,11 +27,25 @@ rspamd_config.ADD_DELIMITER_TAG = { callback = function(task) local util = require("rspamd_util") local rspamd_logger = require "rspamd_logger" - local user_tagged = task:get_recipients(1)[1]['user'] + + local user_env_tagged = task:get_recipients(1)[1]['user'] + local user_to_tagged = task:get_recipients(2)[1]['user'] + local domain = task:get_recipients(1)[1]['domain'] - local user, tag = user_tagged:match("([^+]+)+(.*)") + + local user_env, tag_env = user_env_tagged:match("([^+]+)+(.*)") + local user_to, tag_to = user_to_tagged:match("([^+]+)+(.*)") + local authdomain = auth_domain_map:get_key(domain) + if tag_env then + tag = tag_env + user = user_env + elseif tag_to then + tag = tag_to + user = user_env + end + if tag and authdomain then rspamd_logger.infox("Domain %s is part of mailcow, start reading tag settings", domain) local user_untagged = user .. '@' .. domain @@ -40,12 +54,12 @@ rspamd_config.ADD_DELIMITER_TAG = { rspamd_logger.infox("User wants subject modified for tagged mail") local sbj = task:get_header('Subject') if tag then - rspamd_logger.infox("Found tag %1, will modify subject header", tag) - new_sbj = '=?UTF-8?B?' .. tostring(util.encode_base64('[' .. tag .. '] ' .. sbj)) .. '?=' - task:set_rmilter_reply({ - remove_headers = {['Subject'] = 1}, - add_headers = {['Subject'] = new_sbj} - }) + rspamd_logger.infox("Found tag %1, will modify subject header", tag) + new_sbj = '=?UTF-8?B?' .. tostring(util.encode_base64('[' .. tag .. '] ' .. sbj)) .. '?=' + task:set_rmilter_reply({ + remove_headers = {['Subject'] = 1}, + add_headers = {['Subject'] = new_sbj} + }) end else rspamd_logger.infox("Add X-Moo-Tag header") diff --git a/data/web/admin.php b/data/web/admin.php index 4397a279..5377616f 100644 --- a/data/web/admin.php +++ b/data/web/admin.php @@ -4,6 +4,7 @@ require_once("inc/prerequisites.inc.php"); if (isset($_SESSION['mailcow_cc_role']) && $_SESSION['mailcow_cc_role'] == "admin") { require_once("inc/header.inc.php"); $_SESSION['return_to'] = $_SERVER['REQUEST_URI']; +$tfa_data = get_tfa(); ?>

@@ -43,12 +44,26 @@ $_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
:
-

+

+
+ +
+ +
+ + [] +
+
+ +
+
-
:
-
+
:
+
+
diff --git a/data/web/inc/footer.inc.php b/data/web/inc/footer.inc.php index d250fc0b..5523ec58 100644 --- a/data/web/inc/footer.inc.php +++ b/data/web/inc/footer.inc.php @@ -24,9 +24,9 @@ endif; ?>
- - - + + + - - - + + + @@ -45,6 +45,7 @@ diff --git a/data/web/inc/prerequisites.inc.php b/data/web/inc/prerequisites.inc.php index 52f9a0f1..0a9ba2e7 100644 --- a/data/web/inc/prerequisites.inc.php +++ b/data/web/inc/prerequisites.inc.php @@ -22,10 +22,8 @@ if (file_exists('./inc/vars.local.inc.php')) { } // Yubi OTP API -if (!empty($YUBI_API['ID']) && !empty($YUBI_API['KEY'])) { - require_once 'inc/lib/Yubico.php'; - $yubi = new Auth_Yubico($YUBI_API['ID'], $YUBI_API['KEY']); -} +require_once 'inc/lib/Yubico.php'; + // U2F API require_once 'inc/lib/U2F.php'; $scheme = isset($_SERVER['HTTPS']) ? "https://" : "http://"; @@ -59,6 +57,10 @@ if (isset($_COOKIE['language'])) { $_SESSION['mailcow_locale'] = 'en'; setcookie('language', 'en'); break; + case "es": + $_SESSION['mailcow_locale'] = 'es'; + setcookie('language', 'es'); + break; case "nl": $_SESSION['mailcow_locale'] = 'nl'; setcookie('language', 'nl'); @@ -79,6 +81,10 @@ if (isset($_GET['lang'])) { $_SESSION['mailcow_locale'] = 'en'; setcookie('language', 'en'); break; + case "es": + $_SESSION['mailcow_locale'] = 'es'; + setcookie('language', 'es'); + break; case "nl": $_SESSION['mailcow_locale'] = 'nl'; setcookie('language', 'nl'); diff --git a/data/web/inc/tfa_modals.php b/data/web/inc/tfa_modals.php index 39c841f5..d6956724 100644 --- a/data/web/inc/tfa_modals.php +++ b/data/web/inc/tfa_modals.php @@ -4,6 +4,18 @@