mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2026-11-22 06:04:22 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
50ff094980 |
No files matched your search
@@ -1,76 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# _modules/scripts/backup.sh
|
|
||||||
# THIS SCRIPT IS DESIGNED TO BE RUNNING BY MAILCOW SCRIPTS ONLY!
|
|
||||||
# DO NOT, AGAIN, NOT TRY TO RUN THIS SCRIPT STANDALONE!!!!!!
|
|
||||||
|
|
||||||
# Backup with restic before the update when it is set up (target, confirmed password, initialized repository):
|
|
||||||
# interactive: asked for; --backup: without asking; --force: none (with --backup: without asking, a failure or a backup
|
|
||||||
# that cannot run stops the update; only "not set up" continues)
|
|
||||||
backup_failed() {
|
|
||||||
echo -e "\e[31m${1}\e[0m"
|
|
||||||
if [ "$FORCE" ]; then
|
|
||||||
echo "The update was started with --force --backup, it stops here. Nothing was changed."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
read -r -p "Continue the update without a backup? [y/N] " backup_response
|
|
||||||
if [[ ! "${backup_response}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
|
|
||||||
echo "OK, exiting."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# Whether to back up (asked with the other questions); the backup itself runs before the first change of the checkout
|
|
||||||
backup_decide() {
|
|
||||||
local output rc
|
|
||||||
# exported: update.sh restarts itself after a branch switch, the decision and a backup already made stay
|
|
||||||
if [ "$MAILCOW_UPDATE_BACKUP_DECIDED" ]; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
export MAILCOW_UPDATE_BACKUP_DECIDED=y
|
|
||||||
export RUN_BACKUP=
|
|
||||||
if [ "$FORCE" ] && [ ! "$BACKUP" ]; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
if [[ -z "$($COMPOSE_COMMAND ps -q restic-mailcow 2> /dev/null)" ]]; then
|
|
||||||
output="the backup container does not run"
|
|
||||||
rc=1
|
|
||||||
else
|
|
||||||
# exit code 0: set up, 2: not set up, others: error (e.g. credentials this container cannot read)
|
|
||||||
output=$($COMPOSE_COMMAND exec -T restic-mailcow python3 /usr/local/bin/restic_runner.py --configured 2>&1 < /dev/null)
|
|
||||||
rc=$?
|
|
||||||
fi
|
|
||||||
if [[ ${rc} -eq 2 ]]; then
|
|
||||||
[ "$BACKUP" ] && echo -e "\e[33mNo backup before the update: ${output}.\e[0m"
|
|
||||||
return 0
|
|
||||||
elif [[ ${rc} -ne 0 ]]; then
|
|
||||||
if [ "$BACKUP" ]; then
|
|
||||||
backup_failed "No backup before the update possible: ${output}"
|
|
||||||
elif [[ -n "$($COMPOSE_COMMAND ps -q restic-mailcow 2> /dev/null)" ]]; then
|
|
||||||
echo -e "\e[33mNo backup before the update: ${output}\e[0m"
|
|
||||||
fi
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
if [ ! "$BACKUP" ]; then
|
|
||||||
read -r -p "Create a backup before the update? [Y/n] " backup_response
|
|
||||||
if [[ "${backup_response}" =~ ^([nN][oO]|[nN])$ ]]; then
|
|
||||||
echo "OK, no backup."
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
RUN_BACKUP=y
|
|
||||||
}
|
|
||||||
|
|
||||||
# The backup chosen by backup_decide, once
|
|
||||||
backup_run() {
|
|
||||||
if [ ! "$RUN_BACKUP" ]; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
RUN_BACKUP=
|
|
||||||
if [[ "${RESTIC_BACKUP_MODE}" =~ ^(data|config)$ ]]; then
|
|
||||||
echo -e "\e[33mRESTIC_BACKUP_MODE=${RESTIC_BACKUP_MODE}: the backup holds no complete mailcow directory, a restore does not bring back this mailcow version.\e[0m"
|
|
||||||
fi
|
|
||||||
echo -e "\e[32mCreating a backup before the update...\e[0m"
|
|
||||||
if ! $COMPOSE_COMMAND exec -T restic-mailcow python3 /usr/local/bin/restic_runner.py --backup < /dev/null; then
|
|
||||||
backup_failed "The backup before the update failed, see the output above and the backup jobs in the mailcow UI."
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
@@ -192,7 +192,6 @@ detect_major_update() {
|
|||||||
"2025-02"
|
"2025-02"
|
||||||
"2025-03"
|
"2025-03"
|
||||||
"2025-09"
|
"2025-09"
|
||||||
"2026-11"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
current_version=""
|
current_version=""
|
||||||
|
|||||||
@@ -3,11 +3,6 @@
|
|||||||
# THIS SCRIPT IS DESIGNED TO BE RUNNING BY MAILCOW SCRIPTS ONLY!
|
# THIS SCRIPT IS DESIGNED TO BE RUNNING BY MAILCOW SCRIPTS ONLY!
|
||||||
# DO NOT, AGAIN, NOT TRY TO RUN THIS SCRIPT STANDALONE!!!!!!
|
# DO NOT, AGAIN, NOT TRY TO RUN THIS SCRIPT STANDALONE!!!!!!
|
||||||
|
|
||||||
# Global IPv6 address that is no unique local address (fc00::/7, e.g. Docker bridges)
|
|
||||||
_has_public_ipv6() {
|
|
||||||
ip -6 -o addr show scope global 2>/dev/null | awk '{print $4}' | grep -qviE '^f[cd]'
|
|
||||||
}
|
|
||||||
|
|
||||||
# 1) Check if the host supports IPv6
|
# 1) Check if the host supports IPv6
|
||||||
get_ipv6_support() {
|
get_ipv6_support() {
|
||||||
# ---- helper: probe external IPv6 connectivity without DNS ----
|
# ---- helper: probe external IPv6 connectivity without DNS ----
|
||||||
@@ -42,9 +37,6 @@ get_ipv6_support() {
|
|||||||
if _probe_ipv6_connectivity; then
|
if _probe_ipv6_connectivity; then
|
||||||
DETECTED_IPV6=true
|
DETECTED_IPV6=true
|
||||||
echo -e "IPv6 detected on host – ${LIGHT_GREEN}leaving IPv6 support enabled${YELLOW}.${NC}"
|
echo -e "IPv6 detected on host – ${LIGHT_GREEN}leaving IPv6 support enabled${YELLOW}.${NC}"
|
||||||
elif _has_public_ipv6; then
|
|
||||||
DETECTED_IPV6=true
|
|
||||||
echo -e "${YELLOW}External IPv6 connectivity test failed, but the host has a public IPv6 address – ${LIGHT_GREEN}leaving IPv6 support enabled${YELLOW}.${NC}"
|
|
||||||
else
|
else
|
||||||
DETECTED_IPV6=false
|
DETECTED_IPV6=false
|
||||||
echo -e "${YELLOW}Default IPv6 route present but external IPv6 connectivity failed – ${LIGHT_RED}disabling IPv6 support${YELLOW}.${NC}"
|
echo -e "${YELLOW}Default IPv6 route present but external IPv6 connectivity failed – ${LIGHT_RED}disabling IPv6 support${YELLOW}.${NC}"
|
||||||
@@ -200,31 +192,9 @@ EOF
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
_set_enable_ipv6() {
|
|
||||||
if [[ -n "$MAILCOW_CONF" && -f "$MAILCOW_CONF" ]]; then
|
|
||||||
if grep -q '^ENABLE_IPV6=' "$MAILCOW_CONF"; then
|
|
||||||
sed -i "s/^ENABLE_IPV6=.*/ENABLE_IPV6=$1/" "$MAILCOW_CONF"
|
|
||||||
else
|
|
||||||
echo "ENABLE_IPV6=$1" >> "$MAILCOW_CONF"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
export IPV6_BOOL=$1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
_warn_ipv6_disabled() {
|
|
||||||
_has_public_ipv6 || return 0
|
|
||||||
ip -6 route show default 2>/dev/null | grep -qE '^default' || return 0
|
|
||||||
grep -Eq '"userland-proxy"[[:space:]]*:[[:space:]]*false' /etc/docker/daemon.json 2>/dev/null && return 0
|
|
||||||
echo -e "${LIGHT_RED}WARNING: ENABLE_IPV6=false, but this host has a public IPv6 address.${NC}"
|
|
||||||
echo -e "${YELLOW}Docker forwards IPv6 connections to mailcow with an internal source address, which Postfix trusts. This can make your server an open relay over IPv6.${NC}"
|
|
||||||
echo -e "${YELLOW}Set ENABLE_IPV6=true in mailcow.conf, or set \"userland-proxy\": false in /etc/docker/daemon.json and restart Docker.${NC}"
|
|
||||||
echo -e "${YELLOW}See https://docs.mailcow.email/post_installation/firststeps-disable_ipv6/${NC}"
|
|
||||||
sleep 5
|
|
||||||
}
|
|
||||||
|
|
||||||
# 3) Main wrapper for generate_config.sh and update.sh
|
# 3) Main wrapper for generate_config.sh and update.sh
|
||||||
configure_ipv6() {
|
configure_ipv6() {
|
||||||
|
# detect manual override if mailcow.conf is present
|
||||||
if [[ -n "$MAILCOW_CONF" && -f "$MAILCOW_CONF" ]] && grep -q '^ENABLE_IPV6=' "$MAILCOW_CONF"; then
|
if [[ -n "$MAILCOW_CONF" && -f "$MAILCOW_CONF" ]] && grep -q '^ENABLE_IPV6=' "$MAILCOW_CONF"; then
|
||||||
MANUAL_SETTING=$(grep '^ENABLE_IPV6=' "$MAILCOW_CONF" | cut -d= -f2)
|
MANUAL_SETTING=$(grep '^ENABLE_IPV6=' "$MAILCOW_CONF" | cut -d= -f2)
|
||||||
elif [[ -z "$MAILCOW_CONF" ]] && [[ -n "${ENABLE_IPV6:-}" ]]; then
|
elif [[ -z "$MAILCOW_CONF" ]] && [[ -n "${ENABLE_IPV6:-}" ]]; then
|
||||||
@@ -233,23 +203,19 @@ configure_ipv6() {
|
|||||||
MANUAL_SETTING=""
|
MANUAL_SETTING=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${MANUAL_SETTING,,}" == "false" ]]; then
|
|
||||||
_set_enable_ipv6 false
|
|
||||||
echo "ENABLE_IPV6=false is set, skipping Docker IPv6 configuration."
|
|
||||||
_warn_ipv6_disabled
|
|
||||||
echo "IPv6 configuration complete: ENABLE_IPV6=false"
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
get_ipv6_support
|
get_ipv6_support
|
||||||
|
|
||||||
if [[ "$DETECTED_IPV6" != "true" && "${MANUAL_SETTING,,}" == "true" ]] && _has_public_ipv6; then
|
# if user manually set it, check for mismatch
|
||||||
echo -e "${YELLOW}Keeping ENABLE_IPV6=true, the host has a public IPv6 address.${NC}"
|
|
||||||
DETECTED_IPV6=true
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$DETECTED_IPV6" != "true" ]]; then
|
if [[ "$DETECTED_IPV6" != "true" ]]; then
|
||||||
_set_enable_ipv6 false
|
if [[ -n "$MAILCOW_CONF" && -f "$MAILCOW_CONF" ]]; then
|
||||||
|
if grep -q '^ENABLE_IPV6=' "$MAILCOW_CONF"; then
|
||||||
|
sed -i 's/^ENABLE_IPV6=.*/ENABLE_IPV6=false/' "$MAILCOW_CONF"
|
||||||
|
else
|
||||||
|
echo "ENABLE_IPV6=false" >> "$MAILCOW_CONF"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
export IPV6_BOOL=false
|
||||||
|
fi
|
||||||
echo "Skipping Docker IPv6 configuration because host does not support IPv6."
|
echo "Skipping Docker IPv6 configuration because host does not support IPv6."
|
||||||
echo "Make sure to check if your docker daemon.json does not include \"enable_ipv6\": true if you do not want IPv6."
|
echo "Make sure to check if your docker daemon.json does not include \"enable_ipv6\": true if you do not want IPv6."
|
||||||
echo "IPv6 configuration complete: ENABLE_IPV6=false"
|
echo "IPv6 configuration complete: ENABLE_IPV6=false"
|
||||||
@@ -258,7 +224,16 @@ configure_ipv6() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
docker_daemon_edit
|
docker_daemon_edit
|
||||||
_set_enable_ipv6 true
|
|
||||||
|
if [[ -n "$MAILCOW_CONF" && -f "$MAILCOW_CONF" ]]; then
|
||||||
|
if grep -q '^ENABLE_IPV6=' "$MAILCOW_CONF"; then
|
||||||
|
sed -i 's/^ENABLE_IPV6=.*/ENABLE_IPV6=true/' "$MAILCOW_CONF"
|
||||||
|
else
|
||||||
|
echo "ENABLE_IPV6=true" >> "$MAILCOW_CONF"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
export IPV6_BOOL=true
|
||||||
|
fi
|
||||||
|
|
||||||
echo "IPv6 configuration complete: ENABLE_IPV6=true"
|
echo "IPv6 configuration complete: ENABLE_IPV6=true"
|
||||||
}
|
}
|
||||||
@@ -60,9 +60,6 @@ adapt_new_options() {
|
|||||||
"ACME_DNS_CHALLENGE"
|
"ACME_DNS_CHALLENGE"
|
||||||
"ACME_DNS_PROVIDER"
|
"ACME_DNS_PROVIDER"
|
||||||
"ACME_ACCOUNT_EMAIL"
|
"ACME_ACCOUNT_EMAIL"
|
||||||
"NGINX_MAX_BODY_SIZE"
|
|
||||||
"RESTIC_LOCAL_PATH"
|
|
||||||
"RESTIC_BACKUP_MODE"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
sed -i --follow-symlinks '$a\' mailcow.conf
|
sed -i --follow-symlinks '$a\' mailcow.conf
|
||||||
@@ -312,24 +309,6 @@ adapt_new_options() {
|
|||||||
echo '# Account email for ACME DNS-01 challenge registration' >> mailcow.conf
|
echo '# Account email for ACME DNS-01 challenge registration' >> mailcow.conf
|
||||||
echo 'ACME_ACCOUNT_EMAIL=me@example.com' >> mailcow.conf
|
echo 'ACME_ACCOUNT_EMAIL=me@example.com' >> mailcow.conf
|
||||||
;;
|
;;
|
||||||
NGINX_MAX_BODY_SIZE)
|
|
||||||
echo '# Maximum request size for SOGo webmail, CalDAV/CardDAV and ActiveSync, e.g. 128m or 1g - 0 means unlimited' >> mailcow.conf
|
|
||||||
echo '# Keep it above the message size limit of Postfix (100 MB by default). The mailcow UI and API stay limited to 64m.' >> mailcow.conf
|
|
||||||
echo 'NGINX_MAX_BODY_SIZE=128m' >> mailcow.conf
|
|
||||||
;;
|
|
||||||
RESTIC_LOCAL_PATH)
|
|
||||||
echo '# Folder on the host for backups to the target "local" (backup settings in the mailcow UI), as an absolute path,' >> mailcow.conf
|
|
||||||
echo '# e.g. a NAS mounted from another disk. The repository is created in a subfolder of it.' >> mailcow.conf
|
|
||||||
echo '# Empty: the Docker volume restic-repo-vol-1 of mailcow, on the same disk as the mailcow data.' >> mailcow.conf
|
|
||||||
echo 'RESTIC_LOCAL_PATH=' >> mailcow.conf
|
|
||||||
;;
|
|
||||||
RESTIC_BACKUP_MODE)
|
|
||||||
echo '# What the backups of the mailcow UI hold:' >> mailcow.conf
|
|
||||||
echo '# - all (default),' >> mailcow.conf
|
|
||||||
echo '# - data (vmail, vmail-index, database, redis, mail crypt keys and mailcow.conf)' >> mailcow.conf
|
|
||||||
echo '# - config (database, redis, mail crypt keys, mailcow.conf and data/conf).' >> mailcow.conf
|
|
||||||
echo 'RESTIC_BACKUP_MODE=all' >> mailcow.conf
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
echo "${option}=" >> mailcow.conf
|
echo "${option}=" >> mailcow.conf
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
FROM alpine:3.24 AS builder
|
FROM alpine:3.24 AS builder
|
||||||
|
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
ENV CLAMD_VERSION=1.4.7
|
ENV CLAMD_VERSION=1.4.6
|
||||||
|
|
||||||
RUN apk upgrade --no-cache \
|
RUN apk upgrade --no-cache \
|
||||||
&& apk add --update --no-cache \
|
&& apk add --update --no-cache \
|
||||||
|
|||||||
@@ -159,9 +159,6 @@ async def post_containers(container_id : str, post_action : str, request: Reques
|
|||||||
api_call_method = getattr(dockerapi, api_call_method_name, lambda container_id: Response(content=json.dumps({'type': 'danger', 'msg':'container_post - unknown api call' }, indent=4), media_type="application/json"))
|
api_call_method = getattr(dockerapi, api_call_method_name, lambda container_id: Response(content=json.dumps({'type': 'danger', 'msg':'container_post - unknown api call' }, indent=4), media_type="application/json"))
|
||||||
|
|
||||||
dockerapi.logger.info("api call: %s, container_id: %s" % (api_call_method_name, container_id))
|
dockerapi.logger.info("api call: %s, container_id: %s" % (api_call_method_name, container_id))
|
||||||
if getattr(api_call_method, 'long_running', False):
|
|
||||||
# runs for minutes (e.g. sogo-tool of a backup restore): in a worker thread, the other api calls go on
|
|
||||||
return await asyncio.to_thread(api_call_method, request_json, container_id=container_id)
|
|
||||||
return api_call_method(request_json, container_id=container_id)
|
return api_call_method(request_json, container_id=container_id)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
dockerapi.logger.error("error - container_post: %s" % str(e))
|
dockerapi.logger.error("error - container_post: %s" % str(e))
|
||||||
|
|||||||
@@ -6,15 +6,9 @@ import time
|
|||||||
import json
|
import json
|
||||||
import asyncio
|
import asyncio
|
||||||
import platform
|
import platform
|
||||||
import docker
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from fastapi import FastAPI, Response, Request
|
from fastapi import FastAPI, Response, Request
|
||||||
|
|
||||||
def long_running(method):
|
|
||||||
"""Marks an api call that runs for minutes: main.py runs it in a worker thread, the other api calls go on"""
|
|
||||||
method.long_running = True
|
|
||||||
return method
|
|
||||||
|
|
||||||
class DockerApi:
|
class DockerApi:
|
||||||
def __init__(self, redis_client, sync_docker_client, async_docker_client, logger):
|
def __init__(self, redis_client, sync_docker_client, async_docker_client, logger):
|
||||||
self.redis_client = redis_client
|
self.redis_client = redis_client
|
||||||
@@ -324,7 +318,7 @@ class DockerApi:
|
|||||||
|
|
||||||
if 'username' in request_json and 'script_name' in request_json:
|
if 'username' in request_json and 'script_name' in request_json:
|
||||||
for container in self.sync_docker_client.containers.list(filters=filters):
|
for container in self.sync_docker_client.containers.list(filters=filters):
|
||||||
cmd = ["/bin/bash", "-c", "/usr/bin/doveadm sieve get -u '" + request_json['username'].replace("'", "'\\''") + "' -- '" + request_json['script_name'].replace("'", "'\\''") + "'"]
|
cmd = ["/bin/bash", "-c", "/usr/bin/doveadm sieve get -u '" + request_json['username'].replace("'", "'\\''") + "' '" + request_json['script_name'].replace("'", "'\\''") + "'"]
|
||||||
sieve_return = container.exec_run(cmd)
|
sieve_return = container.exec_run(cmd)
|
||||||
return self.exec_run_handler('utf8_text_only', sieve_return)
|
return self.exec_run_handler('utf8_text_only', sieve_return)
|
||||||
# api call: container_post - post_action: exec - cmd: maildir - task: cleanup
|
# api call: container_post - post_action: exec - cmd: maildir - task: cleanup
|
||||||
@@ -451,35 +445,6 @@ class DockerApi:
|
|||||||
return Response(content=json.dumps({ 'type': 'danger', 'msg': 'users required' }, indent=4), media_type="application/json")
|
return Response(content=json.dumps({ 'type': 'danger', 'msg': 'users required' }, indent=4), media_type="application/json")
|
||||||
init_return = container.exec_run(["/bin/bash", "-c", 'for user in "$@"; do sogo-tool init-user "$user" || exit 1; done', "init_user"] + users, user='sogo')
|
init_return = container.exec_run(["/bin/bash", "-c", 'for user in "$@"; do sogo-tool init-user "$user" || exit 1; done', "init_user"] + users, user='sogo')
|
||||||
return self.exec_run_handler('generic', init_return)
|
return self.exec_run_handler('generic', init_return)
|
||||||
# api call: container_post - post_action: exec - cmd: sogo - task: restore
|
|
||||||
# Resets calendars, address books and preferences of a user to the sogo-tool backup file <dir>/<username> in a
|
|
||||||
# restore batch of the backup (/restore/<job>/b<batch>/sogo_backup, only the sogo user can read it); values are
|
|
||||||
# checked and passed as arguments, never through the shell. Runs in a worker thread (main.py) with its own client.
|
|
||||||
@long_running
|
|
||||||
def container_post__exec__sogo__restore(self, request_json, **kwargs):
|
|
||||||
if 'container_id' in kwargs:
|
|
||||||
filters = {"id": kwargs['container_id']}
|
|
||||||
elif 'container_name' in kwargs:
|
|
||||||
filters = {"name": kwargs['container_name']}
|
|
||||||
|
|
||||||
directory = str(request_json.get('dir', ''))
|
|
||||||
username = str(request_json.get('username', ''))
|
|
||||||
if (not re.fullmatch(r'/restore/[0-9]+/b[0-9]+/sogo_backup', directory)
|
|
||||||
or not re.fullmatch(r'[A-Za-z0-9_][A-Za-z0-9._+-]*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)+', username)):
|
|
||||||
return Response(content=json.dumps({ 'type': 'danger', 'msg': 'dir and username required' }, indent=4), media_type="application/json")
|
|
||||||
# the folder: no symlink, uid 999, mode 0700; the file: plain, uid 999, mode 0600. sogo-tool restores folders and
|
|
||||||
# preferences in two runs, both stopped before the runner gives up waiting (30 minutes)
|
|
||||||
script = ('[ -d "$1" ] && [ ! -L "$1" ] && [ "$(realpath -e -- "$1")" = "$1" ] && [ "$(stat -c "%u %a" -- "$1")" = "999 700" ] '
|
|
||||||
'&& [ -f "$1/$2" ] && [ ! -L "$1/$2" ] && [ "$(stat -c "%u %a" -- "$1/$2")" = "999 600" ] '
|
|
||||||
'|| { echo "invalid directory or file"; exit 1; }; '
|
|
||||||
'timeout -k 30 850 sogo-tool restore -f ALL "$1" "$2" && exec timeout -k 30 850 sogo-tool restore -p "$1" "$2"')
|
|
||||||
client = docker.DockerClient(base_url='unix:///var/run/docker.sock', version='auto', timeout=1800)
|
|
||||||
try:
|
|
||||||
for container in client.containers.list(filters=filters):
|
|
||||||
restore_return = container.exec_run(["/bin/bash", "-c", script, "restore", directory, username], user='sogo')
|
|
||||||
return self.exec_run_handler('generic', restore_return)
|
|
||||||
finally:
|
|
||||||
client.close()
|
|
||||||
# api call: container_post - post_action: exec - cmd: doveadm - task: subscribe_shared
|
# api call: container_post - post_action: exec - cmd: doveadm - task: subscribe_shared
|
||||||
# Subscribes users to every folder of a mailbox shared with them (Shared/<owner>/...), or unsubscribes them
|
# Subscribes users to every folder of a mailbox shared with them (Shared/<owner>/...), or unsubscribes them
|
||||||
def container_post__exec__doveadm__subscribe_shared(self, request_json, **kwargs):
|
def container_post__exec__doveadm__subscribe_shared(self, request_json, **kwargs):
|
||||||
@@ -526,7 +491,7 @@ class DockerApi:
|
|||||||
if mailbox in mailbox_seen:
|
if mailbox in mailbox_seen:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
acls = container.exec_run(["/bin/bash", "-c", f"doveadm acl get -u '{id}' -- '{mailbox}'"])
|
acls = container.exec_run(["/bin/bash", "-c", f"doveadm acl get -u '{id}' '{mailbox}'"])
|
||||||
acls = acls.output.decode('utf-8').strip().splitlines()
|
acls = acls.output.decode('utf-8').strip().splitlines()
|
||||||
if len(acls) >= 2:
|
if len(acls) >= 2:
|
||||||
for acl in acls[1:]:
|
for acl in acls[1:]:
|
||||||
@@ -545,7 +510,7 @@ class DockerApi:
|
|||||||
if mailbox in mailbox_seen:
|
if mailbox in mailbox_seen:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
acls = container.exec_run(["/bin/bash", "-c", f"doveadm acl get -u '{user}' -- '{mailbox}'"])
|
acls = container.exec_run(["/bin/bash", "-c", f"doveadm acl get -u '{user}' '{mailbox}'"])
|
||||||
acls = acls.output.decode('utf-8').strip().splitlines()
|
acls = acls.output.decode('utf-8').strip().splitlines()
|
||||||
if len(acls) >= 2:
|
if len(acls) >= 2:
|
||||||
for acl in acls[1:]:
|
for acl in acls[1:]:
|
||||||
@@ -569,7 +534,7 @@ class DockerApi:
|
|||||||
id = request_json['id'].replace("'", "'\\''")
|
id = request_json['id'].replace("'", "'\\''")
|
||||||
|
|
||||||
if user and mailbox and id:
|
if user and mailbox and id:
|
||||||
acl_delete_return = container.exec_run(["/bin/bash", "-c", f"doveadm acl delete -u '{user}' -- '{mailbox}' '{self.acl_identifier(id)}'"])
|
acl_delete_return = container.exec_run(["/bin/bash", "-c", f"doveadm acl delete -u '{user}' '{mailbox}' '{self.acl_identifier(id)}'"])
|
||||||
return self.exec_run_handler('generic', acl_delete_return)
|
return self.exec_run_handler('generic', acl_delete_return)
|
||||||
# api call: container_post - post_action: exec - cmd: doveadm - task: set_acl
|
# api call: container_post - post_action: exec - cmd: doveadm - task: set_acl
|
||||||
def container_post__exec__doveadm__set_acl(self, request_json, **kwargs):
|
def container_post__exec__doveadm__set_acl(self, request_json, **kwargs):
|
||||||
@@ -603,7 +568,7 @@ class DockerApi:
|
|||||||
rights += right + " "
|
rights += right + " "
|
||||||
|
|
||||||
if user and mailbox and id and rights:
|
if user and mailbox and id and rights:
|
||||||
acl_set_return = container.exec_run(["/bin/bash", "-c", f"doveadm acl set -u '{user}' -- '{mailbox}' '{self.acl_identifier(id)}' {rights}"])
|
acl_set_return = container.exec_run(["/bin/bash", "-c", f"doveadm acl set -u '{user}' '{mailbox}' '{self.acl_identifier(id)}' {rights}"])
|
||||||
return self.exec_run_handler('generic', acl_set_return)
|
return self.exec_run_handler('generic', acl_set_return)
|
||||||
# api call: container_post - post_action: exec - cmd: doveadm - task: set_acl_all
|
# api call: container_post - post_action: exec - cmd: doveadm - task: set_acl_all
|
||||||
# Sets the rights of an identifier on every folder of a mailbox, no rights = delete; values are passed as
|
# Sets the rights of an identifier on every folder of a mailbox, no rights = delete; values are passed as
|
||||||
@@ -620,9 +585,9 @@ class DockerApi:
|
|||||||
rights = [right.lower() for right in request_json.get('rights', []) if right.lower() in self.acl_rights]
|
rights = [right.lower() for right in request_json.get('rights', []) if right.lower() in self.acl_rights]
|
||||||
if not user or id in ('user=', 'group='):
|
if not user or id in ('user=', 'group='):
|
||||||
return Response(content=json.dumps({ 'type': 'danger', 'msg': 'user and id required' }, indent=4), media_type="application/json")
|
return Response(content=json.dumps({ 'type': 'danger', 'msg': 'user and id required' }, indent=4), media_type="application/json")
|
||||||
action = 'doveadm acl set -u "$ACL_USER" -- "$folder" "$ACL_ID" $ACL_RIGHTS' if rights else 'doveadm acl delete -u "$ACL_USER" -- "$folder" "$ACL_ID"'
|
action = 'doveadm acl set -u "$ACL_USER" "$folder" "$ACL_ID" $ACL_RIGHTS' if rights else 'doveadm acl delete -u "$ACL_USER" "$folder" "$ACL_ID"'
|
||||||
script = ('set -o pipefail; doveadm mailbox list -u "$ACL_USER" | while IFS= read -r folder; do '
|
script = ('set -o pipefail; doveadm mailbox list -u "$ACL_USER" | while IFS= read -r folder; do '
|
||||||
'case "$folder" in Shared|Shared/*) continue;; esac; ' + action + ' || exit 1; done && doveadm acl recalc -u "$ACL_USER"')
|
'case "$folder" in Shared/*) continue;; esac; ' + action + ' || exit 1; done && doveadm acl recalc -u "$ACL_USER"')
|
||||||
acl_return = container.exec_run(["/bin/bash", "-c", script],
|
acl_return = container.exec_run(["/bin/bash", "-c", script],
|
||||||
environment={ 'ACL_USER': user, 'ACL_ID': id, 'ACL_RIGHTS': ' '.join(rights) })
|
environment={ 'ACL_USER': user, 'ACL_ID': id, 'ACL_RIGHTS': ' '.join(rights) })
|
||||||
return self.exec_run_handler('generic', acl_return)
|
return self.exec_run_handler('generic', acl_return)
|
||||||
@@ -636,7 +601,7 @@ class DockerApi:
|
|||||||
|
|
||||||
for container in self.sync_docker_client.containers.list(filters=filters):
|
for container in self.sync_docker_client.containers.list(filters=filters):
|
||||||
users = [str(user) for user in request_json.get('users', []) if str(user)]
|
users = [str(user) for user in request_json.get('users', []) if str(user)]
|
||||||
flush_return = container.exec_run(["doveadm", "auth", "cache", "flush", "--"] + users)
|
flush_return = container.exec_run(["doveadm", "auth", "cache", "flush"] + users)
|
||||||
return self.exec_run_handler('generic', flush_return)
|
return self.exec_run_handler('generic', flush_return)
|
||||||
|
|
||||||
# Rights doveadm acl set accepts from the API
|
# Rights doveadm acl set accepts from the API
|
||||||
|
|||||||
@@ -150,8 +150,6 @@ COPY syslog-ng.conf /etc/syslog-ng/syslog-ng.conf
|
|||||||
COPY syslog-ng-redis_slave.conf /etc/syslog-ng/syslog-ng-redis_slave.conf
|
COPY syslog-ng-redis_slave.conf /etc/syslog-ng/syslog-ng-redis_slave.conf
|
||||||
COPY imapsync /usr/local/bin/imapsync
|
COPY imapsync /usr/local/bin/imapsync
|
||||||
COPY imapsync_runner.py /usr/local/bin/imapsync_runner.py
|
COPY imapsync_runner.py /usr/local/bin/imapsync_runner.py
|
||||||
COPY retention_runner.py /usr/local/bin/retention_runner.py
|
|
||||||
COPY restore_runner.py /usr/local/bin/restore_runner.py
|
|
||||||
COPY report-spam.sieve /usr/lib/dovecot/sieve/report-spam.sieve
|
COPY report-spam.sieve /usr/lib/dovecot/sieve/report-spam.sieve
|
||||||
COPY report-ham.sieve /usr/lib/dovecot/sieve/report-ham.sieve
|
COPY report-ham.sieve /usr/lib/dovecot/sieve/report-ham.sieve
|
||||||
COPY rspamd-pipe-ham /usr/lib/dovecot/sieve/rspamd-pipe-ham
|
COPY rspamd-pipe-ham /usr/lib/dovecot/sieve/rspamd-pipe-ham
|
||||||
|
|||||||
@@ -281,8 +281,6 @@ chown root:tty /dev/console
|
|||||||
chmod +x /usr/lib/dovecot/sieve/rspamd-pipe-ham \
|
chmod +x /usr/lib/dovecot/sieve/rspamd-pipe-ham \
|
||||||
/usr/lib/dovecot/sieve/rspamd-pipe-spam \
|
/usr/lib/dovecot/sieve/rspamd-pipe-spam \
|
||||||
/usr/local/bin/imapsync_runner.py \
|
/usr/local/bin/imapsync_runner.py \
|
||||||
/usr/local/bin/retention_runner.py \
|
|
||||||
/usr/local/bin/restore_runner.py \
|
|
||||||
/usr/local/bin/imapsync \
|
/usr/local/bin/imapsync \
|
||||||
/usr/local/bin/trim_logs.sh \
|
/usr/local/bin/trim_logs.sh \
|
||||||
/usr/local/bin/sa-rules.sh \
|
/usr/local/bin/sa-rules.sh \
|
||||||
@@ -308,20 +306,13 @@ IMAPSYNC_TABLE=$(mariadb --skip-ssl --socket=/var/run/mysqld/mysqld.sock -u ${DB
|
|||||||
echo "$(envsubst < /usr/local/bin/maildir_gc.sh)" > /usr/local/bin/maildir_gc.sh
|
echo "$(envsubst < /usr/local/bin/maildir_gc.sh)" > /usr/local/bin/maildir_gc.sh
|
||||||
|
|
||||||
# Wait for updated schema (DB_VERSION from docker-compose.yml), the userdb query reads tables the init_db of php-fpm creates on updates
|
# Wait for updated schema (DB_VERSION from docker-compose.yml), the userdb query reads tables the init_db of php-fpm creates on updates
|
||||||
# No error while the versions table is missing (fresh install, set -e)
|
DBV_NOW=$(mariadb --skip-ssl --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "SELECT version FROM versions WHERE application = 'db_schema';" -BN)
|
||||||
DBV_NOW=$(mariadb --skip-ssl --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "SELECT version FROM versions WHERE application = 'db_schema';" -BN 2>/dev/null || true)
|
while [[ "${DBV_NOW}" != "${DB_VERSION}" ]]; do
|
||||||
DBV_WAIT=0
|
|
||||||
while [[ "${DBV_NOW}" != "${DB_VERSION}" ]] && [[ ${DBV_WAIT} -lt 60 ]]; do
|
|
||||||
echo "Waiting for schema update..."
|
echo "Waiting for schema update..."
|
||||||
sleep 5
|
sleep 5
|
||||||
DBV_WAIT=$((DBV_WAIT + 1))
|
DBV_NOW=$(mariadb --skip-ssl --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "SELECT version FROM versions WHERE application = 'db_schema';" -BN)
|
||||||
DBV_NOW=$(mariadb --skip-ssl --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "SELECT version FROM versions WHERE application = 'db_schema';" -BN 2>/dev/null || true)
|
|
||||||
done
|
done
|
||||||
if [[ "${DBV_NOW}" != "${DB_VERSION}" ]]; then
|
echo "DB schema is ${DBV_NOW}"
|
||||||
echo -e "\e[31mDB schema is ${DBV_NOW}, expected ${DB_VERSION} - starting anyway, check the php-fpm log (init_db)\e[0m"
|
|
||||||
else
|
|
||||||
echo "DB schema is ${DBV_NOW}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# GUID generation
|
# GUID generation
|
||||||
while [[ ${VERSIONS_OK} != 'OK' ]]; do
|
while [[ ${VERSIONS_OK} != 'OK' ]]; do
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
import fcntl
|
import fcntl
|
||||||
import ipaddress
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import signal
|
import signal
|
||||||
import socket
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
@@ -20,15 +18,6 @@ max_output = 16 * 1024 * 1024
|
|||||||
lock_file = run_dir + '/imapsync_busy.lock'
|
lock_file = run_dir + '/imapsync_busy.lock'
|
||||||
# An OAuth run needs a token valid this long at start (half the lifetime for short-lived tokens)
|
# An OAuth run needs a token valid this long at start (half the lifetime for short-lived tokens)
|
||||||
token_min_valid = 900
|
token_min_valid = 900
|
||||||
# Custom params never passed, also when stored before (same list as CustomParams::BLOCKED in the web UI)
|
|
||||||
blocked_params = {'abort', 'delete2foldersbutnot', 'delete2foldersonly', 'logdir', 'logfile', 'maxlinelengthcmd',
|
|
||||||
'oauthrefreshcmd1', 'oauthrefreshcmd2', 'passfile1', 'passfile2', 'pidfile', 'pipemess', 'regexflag', 'regexmess',
|
|
||||||
'regextrans2', 'showpasswords', 'skipmess', 'tests', 'testsdebug', 'testslive', 'testslive6', 'testsunit', 'tmpdir'}
|
|
||||||
# imapsync only gets these variables, not the secrets of the container environment
|
|
||||||
job_env_keys = ('PATH', 'LANG', 'LC_ALL', 'TZ')
|
|
||||||
# A source must not point to mailcow itself (internal Docker network), host1 is checked before each run
|
|
||||||
internal_nets = [ipaddress.ip_network(os.environ.get('IPV4_NETWORK', '172.22.1') + '.0/24', strict=False),
|
|
||||||
ipaddress.ip_network(os.environ.get('IPV6_NETWORK', 'fd4d:6169:6c63:6f77::/64'), strict=False)]
|
|
||||||
# Refreshed tokens are written to the token files of running jobs this often, imapsync re-reads them on reconnect
|
# Refreshed tokens are written to the token files of running jobs this often, imapsync re-reads them on reconnect
|
||||||
token_sync_interval = 60
|
token_sync_interval = 60
|
||||||
|
|
||||||
@@ -36,7 +25,7 @@ token_sync_interval = 60
|
|||||||
next_sql = """SELECT i.id, i.user1, i.user2, i.password1, i.exclude, i.delete2duplicates, i.maxage,
|
next_sql = """SELECT i.id, i.user1, i.user2, i.password1, i.exclude, i.delete2duplicates, i.maxage,
|
||||||
i.subfolder2, i.delete1, i.delete2, i.automap, i.skipcrossduplicates, i.maxbytespersecond, i.custom_params,
|
i.subfolder2, i.delete1, i.delete2, i.automap, i.skipcrossduplicates, i.maxbytespersecond, i.custom_params,
|
||||||
i.subscribeall, i.timeout1, i.timeout2, i.dry, i.source_id,
|
i.subscribeall, i.timeout1, i.timeout2, i.dry, i.source_id,
|
||||||
s.host1, s.port1, s.enc1, s.verify_cert, s.auth_type, s.oauth_flow
|
s.host1, s.port1, s.enc1, s.auth_type, s.oauth_flow
|
||||||
FROM imapsync i JOIN imapsync_source s ON i.source_id = s.id
|
FROM imapsync i JOIN imapsync_source s ON i.source_id = s.id
|
||||||
WHERE i.active = 1
|
WHERE i.active = 1
|
||||||
AND s.active = 1
|
AND s.active = 1
|
||||||
@@ -117,28 +106,6 @@ def defer_job(job_id, text, exit_status):
|
|||||||
(text, exit_status, job_id))
|
(text, exit_status, job_id))
|
||||||
deferred.add(job_id)
|
deferred.add(job_id)
|
||||||
|
|
||||||
# True when host resolves to loopback, link-local or the internal network; unknown hosts are left to imapsync
|
|
||||||
def internal_host(host):
|
|
||||||
try:
|
|
||||||
addrs = {a[4][0] for a in socket.getaddrinfo(host, None)}
|
|
||||||
except (socket.gaierror, UnicodeError):
|
|
||||||
return False
|
|
||||||
for addr in addrs:
|
|
||||||
ip = ipaddress.ip_address(addr.split('%')[0])
|
|
||||||
if ip.version == 6 and ip.ipv4_mapped:
|
|
||||||
ip = ip.ipv4_mapped
|
|
||||||
if ip.is_loopback or ip.is_unspecified or ip.is_link_local or any(ip in net for net in internal_nets):
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
# SNI takes host names only
|
|
||||||
def ip_literal(host):
|
|
||||||
try:
|
|
||||||
ipaddress.ip_address(host)
|
|
||||||
return True
|
|
||||||
except ValueError:
|
|
||||||
return False
|
|
||||||
|
|
||||||
def oauth_token(j):
|
def oauth_token(j):
|
||||||
if j['oauth_flow'] == 'authorization_code':
|
if j['oauth_flow'] == 'authorization_code':
|
||||||
return query(user_token_sql, (j['source_id'], j['user2'], j['user1'])).fetchone() or {}
|
return query(user_token_sql, (j['source_id'], j['user2'], j['user1'])).fetchone() or {}
|
||||||
@@ -183,11 +150,6 @@ def prepare_job(j, global_bw, files):
|
|||||||
f.write(content)
|
f.write(content)
|
||||||
return path
|
return path
|
||||||
|
|
||||||
if internal_host(j['host1']):
|
|
||||||
finish_job(j['id'], 'Host1 %s is an address of mailcow itself, the sync job does not connect to it\n' % j['host1'], 0,
|
|
||||||
'EXIT_CONNECTION_FAILURE_HOST1')
|
|
||||||
return None
|
|
||||||
|
|
||||||
auth_type = j['auth_type'] or 'PLAIN'
|
auth_type = j['auth_type'] or 'PLAIN'
|
||||||
oauth = None
|
oauth = None
|
||||||
if auth_type == 'XOAUTH2':
|
if auth_type == 'XOAUTH2':
|
||||||
@@ -212,11 +174,7 @@ def prepare_job(j, global_bw, files):
|
|||||||
except ValueError:
|
except ValueError:
|
||||||
pairs = []
|
pairs = []
|
||||||
for p in pairs if isinstance(pairs, list) else []:
|
for p in pairs if isinstance(pairs, list) else []:
|
||||||
if not isinstance(p, dict) or not isinstance(p.get('o'), str) or not re.fullmatch(r'[a-z0-9]+', p['o']) \
|
if not isinstance(p, dict) or not isinstance(p.get('o'), str) or not re.fullmatch(r'[a-z0-9]+', p['o']):
|
||||||
or p['o'] in blocked_params:
|
|
||||||
continue
|
|
||||||
# The certificate check protects the OAuth token of the source, a job must not turn it off
|
|
||||||
if oauth and p['o'] == 'sslargs1':
|
|
||||||
continue
|
continue
|
||||||
value = '' if p.get('v') is None else str(p['v'])
|
value = '' if p.get('v') is None else str(p['v'])
|
||||||
custom_params.append('--' + p['o'] if value == '' else '--' + p['o'] + '=' + value)
|
custom_params.append('--' + p['o'] if value == '' else '--' + p['o'] + '=' + value)
|
||||||
@@ -247,13 +205,7 @@ def prepare_job(j, global_bw, files):
|
|||||||
cmd.append(opt)
|
cmd.append(opt)
|
||||||
enc1 = {'TLS': '--tls1', 'SSL': '--ssl1'}.get(j['enc1'])
|
enc1 = {'TLS': '--tls1', 'SSL': '--ssl1'}.get(j['enc1'])
|
||||||
if enc1:
|
if enc1:
|
||||||
# Mail::IMAPClient starts TLS without a host name: check the certificate against host1, not its address
|
cmd.append(enc1)
|
||||||
cmd += [enc1, '--sslargs1', 'SSL_verifycn_scheme=imap', '--sslargs1', 'SSL_verifycn_name=' + j['host1']]
|
|
||||||
if not ip_literal(j['host1']):
|
|
||||||
cmd += ['--sslargs1', 'SSL_hostname=' + j['host1']]
|
|
||||||
# imapsync does not check certificates by default; custom sslargs1 of password jobs can still change it
|
|
||||||
if j['verify_cert'] == 1:
|
|
||||||
cmd += ['--sslargs1', 'SSL_verify_mode=1']
|
|
||||||
cmd += ['--host1', j['host1'], '--user1', j['user1']] + auth_args + ['--port1', str(j['port1'])]
|
cmd += ['--host1', j['host1'], '--user1', j['user1']] + auth_args + ['--port1', str(j['port1'])]
|
||||||
cmd += ['--host2', 'localhost', '--user2', j['user2'] + '*' + master_user, '--passfile2', tmpfile(master_pass + '\n')]
|
cmd += ['--host2', 'localhost', '--user2', j['user2'] + '*' + master_user, '--passfile2', tmpfile(master_pass + '\n')]
|
||||||
if j['dry'] == 1:
|
if j['dry'] == 1:
|
||||||
@@ -264,10 +216,8 @@ def prepare_job(j, global_bw, files):
|
|||||||
|
|
||||||
# Worker: imapsync with output to a file, no inherited fds (DB socket, lock)
|
# Worker: imapsync with output to a file, no inherited fds (DB socket, lock)
|
||||||
def start_job(job):
|
def start_job(job):
|
||||||
env = {k: os.environ[k] for k in job_env_keys if k in os.environ}
|
|
||||||
env['HOME'] = run_dir
|
|
||||||
with open(job['outfile'], 'wb') as out:
|
with open(job['outfile'], 'wb') as out:
|
||||||
return subprocess.Popen(job['cmd'], stdin=subprocess.DEVNULL, stdout=out, stderr=subprocess.STDOUT, env=env)
|
return subprocess.Popen(job['cmd'], stdin=subprocess.DEVNULL, stdout=out, stderr=subprocess.STDOUT)
|
||||||
|
|
||||||
# Store the result of a finished worker and remove its temp files
|
# Store the result of a finished worker and remove its temp files
|
||||||
def reap_job(job):
|
def reap_job(job):
|
||||||
|
|||||||
@@ -1,712 +0,0 @@
|
|||||||
#!/usr/bin/python3
|
|
||||||
# Mail part of restores (ofelia, dovecot container, as vmail): the restic container restores a batch of mailboxes
|
|
||||||
# into /restore/<job id>/b<n> and sets the job to step 'mails'. Per mailbox this imports the mails folder by folder
|
|
||||||
# (into "Restored <snapshot time>" or only the missing ones into the original folders), adds IMAP ACLs and missing
|
|
||||||
# Sieve scripts, merges the results into the job and sets step 'mails_done'; the restic runner then removes the staging
|
|
||||||
# and goes on with the next batch. Nothing that exists is changed or deleted.
|
|
||||||
|
|
||||||
import base64
|
|
||||||
import fcntl
|
|
||||||
import json
|
|
||||||
import os
|
|
||||||
import re
|
|
||||||
import smtplib
|
|
||||||
import stat
|
|
||||||
import subprocess
|
|
||||||
import sys
|
|
||||||
import threading
|
|
||||||
import time
|
|
||||||
from email.message import EmailMessage
|
|
||||||
from email.utils import formatdate, make_msgid
|
|
||||||
import MySQLdb
|
|
||||||
import MySQLdb.cursors
|
|
||||||
|
|
||||||
lock_file = '/tmp/restore_runner.lock'
|
|
||||||
restore_dir = '/restore'
|
|
||||||
max_log = 1000000
|
|
||||||
# import, moves and the removal of the temporary folder ignore the quota (a restore may need more than is free),
|
|
||||||
# the quota is recalculated afterwards
|
|
||||||
no_quota = ['-o', 'plugin/quota=']
|
|
||||||
# uid ranges per import (one argument stays far below the 128 KiB limit), folders per fetch and status
|
|
||||||
uid_ranges = 2000
|
|
||||||
folder_batch = 200
|
|
||||||
# the restic runner waits for the batch while this heartbeat is fresh
|
|
||||||
heartbeat_interval = 30
|
|
||||||
# seconds to wait for the next batch of a restore
|
|
||||||
batch_wait = 120
|
|
||||||
rights_by_letter = {'l': 'lookup', 'r': 'read', 'w': 'write', 's': 'write-seen', 't': 'write-deleted', 'i': 'insert',
|
|
||||||
'p': 'post', 'e': 'expunge', 'k': 'create', 'x': 'delete', 'a': 'admin'}
|
|
||||||
components_here = {'mails', 'imap_acl', 'filters', 'sieve_activate'}
|
|
||||||
|
|
||||||
conn = None
|
|
||||||
|
|
||||||
|
|
||||||
def connect():
|
|
||||||
return MySQLdb.connect(unix_socket='/var/run/mysqld/mysqld.sock', user=os.environ['DBUSER'],
|
|
||||||
passwd=os.environ['DBPASS'], db=os.environ['DBNAME'], charset='utf8mb4', autocommit=True)
|
|
||||||
|
|
||||||
# Reconnect when the server dropped the connection (imports can outlast wait_timeout)
|
|
||||||
def query(sql, args=None):
|
|
||||||
global conn
|
|
||||||
try:
|
|
||||||
conn.ping()
|
|
||||||
except (AttributeError, MySQLdb.Error):
|
|
||||||
conn = connect()
|
|
||||||
cur = conn.cursor(MySQLdb.cursors.DictCursor)
|
|
||||||
cur.execute(sql, args)
|
|
||||||
return cur
|
|
||||||
|
|
||||||
# state_restore_seen while a batch runs, in its own connection
|
|
||||||
class Heartbeat(threading.Thread):
|
|
||||||
def __init__(self):
|
|
||||||
super().__init__(daemon=True)
|
|
||||||
self.done = threading.Event()
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
db = None
|
|
||||||
while not self.done.is_set():
|
|
||||||
try:
|
|
||||||
if db is None:
|
|
||||||
db = connect()
|
|
||||||
db.cursor().execute("""INSERT INTO backup_setting (name, value) VALUES ('state_restore_seen', %s)
|
|
||||||
ON DUPLICATE KEY UPDATE value = VALUES(value)""", (str(int(time.time())),))
|
|
||||||
except MySQLdb.Error:
|
|
||||||
db = None
|
|
||||||
self.done.wait(heartbeat_interval)
|
|
||||||
|
|
||||||
def log(job_id, text):
|
|
||||||
print('restore job %d: %s' % (job_id, text), flush=True)
|
|
||||||
line = '%s %s\n' % (time.strftime('%Y-%m-%d %H:%M:%S'), text)
|
|
||||||
query("UPDATE backup_job SET log = RIGHT(CONCAT(IFNULL(log, ''), %s), %s) WHERE id = %s", (line, max_log, job_id))
|
|
||||||
|
|
||||||
def save(job_id, result):
|
|
||||||
query("UPDATE backup_job SET result = %s WHERE id = %s", (json.dumps(result), job_id))
|
|
||||||
|
|
||||||
def doveadm(*args, data=None, check=True, partial=False):
|
|
||||||
result = subprocess.run(['doveadm', *args], input=data, stdin=None if data is not None else subprocess.DEVNULL,
|
|
||||||
capture_output=True, timeout=86400)
|
|
||||||
# mailbox status fails for folders that cannot be opened (implicit parents); the others are listed
|
|
||||||
if check and result.returncode != 0 and not (partial and result.stdout.strip()):
|
|
||||||
# mail_log writes an info line per message, the errors are the other lines
|
|
||||||
lines = [l for l in result.stderr.decode('utf-8', 'replace').splitlines() if ': Info: ' not in l]
|
|
||||||
raise RuntimeError('\n'.join(lines)[-500:] or 'doveadm exit code %d' % result.returncode)
|
|
||||||
return result.stdout.decode('utf-8', 'replace')
|
|
||||||
|
|
||||||
def doveadm_json(*args, partial=False):
|
|
||||||
out = doveadm('-f', 'json', *args, partial=partial)
|
|
||||||
return json.loads(out) if out.strip() else []
|
|
||||||
|
|
||||||
# free disk space that must stay after the import: max(2 GiB, 5 % of the filesystem), a full disk stops mail
|
|
||||||
# (disk_reserve, mib and count_errors as in restic_runner.py of the backup image; tests/python/backup compares them)
|
|
||||||
def disk_reserve(total):
|
|
||||||
return max(2 << 30, total // 20)
|
|
||||||
|
|
||||||
def import_space_ok(need, free, total):
|
|
||||||
return need * 11 // 10 + disk_reserve(total) <= free
|
|
||||||
|
|
||||||
def mib(size):
|
|
||||||
return '%.1f MiB' % (size / 1048576)
|
|
||||||
|
|
||||||
def component(errors=None):
|
|
||||||
return {'added': 0, 'skipped': 0, 'errors': errors or []}
|
|
||||||
|
|
||||||
# Folder names on disk: modified UTF-7, listescape writes . / \ as \xx
|
|
||||||
def mutf7_decode(text):
|
|
||||||
def utf16(m):
|
|
||||||
if not m.group(1):
|
|
||||||
return '&'
|
|
||||||
data = m.group(1).replace(',', '/')
|
|
||||||
return base64.b64decode(data + '=' * (-len(data) % 4)).decode('utf-16-be')
|
|
||||||
return re.sub(r'&([A-Za-z0-9+,]*)-', utf16, text)
|
|
||||||
|
|
||||||
def unescape(part):
|
|
||||||
return mutf7_decode(re.sub(r'\\([0-9a-fA-F]{2})', lambda m: chr(int(m.group(1), 16)), part))
|
|
||||||
|
|
||||||
# Maildir++: the maildir is INBOX, ".A.B" is A/B
|
|
||||||
def folder_name(entry):
|
|
||||||
return '/'.join(unescape(part) for part in entry[1:].split('.')) if entry else 'INBOX'
|
|
||||||
|
|
||||||
def is_dir(path):
|
|
||||||
try:
|
|
||||||
return stat.S_ISDIR(os.lstat(path).st_mode)
|
|
||||||
except OSError:
|
|
||||||
return False
|
|
||||||
|
|
||||||
def read_file(path):
|
|
||||||
fd = os.open(path, os.O_RDONLY | os.O_NOFOLLOW)
|
|
||||||
with os.fdopen(fd, 'rb') as f:
|
|
||||||
return f.read()
|
|
||||||
|
|
||||||
# Prefixes of the shared and public namespaces, their folders belong to others
|
|
||||||
def shared_prefixes():
|
|
||||||
prefixes, namespace, depth = {'Shared/'}, None, 0
|
|
||||||
# as vmail doveconf cannot read every included file (mail_crypt keys) and fails, but prints the namespaces
|
|
||||||
for line in subprocess.run(['doveconf', '-n'], capture_output=True, text=True).stdout.splitlines():
|
|
||||||
stripped = line.strip()
|
|
||||||
if stripped.endswith('{'):
|
|
||||||
depth += 1
|
|
||||||
if depth == 1 and stripped.startswith('namespace'):
|
|
||||||
namespace = {}
|
|
||||||
elif stripped == '}':
|
|
||||||
if depth == 1 and namespace is not None:
|
|
||||||
if namespace.get('type') in ('shared', 'public') and namespace.get('prefix'):
|
|
||||||
prefixes.add(namespace['prefix'].split('%')[0])
|
|
||||||
namespace = None
|
|
||||||
depth = max(depth - 1, 0)
|
|
||||||
elif depth == 1 and namespace is not None and '=' in stripped:
|
|
||||||
key, value = (part.strip() for part in stripped.split('=', 1))
|
|
||||||
namespace[key] = value
|
|
||||||
return tuple(prefix for prefix in prefixes if prefix)
|
|
||||||
|
|
||||||
# name => guid of the user's own folders (implicit parents have none); the names are looked up literally
|
|
||||||
def own_folders(user, prefixes):
|
|
||||||
names = [n for n in doveadm('mailbox', 'list', '-u', user).splitlines() if n and not n.startswith(prefixes)]
|
|
||||||
wanted, guids = set(names), {}
|
|
||||||
for i in range(0, len(names), folder_batch):
|
|
||||||
for row in doveadm_json('mailbox', 'status', '-u', user, 'guid', '--', *names[i:i + folder_batch], partial=True):
|
|
||||||
if row.get('mailbox') in wanted and re.fullmatch(r'[0-9a-f]{32}', row.get('guid') or ''):
|
|
||||||
guids[row['mailbox']] = row['guid']
|
|
||||||
return guids
|
|
||||||
|
|
||||||
def masked(user):
|
|
||||||
return '*' in user or '?' in user
|
|
||||||
|
|
||||||
def free_name(base, existing):
|
|
||||||
name, count = base, 1
|
|
||||||
while name in existing or any(folder.startswith(name + '/') for folder in existing):
|
|
||||||
count += 1
|
|
||||||
name = '%s (%d)' % (base, count)
|
|
||||||
return name
|
|
||||||
|
|
||||||
# Path of the maildir now (/var/vmail/<domain>/<local>/Maildir), None for unknown or inactive mailboxes
|
|
||||||
def mail_location(user):
|
|
||||||
result = subprocess.run(['doveadm', 'user', '-f', 'mail', '--', user], capture_output=True, text=True)
|
|
||||||
m = re.match(r'maildir:([^:]+)', result.stdout.strip()) if result.returncode == 0 else None
|
|
||||||
return m.group(1).rstrip('/') if m else None
|
|
||||||
|
|
||||||
# The restored maildir of a mailbox (may hold only ACL files), None if the snapshot has nothing of it
|
|
||||||
def staged_maildir(staging, home, location):
|
|
||||||
for path in (staging + location, home + '/' + os.environ.get('MAILDIR_SUB', 'Maildir'), home):
|
|
||||||
if is_dir(path):
|
|
||||||
return path
|
|
||||||
return None
|
|
||||||
|
|
||||||
def uid_chunks(uids):
|
|
||||||
ranges, start, prev = [], None, None
|
|
||||||
for uid in sorted(uids):
|
|
||||||
if start is None:
|
|
||||||
start = prev = uid
|
|
||||||
elif uid == prev + 1:
|
|
||||||
prev = uid
|
|
||||||
else:
|
|
||||||
ranges.append('%d:%d' % (start, prev) if prev != start else str(start))
|
|
||||||
start = prev = uid
|
|
||||||
if start is not None:
|
|
||||||
ranges.append('%d:%d' % (start, prev) if prev != start else str(start))
|
|
||||||
return [','.join(ranges[i:i + uid_ranges]) for i in range(0, len(ranges), uid_ranges)]
|
|
||||||
|
|
||||||
# Same message: same Message-ID, without one the same Date and size
|
|
||||||
def message_key(row):
|
|
||||||
message_id = re.sub(r'\s+', '', row.get('hdr.message-id') or '').strip('<>')
|
|
||||||
if message_id:
|
|
||||||
return 'id:' + message_id
|
|
||||||
return 'date:%s:%s' % (row.get('date.sent'), row.get('size.physical'))
|
|
||||||
|
|
||||||
def present_keys(user, guids):
|
|
||||||
keys = set()
|
|
||||||
guids = list(guids)
|
|
||||||
for i in range(0, len(guids), folder_batch):
|
|
||||||
search = []
|
|
||||||
for guid in guids[i:i + folder_batch]:
|
|
||||||
search += (['OR'] if search else []) + ['mailbox-guid', guid]
|
|
||||||
keys.update(message_key(row) for row in doveadm_json('fetch', '-u', user, 'hdr.message-id date.sent size.physical',
|
|
||||||
*search))
|
|
||||||
return keys
|
|
||||||
|
|
||||||
def location(path):
|
|
||||||
if ':' in path:
|
|
||||||
raise RuntimeError('unsupported path')
|
|
||||||
return 'maildir:%s:INDEX=MEMORY' % path
|
|
||||||
|
|
||||||
# The folders of a restored maildir as standalone maildirs (their messages are the INBOX there): the subfolders are
|
|
||||||
# moved out of the maildir, so every folder is imported without the name rules of the source (listescape)
|
|
||||||
def split_folders(maildir, home):
|
|
||||||
folders, failed = [('INBOX', maildir)], []
|
|
||||||
out = home + '/_restore_folders'
|
|
||||||
for entry in sorted(os.listdir(maildir)):
|
|
||||||
path = os.path.join(maildir, entry)
|
|
||||||
if not entry.startswith('.') or entry in ('.', '..') or not is_dir(path) or not is_dir(path + '/cur'):
|
|
||||||
continue
|
|
||||||
try:
|
|
||||||
name = folder_name(entry)
|
|
||||||
except (ValueError, UnicodeDecodeError):
|
|
||||||
failed.append(entry)
|
|
||||||
continue
|
|
||||||
if not os.path.isdir(out):
|
|
||||||
os.mkdir(out, 0o700)
|
|
||||||
target = '%s/f%d' % (out, len(folders))
|
|
||||||
os.rename(path, target)
|
|
||||||
folders.append((name, target))
|
|
||||||
return folders, failed
|
|
||||||
|
|
||||||
def source_messages(user, root):
|
|
||||||
return doveadm_json('-o', 'mail_location=' + location(root), 'fetch', '-u', user,
|
|
||||||
'uid hdr.message-id date.sent size.physical', 'mailbox', 'INBOX')
|
|
||||||
|
|
||||||
def remove_tree(user, name):
|
|
||||||
doveadm(*no_quota, 'mailbox', 'delete', '-u', user, '-r', '-s', '--', name, check=False)
|
|
||||||
|
|
||||||
def folder_guid(user, name):
|
|
||||||
rows = doveadm_json('mailbox', 'status', '-u', user, 'guid', '--', name)
|
|
||||||
for row in rows:
|
|
||||||
if row.get('mailbox') == name:
|
|
||||||
return row['guid']
|
|
||||||
raise RuntimeError('folder not found after the import')
|
|
||||||
|
|
||||||
def quota_room(user):
|
|
||||||
# free bytes of the storage quota, None without a limit
|
|
||||||
for row in doveadm_json('quota', 'get', '-u', user):
|
|
||||||
if row.get('type') == 'STORAGE' and str(row.get('limit', '-')).isdigit():
|
|
||||||
return (int(row['limit']) - int(row.get('value') or 0)) * 1024
|
|
||||||
return None
|
|
||||||
|
|
||||||
# Subscriptions of the backup (subscriptions file: "V\t2", then names with \t between the levels)
|
|
||||||
def backup_subscriptions(maildir):
|
|
||||||
try:
|
|
||||||
lines = read_file(maildir + '/subscriptions').decode('utf-8', 'replace').splitlines()
|
|
||||||
except OSError:
|
|
||||||
return []
|
|
||||||
if lines and lines[0].startswith('V\t'):
|
|
||||||
return ['/'.join(unescape(part) for part in line.split('\t')) for line in lines[1:] if line.strip()]
|
|
||||||
# version 1: storage names with the Maildir++ separator
|
|
||||||
return [folder_name('.' + line.strip()) for line in lines if line.strip()]
|
|
||||||
|
|
||||||
def restore_subscriptions(user, wanted, prefixes):
|
|
||||||
if not wanted:
|
|
||||||
return 0
|
|
||||||
existing = set(own_folders(user, prefixes)) | {'INBOX'}
|
|
||||||
subscribed = set(doveadm('mailbox', 'list', '-u', user, '-s').splitlines())
|
|
||||||
missing = [name for name in dict.fromkeys(wanted) if name in existing and name not in subscribed]
|
|
||||||
if missing:
|
|
||||||
doveadm('mailbox', 'subscribe', '-u', user, '--', *missing)
|
|
||||||
return len(missing)
|
|
||||||
|
|
||||||
# Mails folder by folder: original = only messages missing anywhere in the mailbox, into their original folders;
|
|
||||||
# folder = all messages below "Restored <snapshot time>"
|
|
||||||
def restore_mails(job_id, user, home, maildir, mode, snapshot_time, prefixes, check_quota):
|
|
||||||
result = component()
|
|
||||||
result.update(folders=0, folders_failed=0)
|
|
||||||
if not maildir or not is_dir(maildir + '/cur'):
|
|
||||||
# a key the UI translates
|
|
||||||
result['note'] = 'no_mails'
|
|
||||||
return result
|
|
||||||
tmp = 'Restoring %d' % job_id
|
|
||||||
# a leftover of an interrupted run goes first, it is never counted as present
|
|
||||||
remove_tree(user, tmp)
|
|
||||||
subscriptions = backup_subscriptions(maildir)
|
|
||||||
folders, broken = split_folders(maildir, home)
|
|
||||||
for entry in broken:
|
|
||||||
result['errors'].append('folder %s: name not readable' % entry)
|
|
||||||
result['folders_failed'] += 1
|
|
||||||
live = own_folders(user, prefixes)
|
|
||||||
present = present_keys(user, live.values()) if mode == 'original' else set()
|
|
||||||
plan, need = [], 0
|
|
||||||
for name, root in folders:
|
|
||||||
try:
|
|
||||||
rows = source_messages(user, root)
|
|
||||||
except RuntimeError as e:
|
|
||||||
result['errors'].append('%s: %s' % (name, e))
|
|
||||||
result['folders_failed'] += 1
|
|
||||||
continue
|
|
||||||
wanted = [row for row in rows if mode != 'original' or message_key(row) not in present]
|
|
||||||
result['skipped'] += len(rows) - len(wanted)
|
|
||||||
if wanted:
|
|
||||||
size = sum(int(row.get('size.physical') or 0) for row in wanted)
|
|
||||||
plan.append((name, root, [int(row['uid']) for row in wanted], size))
|
|
||||||
need += size
|
|
||||||
if not plan:
|
|
||||||
if mode == 'original':
|
|
||||||
result['subscribed'] = restore_subscriptions(user, subscriptions, prefixes)
|
|
||||||
return result
|
|
||||||
vfs = os.statvfs('/var/vmail')
|
|
||||||
free, total = vfs.f_bavail * vfs.f_frsize, vfs.f_blocks * vfs.f_frsize
|
|
||||||
if not import_space_ok(need, free, total):
|
|
||||||
raise RuntimeError('not enough free disk space for the mails: %s needed plus %s reserve, %s free' % (
|
|
||||||
mib(need * 11 // 10), mib(disk_reserve(total)), mib(free)))
|
|
||||||
if check_quota:
|
|
||||||
room = quota_room(user)
|
|
||||||
if room is not None and need > room:
|
|
||||||
raise RuntimeError('the mails do not fit into the quota of the mailbox: %s needed, %s free' % (
|
|
||||||
mib(need), mib(max(room, 0))))
|
|
||||||
names = set(live) | {'INBOX'}
|
|
||||||
dest = None
|
|
||||||
if mode != 'original':
|
|
||||||
dest = free_name('Restored ' + snapshot_time, names)
|
|
||||||
doveadm('mailbox', 'create', '-u', user, '-s', '--', dest)
|
|
||||||
names.add(dest)
|
|
||||||
result['folder'] = dest
|
|
||||||
created = []
|
|
||||||
try:
|
|
||||||
for number, (name, root, uids, size) in enumerate(plan):
|
|
||||||
target = dest + '/' + name if dest else name
|
|
||||||
stage = '%s/f%d' % (tmp, number)
|
|
||||||
try:
|
|
||||||
for chunk in uid_chunks(uids):
|
|
||||||
doveadm(*no_quota, 'import', '-u', user, '-s', location(root), stage, 'mailbox', 'INBOX', 'uid', chunk)
|
|
||||||
guid = folder_guid(user, stage + '/INBOX')
|
|
||||||
if target not in names:
|
|
||||||
doveadm('mailbox', 'create', '-u', user, '-s', '--', target)
|
|
||||||
names.add(target)
|
|
||||||
created.append(target)
|
|
||||||
doveadm(*no_quota, 'move', '-u', user, '--', target, 'mailbox-guid', guid, 'all')
|
|
||||||
result['added'] += len(uids)
|
|
||||||
result['folders'] += 1
|
|
||||||
except RuntimeError as e:
|
|
||||||
result['errors'].append('%s: %s' % (name, e))
|
|
||||||
result['folders_failed'] += 1
|
|
||||||
finally:
|
|
||||||
remove_tree(user, tmp)
|
|
||||||
result['folders_created'] = len(created)
|
|
||||||
if mode == 'original':
|
|
||||||
result['subscribed'] = restore_subscriptions(user, subscriptions, prefixes)
|
|
||||||
return result
|
|
||||||
|
|
||||||
def acl_entries(path):
|
|
||||||
entries = []
|
|
||||||
try:
|
|
||||||
lines = read_file(path).decode('utf-8', 'replace').splitlines()
|
|
||||||
except OSError:
|
|
||||||
return entries
|
|
||||||
for line in lines:
|
|
||||||
parts = line.split()
|
|
||||||
# negative rights would take rights away
|
|
||||||
if len(parts) < 2 or parts[0].startswith('-'):
|
|
||||||
continue
|
|
||||||
rights = [rights_by_letter[c] for c in parts[1] if c in rights_by_letter] + [p for p in parts[2:] if p.startswith(':')]
|
|
||||||
if rights:
|
|
||||||
entries.append((parts[0], rights))
|
|
||||||
return entries
|
|
||||||
|
|
||||||
# (folder, entries) of the dovecot-acl files of a restored maildir
|
|
||||||
def maildir_acls(maildir):
|
|
||||||
acls = []
|
|
||||||
if not maildir or not is_dir(maildir):
|
|
||||||
return acls
|
|
||||||
for entry in [''] + sorted(e for e in os.listdir(maildir) if e.startswith('.') and e not in ('.', '..')):
|
|
||||||
path = os.path.join(maildir, entry, 'dovecot-acl') if entry else os.path.join(maildir, 'dovecot-acl')
|
|
||||||
if entry and not is_dir(os.path.join(maildir, entry)):
|
|
||||||
continue
|
|
||||||
try:
|
|
||||||
if stat.S_ISREG(os.lstat(path).st_mode):
|
|
||||||
acls.append((folder_name(entry), acl_entries(path)))
|
|
||||||
except (OSError, ValueError, UnicodeDecodeError):
|
|
||||||
continue
|
|
||||||
return acls
|
|
||||||
|
|
||||||
# owner => (folder, entries) of every mailbox in the ACL staging (domain admins: only their domains)
|
|
||||||
def staged_acls(acl_dir, allowed):
|
|
||||||
acls = {}
|
|
||||||
base = (acl_dir or '') + '/var/vmail'
|
|
||||||
sub = os.environ.get('MAILDIR_SUB', '')
|
|
||||||
if not acl_dir or not is_dir(base):
|
|
||||||
return acls
|
|
||||||
for domain in os.listdir(base):
|
|
||||||
if '.' not in domain or not is_dir(os.path.join(base, domain)) or (allowed is not None and domain.lower() not in allowed):
|
|
||||||
continue
|
|
||||||
for local in os.listdir(os.path.join(base, domain)):
|
|
||||||
home = os.path.join(base, domain, local)
|
|
||||||
maildir = os.path.join(home, sub) if sub and is_dir(os.path.join(home, sub)) else home
|
|
||||||
found = maildir_acls(maildir)
|
|
||||||
if found:
|
|
||||||
acls['%s@%s' % (local, domain)] = found
|
|
||||||
return acls
|
|
||||||
|
|
||||||
class AclRestore:
|
|
||||||
def __init__(self, prefixes, allowed):
|
|
||||||
self.prefixes = prefixes
|
|
||||||
self.allowed = allowed
|
|
||||||
self.users, self.folders = {}, {}
|
|
||||||
# anyone/authenticated only when the configuration allows them
|
|
||||||
self.anyone = os.environ.get('ACL_ANYONE', 'disallow') == 'allow'
|
|
||||||
|
|
||||||
def in_scope(self, address):
|
|
||||||
return self.allowed is None or address.rpartition('@')[2].lower() in self.allowed
|
|
||||||
|
|
||||||
def user_exists(self, user):
|
|
||||||
if user not in self.users:
|
|
||||||
self.users[user] = query("SELECT 1 FROM mailbox WHERE username = %s", (user,)).fetchone() is not None
|
|
||||||
return self.users[user]
|
|
||||||
|
|
||||||
def identifier_ok(self, identifier):
|
|
||||||
if identifier.startswith('user='):
|
|
||||||
return self.user_exists(identifier[5:].lower())
|
|
||||||
# group=mcg_<id> belongs to the mailbox groups, the group grants cron keeps them
|
|
||||||
if identifier.startswith('group=mcg_'):
|
|
||||||
return False
|
|
||||||
if identifier in ('anyone', 'authenticated'):
|
|
||||||
return self.anyone
|
|
||||||
return True
|
|
||||||
|
|
||||||
def shown(self, identifier):
|
|
||||||
# domain admins do not see addresses of other domains
|
|
||||||
if identifier.startswith('user=') and not self.in_scope(identifier[5:]):
|
|
||||||
return 'user=(other domain)'
|
|
||||||
return identifier
|
|
||||||
|
|
||||||
def add(self, owner, folder, identifier, rights, result):
|
|
||||||
if not self.in_scope(owner) or masked(owner):
|
|
||||||
result['skipped'] += 1
|
|
||||||
return
|
|
||||||
try:
|
|
||||||
if owner not in self.folders:
|
|
||||||
self.folders[owner] = set(own_folders(owner, self.prefixes)) | {'INBOX'}
|
|
||||||
if folder not in self.folders[owner] or not self.identifier_ok(identifier):
|
|
||||||
result['skipped'] += 1
|
|
||||||
return
|
|
||||||
have = set()
|
|
||||||
for row in doveadm_json('acl', 'get', '-u', owner, '--', folder):
|
|
||||||
if row.get('id') == identifier:
|
|
||||||
have.update((row.get('rights') or '').split())
|
|
||||||
missing = [right for right in rights if right not in have]
|
|
||||||
if not missing:
|
|
||||||
result['skipped'] += 1
|
|
||||||
return
|
|
||||||
doveadm('acl', 'add', '-u', owner, '--', folder, identifier, *missing)
|
|
||||||
result['added'] += 1
|
|
||||||
except RuntimeError as e:
|
|
||||||
result['errors'].append('%s %s %s: %s' % (owner, folder, self.shown(identifier), e))
|
|
||||||
|
|
||||||
# Rights the mailbox granted on its folders and rights other mailboxes granted to it; added, never removed
|
|
||||||
def restore_acl(acl, user, own, granted):
|
|
||||||
result = component()
|
|
||||||
for folder, entries in own:
|
|
||||||
for identifier, rights in entries:
|
|
||||||
acl.add(user, folder, identifier, rights, result)
|
|
||||||
if acl.user_exists(user):
|
|
||||||
for owner, folders in granted.items():
|
|
||||||
if owner == user or not acl.in_scope(owner) or not acl.user_exists(owner):
|
|
||||||
continue
|
|
||||||
for folder, entries in folders:
|
|
||||||
for identifier, rights in entries:
|
|
||||||
if identifier.lower() == 'user=' + user:
|
|
||||||
acl.add(owner, folder, identifier, rights, result)
|
|
||||||
return result
|
|
||||||
|
|
||||||
# Own Sieve scripts (incl. the SOGo vacation script): missing names are added; with activate the active script of the
|
|
||||||
# backup is activated if none is active now
|
|
||||||
def restore_sieve(user, home, active_link, activate):
|
|
||||||
result = component()
|
|
||||||
folder = home + '/sieve'
|
|
||||||
scripts = []
|
|
||||||
if is_dir(folder):
|
|
||||||
scripts = sorted(f[:-6] for f in os.listdir(folder) if f.endswith('.sieve') and stat.S_ISREG(os.lstat(os.path.join(folder, f)).st_mode))
|
|
||||||
current, active = set(), None
|
|
||||||
for line in doveadm('sieve', 'list', '-u', user).splitlines():
|
|
||||||
name, _, flag = line.rpartition(' ')
|
|
||||||
if name:
|
|
||||||
current.add(name)
|
|
||||||
if flag == 'ACTIVE':
|
|
||||||
active = name
|
|
||||||
for name in scripts:
|
|
||||||
if name in current:
|
|
||||||
result['skipped'] += 1
|
|
||||||
continue
|
|
||||||
try:
|
|
||||||
doveadm('sieve', 'put', '-u', user, '--', name, data=read_file(os.path.join(folder, name + '.sieve')))
|
|
||||||
current.add(name)
|
|
||||||
result['added'] += 1
|
|
||||||
except (OSError, RuntimeError) as e:
|
|
||||||
result['errors'].append('%s: %s' % (name, e))
|
|
||||||
if not activate:
|
|
||||||
return result
|
|
||||||
target = os.readlink(active_link) if os.path.islink(active_link) else ''
|
|
||||||
backup_active = os.path.basename(target)[:-6] if target.endswith('.sieve') else None
|
|
||||||
if backup_active and not active and backup_active in current:
|
|
||||||
try:
|
|
||||||
doveadm('sieve', 'activate', '-u', user, '--', backup_active)
|
|
||||||
result['activated'] = backup_active
|
|
||||||
except RuntimeError as e:
|
|
||||||
result['errors'].append('%s: %s' % (backup_active, e))
|
|
||||||
return result
|
|
||||||
|
|
||||||
# filters: backup.php reported its part already, the counts are added up
|
|
||||||
def merge(results, key, part):
|
|
||||||
old = results.get(key)
|
|
||||||
if not isinstance(old, dict):
|
|
||||||
results[key] = part
|
|
||||||
return
|
|
||||||
for count in ('added', 'skipped'):
|
|
||||||
old[count] = (old.get(count) or 0) + part.get(count, 0)
|
|
||||||
old['errors'] = (old.get('errors') or []) + part.get('errors', [])
|
|
||||||
for name, value in part.items():
|
|
||||||
if name not in ('added', 'skipped', 'errors'):
|
|
||||||
old[name] = value
|
|
||||||
|
|
||||||
def count_errors(result):
|
|
||||||
count = sum(len(result.get(key, {}).get('errors') or []) for key in ('domain', 'aliases') if isinstance(result.get(key), dict))
|
|
||||||
for entry in (result.get('mailboxes') or {}).values():
|
|
||||||
count += int(bool(entry.get('error')))
|
|
||||||
count += sum(len(value.get('errors') or []) for value in entry.values() if isinstance(value, dict))
|
|
||||||
return count
|
|
||||||
|
|
||||||
def restore_mailbox(job_id, user, components, mode, staging, snapshot_time, prefixes, acl, granted, check_quota, result):
|
|
||||||
local, _, domain = user.rpartition('@')
|
|
||||||
home = '%s/var/vmail/%s/%s' % (staging, domain, local)
|
|
||||||
if masked(user):
|
|
||||||
for key in components & {'mails', 'imap_acl', 'filters'}:
|
|
||||||
merge(result, key, component(['username with * or ?, doveadm reads it as a mask']))
|
|
||||||
return
|
|
||||||
location = mail_location(user)
|
|
||||||
if not location:
|
|
||||||
for key in components & {'mails', 'imap_acl', 'filters'}:
|
|
||||||
merge(result, key, component(['the mailbox does not exist now or is inactive']))
|
|
||||||
return
|
|
||||||
maildir = staged_maildir(staging, home, location)
|
|
||||||
# the ACL files are read before the folders of the maildir are moved for the import
|
|
||||||
own = maildir_acls(maildir) if 'imap_acl' in components else []
|
|
||||||
if 'mails' in components:
|
|
||||||
try:
|
|
||||||
result['mails'] = restore_mails(job_id, user, home, maildir, mode, snapshot_time, prefixes, check_quota)
|
|
||||||
except Exception as e:
|
|
||||||
result['mails'] = component([str(e)[:1000]])
|
|
||||||
try:
|
|
||||||
doveadm('quota', 'recalc', '-u', user)
|
|
||||||
except RuntimeError as e:
|
|
||||||
result['mails']['errors'].append('quota recalc: %s' % e)
|
|
||||||
# new folders
|
|
||||||
acl.folders.pop(user, None)
|
|
||||||
if 'imap_acl' in components:
|
|
||||||
try:
|
|
||||||
result['imap_acl'] = restore_acl(acl, user, own, granted)
|
|
||||||
except Exception as e:
|
|
||||||
result['imap_acl'] = component([str(e)[:1000]])
|
|
||||||
if 'filters' in components:
|
|
||||||
try:
|
|
||||||
part = restore_sieve(user, home, '%s/var/vmail/sieve/%s.sieve' % (staging, user), 'sieve_activate' in components)
|
|
||||||
except Exception as e:
|
|
||||||
part = component([str(e)[:1000]])
|
|
||||||
merge(result, 'filters', part)
|
|
||||||
|
|
||||||
def fail(job_id, error):
|
|
||||||
query("""UPDATE backup_job SET state = IF(state = 'cancelled', state, 'failed'), error = %s, finished = NOW()
|
|
||||||
WHERE id = %s""", (error, job_id))
|
|
||||||
log(job_id, 'restore job failed: ' + error)
|
|
||||||
notify(job_id, error)
|
|
||||||
|
|
||||||
def notify(job_id, error):
|
|
||||||
hostname = os.environ.get('MAILCOW_HOSTNAME', '')
|
|
||||||
row = query("SELECT value FROM backup_setting WHERE name = 'notify_email'").fetchone()
|
|
||||||
rcpts = [r.strip() for r in (row['value'] if row else '').split(',') if re.fullmatch(r'[^@\s<>,]+@[^@\s<>,]+', r.strip())]
|
|
||||||
if not rcpts:
|
|
||||||
return
|
|
||||||
msg = EmailMessage()
|
|
||||||
msg['From'] = 'backup@' + hostname
|
|
||||||
msg['To'] = ', '.join(rcpts)
|
|
||||||
msg['Subject'] = 'mailcow backup on %s: restore job %d failed' % (hostname, job_id)
|
|
||||||
msg['Date'] = formatdate(localtime=True)
|
|
||||||
msg['Message-ID'] = make_msgid(domain=hostname or None)
|
|
||||||
msg.set_content('The restore job %d failed:\n\n%s\n\nThe job log is in the backup section of the mailcow UI.\n'
|
|
||||||
% (job_id, error))
|
|
||||||
try:
|
|
||||||
with smtplib.SMTP('postfix', 588, hostname or None, timeout=60) as smtp:
|
|
||||||
smtp.send_message(msg)
|
|
||||||
except (OSError, smtplib.SMTPException) as e:
|
|
||||||
print('restore job %d: the notification could not be sent: %s' % (job_id, e), file=sys.stderr)
|
|
||||||
|
|
||||||
def staging_dir(job_id, path):
|
|
||||||
# the batch folder of this job, never a symlink
|
|
||||||
if not isinstance(path, str) or not re.fullmatch(r'/restore/%d/[A-Za-z0-9_-]+' % job_id, path) or \
|
|
||||||
os.path.realpath(path) != path or not is_dir(path):
|
|
||||||
return None
|
|
||||||
return path
|
|
||||||
|
|
||||||
def run_batch(job):
|
|
||||||
job_id = job['id']
|
|
||||||
params = json.loads(job['params'] or '{}')
|
|
||||||
result = json.loads(job['result'] or '{}')
|
|
||||||
batch = result.get('batch') or {}
|
|
||||||
staging = staging_dir(job_id, batch.get('dir'))
|
|
||||||
acl_dir = staging_dir(job_id, batch.get('acl_dir')) if batch.get('acl_dir') else None
|
|
||||||
mailboxes = [m for m in batch.get('mailboxes') or [] if isinstance(m, str)]
|
|
||||||
components = {c for c in params.get('components') or [] if c in components_here}
|
|
||||||
mode = 'original' if params.get('mail_target') == 'original' else 'folder'
|
|
||||||
allowed = {d.lower() for d in params['allowed_domains']} if isinstance(params.get('allowed_domains'), list) else None
|
|
||||||
check_quota = params.get('requested_role', 'admin') != 'admin'
|
|
||||||
snapshot_time = (result.get('snapshot') or {}).get('time') or time.strftime('%Y-%m-%d %H:%M')
|
|
||||||
results = result.setdefault('mailboxes', {})
|
|
||||||
prefixes = shared_prefixes()
|
|
||||||
acl = AclRestore(prefixes, allowed)
|
|
||||||
granted = staged_acls(acl_dir, allowed) if 'imap_acl' in components else {}
|
|
||||||
log(job_id, 'restoring %s for %d mailboxes%s' % (', '.join(sorted(components)), len(mailboxes),
|
|
||||||
' (mails: %s)' % mode if 'mails' in components else ''))
|
|
||||||
for user in mailboxes:
|
|
||||||
entry = results.setdefault(user, {})
|
|
||||||
if entry.get('error'):
|
|
||||||
continue
|
|
||||||
started = time.monotonic()
|
|
||||||
if not staging:
|
|
||||||
for key in components & {'mails', 'imap_acl', 'filters'}:
|
|
||||||
merge(entry, key, component(['the restored files are missing']))
|
|
||||||
else:
|
|
||||||
restore_mailbox(job_id, user, components, mode, staging, snapshot_time, prefixes, acl, granted, check_quota, entry)
|
|
||||||
summary = ', '.join('%s +%d' % (key, entry[key].get('added', 0)) for key in sorted(components) if isinstance(entry.get(key), dict))
|
|
||||||
errors = sum(len(entry[key].get('errors') or []) for key in components if isinstance(entry.get(key), dict))
|
|
||||||
log(job_id, '%s: %s%s (%d s)' % (user, summary, ', %d errors' % errors if errors else '', time.monotonic() - started))
|
|
||||||
result['errors'] = count_errors(result)
|
|
||||||
save(job_id, result)
|
|
||||||
result['errors'] = count_errors(result)
|
|
||||||
save(job_id, result)
|
|
||||||
# the restic runner removes the staging and goes on
|
|
||||||
query("UPDATE backup_job SET step = 'mails_done' WHERE id = %s AND state = 'running' AND step = 'mails_running'", (job_id,))
|
|
||||||
|
|
||||||
def main():
|
|
||||||
global conn
|
|
||||||
if os.geteuid() == 0:
|
|
||||||
# as vmail like the ofelia job: a run as root would leave a lock file the runs as vmail cannot open
|
|
||||||
os.execv('/usr/local/bin/gosu', ['gosu', 'vmail', sys.executable, os.path.abspath(__file__)] + sys.argv[1:])
|
|
||||||
os.umask(0o077)
|
|
||||||
# released by the kernel when the process ends, a crashed run leaves no stale lock
|
|
||||||
lock_fd = os.open(lock_file, os.O_RDWR | os.O_CREAT, 0o600)
|
|
||||||
try:
|
|
||||||
fcntl.flock(lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
|
||||||
except OSError:
|
|
||||||
sys.exit("restore: can't lock " + lock_file)
|
|
||||||
conn = connect()
|
|
||||||
heartbeat = Heartbeat()
|
|
||||||
heartbeat.start()
|
|
||||||
try:
|
|
||||||
# under the lock: a batch in mails_running was left by a crashed or stopped run, its temporary folders go
|
|
||||||
for row in query("""SELECT id, result FROM backup_job WHERE type = 'restore' AND state = 'running'
|
|
||||||
AND step = 'mails_running'""").fetchall():
|
|
||||||
try:
|
|
||||||
for user in (json.loads(row['result'] or '{}').get('batch') or {}).get('mailboxes') or []:
|
|
||||||
remove_tree(user, 'Restoring %d' % row['id'])
|
|
||||||
doveadm('quota', 'recalc', '-u', user, check=False)
|
|
||||||
except (ValueError, AttributeError, RuntimeError):
|
|
||||||
pass
|
|
||||||
fail(row['id'], 'interrupted: the restore of the mails was stopped')
|
|
||||||
last, waited = None, 0
|
|
||||||
while True:
|
|
||||||
job = query("""SELECT id, params, result FROM backup_job WHERE type = 'restore' AND state = 'running'
|
|
||||||
AND step = 'mails' ORDER BY id LIMIT 1""").fetchone()
|
|
||||||
if not job:
|
|
||||||
# the next batch of a restore follows within seconds: wait for it instead of the next ofelia run
|
|
||||||
row = query("SELECT state FROM backup_job WHERE id = %s", (last,)).fetchone() if last else None
|
|
||||||
if row and row['state'] == 'running' and waited < batch_wait:
|
|
||||||
time.sleep(2)
|
|
||||||
waited += 2
|
|
||||||
continue
|
|
||||||
break
|
|
||||||
last, waited = job['id'], 0
|
|
||||||
if query("UPDATE backup_job SET step = 'mails_running' WHERE id = %s AND state = 'running' AND step = 'mails'",
|
|
||||||
(job['id'],)).rowcount != 1:
|
|
||||||
continue
|
|
||||||
try:
|
|
||||||
run_batch(job)
|
|
||||||
except Exception as e:
|
|
||||||
fail(job['id'], str(e)[:1000])
|
|
||||||
finally:
|
|
||||||
heartbeat.done.set()
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
@@ -1,256 +0,0 @@
|
|||||||
#!/usr/bin/python3
|
|
||||||
# Nightly run of the retention rules (ofelia, dovecot container): gets the plan page by page from the mailcow UI
|
|
||||||
# (nginx:8081/retention.php), gives every folder of a mailbox to the first entry of its plan that matches it, counts
|
|
||||||
# the mail saved in the folders before the period of the rule with doveadm, deletes it unless the rule only
|
|
||||||
# simulates, and reports the results back.
|
|
||||||
|
|
||||||
import fcntl
|
|
||||||
import hashlib
|
|
||||||
import hmac
|
|
||||||
import json
|
|
||||||
import os
|
|
||||||
import re
|
|
||||||
import subprocess
|
|
||||||
import sys
|
|
||||||
import time
|
|
||||||
import urllib.parse
|
|
||||||
import urllib.request
|
|
||||||
|
|
||||||
plan_url = 'http://nginx:8081/retention.php'
|
|
||||||
lock_file = '/tmp/retention_runner.lock'
|
|
||||||
# folder keys of the rules and the special-use flag of their folders in the Dovecot configuration
|
|
||||||
special_use = {'trash': '\\Trash', 'junk': '\\Junk', 'sent': '\\Sent', 'drafts': '\\Drafts', 'archive': '\\Archive'}
|
|
||||||
own_folder = 'folder:'
|
|
||||||
# mailboxes per page of the plan and results per report, a large instance has many mailboxes
|
|
||||||
plan_page = 200
|
|
||||||
report_batch = 200
|
|
||||||
# a request is tried this often, waiting longer each time
|
|
||||||
tries = 3
|
|
||||||
|
|
||||||
token = hmac.new(os.environ.get('DBPASS', '').encode(), b'retention', hashlib.sha256).hexdigest()
|
|
||||||
|
|
||||||
def request(url, body=None):
|
|
||||||
data = None if body is None else json.dumps(body).encode()
|
|
||||||
req = urllib.request.Request(url, data=data, headers={'Content-Type': 'application/json', 'X-Retention-Token': token},
|
|
||||||
method='GET' if body is None else 'POST')
|
|
||||||
with urllib.request.urlopen(req, timeout=300) as response:
|
|
||||||
return json.load(response)
|
|
||||||
|
|
||||||
def retried(url, body=None):
|
|
||||||
for attempt in range(1, tries + 1):
|
|
||||||
try:
|
|
||||||
return request(url, body)
|
|
||||||
except Exception as e:
|
|
||||||
if attempt == tries:
|
|
||||||
raise
|
|
||||||
print('retention: request failed, trying again: %s' % e, file=sys.stderr)
|
|
||||||
time.sleep(30 * attempt)
|
|
||||||
|
|
||||||
def plan():
|
|
||||||
# one page after the other, so memory stays small; rule changes apply to the pages fetched after them
|
|
||||||
after = ''
|
|
||||||
while after is not None:
|
|
||||||
page = retried(plan_url + '?' + urllib.parse.urlencode({'after': after, 'limit': plan_page}))
|
|
||||||
yield from page['mailboxes']
|
|
||||||
after = page['next']
|
|
||||||
|
|
||||||
def post(body):
|
|
||||||
# False if the report could not be sent
|
|
||||||
try:
|
|
||||||
retried(plan_url, body)
|
|
||||||
return True
|
|
||||||
except Exception as e:
|
|
||||||
print('retention: report failed: %s' % e, file=sys.stderr)
|
|
||||||
return False
|
|
||||||
|
|
||||||
class Reports:
|
|
||||||
# results go back in parts; once a part cannot be sent, the rest waits for the end of the run
|
|
||||||
def __init__(self):
|
|
||||||
self.pending, self.failed = [], False
|
|
||||||
|
|
||||||
def add(self, result):
|
|
||||||
self.pending.append(result)
|
|
||||||
if len(self.pending) >= report_batch and not self.failed:
|
|
||||||
self.failed = not self.send()
|
|
||||||
|
|
||||||
def send(self, summary=None, run=None):
|
|
||||||
# full parts, at the end all results with the summary and the run in the last part
|
|
||||||
final = summary is not None
|
|
||||||
while len(self.pending) >= report_batch or final:
|
|
||||||
body = {'results': self.pending[:report_batch]}
|
|
||||||
if final and len(self.pending) <= report_batch:
|
|
||||||
body.update(summary=summary, run=run)
|
|
||||||
if not post(body):
|
|
||||||
return False
|
|
||||||
del self.pending[:report_batch]
|
|
||||||
if 'summary' in body:
|
|
||||||
break
|
|
||||||
return True
|
|
||||||
|
|
||||||
def doveadm(*args, partial=False):
|
|
||||||
result = subprocess.run(['doveadm', *args], capture_output=True, text=True, timeout=3600)
|
|
||||||
# mailbox status also fails for single folders that cannot be opened; the others are still listed
|
|
||||||
if result.returncode != 0 and not (partial and result.stdout):
|
|
||||||
raise RuntimeError((result.stderr or result.stdout).strip()[:500] or 'doveadm exit %d' % result.returncode)
|
|
||||||
return result.stdout
|
|
||||||
|
|
||||||
def configuration():
|
|
||||||
# names of the special folders per key, and the prefixes of the shared and public namespaces (not the user's)
|
|
||||||
names = {key: set() for key in special_use}
|
|
||||||
prefixes = ['Shared/']
|
|
||||||
namespace, mailbox = None, None
|
|
||||||
# as vmail doveconf cannot read every included file (mail_crypt keys) and fails, but prints the namespaces
|
|
||||||
for line in subprocess.run(['doveconf', '-n'], capture_output=True, text=True).stdout.splitlines():
|
|
||||||
stripped = line.strip()
|
|
||||||
if line.startswith('namespace ') and line.endswith('{'):
|
|
||||||
namespace = {}
|
|
||||||
elif line == '}':
|
|
||||||
if namespace and namespace.get('type') in ('shared', 'public') and namespace.get('prefix'):
|
|
||||||
prefixes.append(namespace['prefix'].split('%')[0])
|
|
||||||
namespace = None
|
|
||||||
elif namespace is None:
|
|
||||||
continue
|
|
||||||
elif re.match(r'mailbox .+ \{$', stripped):
|
|
||||||
mailbox = stripped[len('mailbox '):-2].strip().strip('"')
|
|
||||||
elif stripped == '}':
|
|
||||||
mailbox = None
|
|
||||||
elif '=' in stripped:
|
|
||||||
key, value = (part.strip() for part in stripped.split('=', 1))
|
|
||||||
if mailbox is not None and key == 'special_use':
|
|
||||||
for folder, flag in special_use.items():
|
|
||||||
if flag in value.split():
|
|
||||||
names[folder].add(mailbox)
|
|
||||||
elif mailbox is None and key in ('type', 'prefix'):
|
|
||||||
namespace[key] = value
|
|
||||||
if not names['trash']:
|
|
||||||
raise RuntimeError('no special folders in the output of doveconf -n')
|
|
||||||
return names, [prefix for prefix in prefixes if prefix]
|
|
||||||
|
|
||||||
def own_folders(user, prefixes):
|
|
||||||
# folder name => guid of the user's own folders; listed first, so folders others share are not opened
|
|
||||||
names = set(name for name in doveadm('-f', 'tab', 'mailbox', 'list', '-u', user).splitlines()[1:]
|
|
||||||
if name and not any((name + '/').startswith(prefix) for prefix in prefixes))
|
|
||||||
folders = {}
|
|
||||||
if not names:
|
|
||||||
return folders
|
|
||||||
for line in doveadm('-f', 'tab', 'mailbox', 'status', '-u', user, '--', 'guid', *sorted(names), partial=True).splitlines()[1:]:
|
|
||||||
name, _, guid = line.rpartition('\t')
|
|
||||||
if name in names and re.fullmatch(r'[0-9a-f]{32}', guid):
|
|
||||||
folders[name] = guid
|
|
||||||
return folders
|
|
||||||
|
|
||||||
def canonical(name):
|
|
||||||
# Dovecot writes INBOX in capitals, also as the parent of folders
|
|
||||||
return 'INBOX' + name[5:] if name[:5].upper() == 'INBOX' and name[5:6] in ('', '/') else name
|
|
||||||
|
|
||||||
def matches(action, name, names):
|
|
||||||
# match: the folder itself, an own folder name with *, the subfolders of a special folder or the inbox, all folders
|
|
||||||
key, match = action['folder'], action['match']
|
|
||||||
if match == 'all':
|
|
||||||
return True
|
|
||||||
if key.startswith(own_folder):
|
|
||||||
# * is the only wildcard of own folder names
|
|
||||||
pattern = '.*'.join(re.escape(part) for part in canonical(key[len(own_folder):]).split('*'))
|
|
||||||
return re.fullmatch(pattern, name) is not None
|
|
||||||
folders = ['INBOX'] if key == 'inbox' else names.get(key, ())
|
|
||||||
if match == 'subfolders':
|
|
||||||
return any(name.startswith(folder + '/') for folder in folders)
|
|
||||||
return name in folders
|
|
||||||
|
|
||||||
def decide(actions, folders, names):
|
|
||||||
# rule id => (its action, the folders it decides about): every folder goes to the first action that matches it
|
|
||||||
decided = {}
|
|
||||||
for name in sorted(folders):
|
|
||||||
for action in actions:
|
|
||||||
if matches(action, canonical(name), names):
|
|
||||||
decided.setdefault(action['rule_id'], (action, []))[1].append(name)
|
|
||||||
break
|
|
||||||
return decided
|
|
||||||
|
|
||||||
def found(user, query):
|
|
||||||
return len(doveadm('search', '-u', user, '--', *query).splitlines())
|
|
||||||
|
|
||||||
def clean(user, action, selected, folders, result):
|
|
||||||
# name and guid together: doveadm then only opens these folders
|
|
||||||
query = []
|
|
||||||
for name in selected:
|
|
||||||
query += (['OR'] if query else []) + ['(', 'mailbox', name, 'mailbox-guid', folders[name], ')']
|
|
||||||
query = ['('] + query + [')', 'savedbefore', '%dd' % int(action['days'])]
|
|
||||||
if action['keep_flagged']:
|
|
||||||
query += ['NOT', 'FLAGGED']
|
|
||||||
result['matched'] = found(user, query)
|
|
||||||
if not result['matched'] or action['mode'] != 'delete':
|
|
||||||
return
|
|
||||||
try:
|
|
||||||
doveadm('expunge', '-u', user, '--', *query)
|
|
||||||
result['deleted'] = result['matched']
|
|
||||||
except Exception as e:
|
|
||||||
# part of the mail may be gone: what is left is counted
|
|
||||||
result['error'] = str(e)[:1000]
|
|
||||||
try:
|
|
||||||
result['deleted'] = max(0, result['matched'] - found(user, query))
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def main():
|
|
||||||
if os.geteuid() == 0:
|
|
||||||
# as vmail like the nightly job: a run as root would leave a lock file the runs as vmail cannot open
|
|
||||||
os.execv('/usr/local/bin/gosu', ['gosu', 'vmail', sys.executable, os.path.abspath(__file__)] + sys.argv[1:])
|
|
||||||
# released by the kernel when the process ends, a crashed run leaves no stale lock
|
|
||||||
lock_fd = os.open(lock_file, os.O_RDWR | os.O_CREAT, 0o600)
|
|
||||||
try:
|
|
||||||
fcntl.flock(lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
|
|
||||||
except OSError:
|
|
||||||
sys.exit("retention: can't lock " + lock_file)
|
|
||||||
reports = Reports()
|
|
||||||
run = {'started': int(time.time()), 'mailboxes': 0, 'matched': 0, 'deleted': 0, 'errors': 0, 'error': ''}
|
|
||||||
summary = {}
|
|
||||||
try:
|
|
||||||
names, prefixes = configuration()
|
|
||||||
for mailbox in plan():
|
|
||||||
user = mailbox['username']
|
|
||||||
run['mailboxes'] += 1
|
|
||||||
try:
|
|
||||||
if '*' in user or '?' in user:
|
|
||||||
# doveadm -u would run for every user the name matches as a mask
|
|
||||||
raise RuntimeError('username with * or ?, doveadm reads it as a mask')
|
|
||||||
folders, error = own_folders(user, prefixes), ''
|
|
||||||
decided = decide(mailbox['actions'], folders, names)
|
|
||||||
except Exception as e:
|
|
||||||
# the folders are unknown: an error for every rule of the mailbox
|
|
||||||
folders, error, decided = {}, str(e)[:1000], {}
|
|
||||||
for action in mailbox['actions']:
|
|
||||||
decided.setdefault(action['rule_id'], (action, []))
|
|
||||||
for rule_id, (action, selected) in decided.items():
|
|
||||||
rule = summary.setdefault(rule_id, {'rule_id': rule_id, 'mailboxes': 0, 'matched': 0, 'deleted': 0, 'errors': 0,
|
|
||||||
'simulated': int(action['mode'] != 'delete')})
|
|
||||||
# the log keeps 10000 characters of the folder names, more would only make the report too large
|
|
||||||
result = {'username': user, 'rule_id': rule_id, 'folder': '\n'.join(selected)[:10000], 'days': action['days'], 'matched': 0,
|
|
||||||
'deleted': 0, 'simulated': rule['simulated'], 'error': error}
|
|
||||||
if not error:
|
|
||||||
try:
|
|
||||||
clean(user, action, selected, folders, result)
|
|
||||||
except Exception as e:
|
|
||||||
result['error'] = str(e)[:1000]
|
|
||||||
for counter in (rule, run):
|
|
||||||
counter['matched'] += result['matched']
|
|
||||||
counter['deleted'] += result['deleted']
|
|
||||||
counter['errors'] += int(result['error'] != '')
|
|
||||||
rule['mailboxes'] += 1
|
|
||||||
# only mailboxes with found mail or an error are logged, every rule gets a summary
|
|
||||||
if result['matched'] or result['error']:
|
|
||||||
reports.add(result)
|
|
||||||
except Exception as e:
|
|
||||||
run['error'] = str(e)[:1000]
|
|
||||||
reported = reports.send(list(summary.values()), run)
|
|
||||||
print('retention: %d mailboxes, %d mails deleted, %d found by simulating rules, %d errors' % (run['mailboxes'],
|
|
||||||
run['deleted'], sum(rule['matched'] for rule in summary.values() if rule['simulated']), run['errors']))
|
|
||||||
if run['error']:
|
|
||||||
print('retention: %s' % run['error'], file=sys.stderr)
|
|
||||||
if not reported:
|
|
||||||
print('retention: the results could not be reported', file=sys.stderr)
|
|
||||||
if run['error'] or not reported:
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
@@ -4,7 +4,7 @@ catch_non_zero() {
|
|||||||
${CMD} > /dev/null
|
${CMD} > /dev/null
|
||||||
EC=$?
|
EC=$?
|
||||||
if [ ${EC} -ne 0 ]; then
|
if [ ${EC} -ne 0 ]; then
|
||||||
echo "Command ${CMD//${REDISPASS}/***} failed to execute, exit code was ${EC}"
|
echo "Command ${CMD} failed to execute, exit code was ${EC}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
source /source_env.sh
|
source /source_env.sh
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ class BanManager:
|
|||||||
and the allowlist. Every firewall change runs under lock, which also guards the other firewall work of netfilter
|
and the allowlist. Every firewall change runs under lock, which also guards the other firewall work of netfilter
|
||||||
(chains, SNAT), because the backends must not run in parallel."""
|
(chains, SNAT), because the backends must not run in parallel."""
|
||||||
|
|
||||||
|
# Seconds failed logins of an address are not counted after the auth backend was unavailable for it
|
||||||
|
EXCUSE_TIME = 60
|
||||||
|
|
||||||
def __init__(self, r, tables, options, logger, lock, clock=time.time):
|
def __init__(self, r, tables, options, logger, lock, clock=time.time):
|
||||||
self.r = r
|
self.r = r
|
||||||
self.tables = tables
|
self.tables = tables
|
||||||
@@ -18,6 +21,16 @@ class BanManager:
|
|||||||
self.banned = set()
|
self.banned = set()
|
||||||
self.denied = {}
|
self.denied = {}
|
||||||
self.allowlist = []
|
self.allowlist = []
|
||||||
|
self.excused = {}
|
||||||
|
|
||||||
|
def excuse(self, ip):
|
||||||
|
"""The auth backend could not check a login of ip: its failed logins are not counted for EXCUSE_TIME"""
|
||||||
|
with self.lock:
|
||||||
|
now = self.clock()
|
||||||
|
if self.excused.get(ip, 0) <= now:
|
||||||
|
self.logger.logWarn('Auth backend unavailable for %s, its failed logins of the next %d seconds are not counted' % (
|
||||||
|
ip, self.EXCUSE_TIME))
|
||||||
|
self.excused[ip] = now + self.EXCUSE_TIME
|
||||||
|
|
||||||
def attempt(self, ip):
|
def attempt(self, ip):
|
||||||
"""Counts a failed attempt of ip and bans its network after max_attempts within retry_window"""
|
"""Counts a failed attempt of ip and bans its network after max_attempts within retry_window"""
|
||||||
@@ -30,6 +43,9 @@ class BanManager:
|
|||||||
if allowed is not None:
|
if allowed is not None:
|
||||||
self.logger.logInfo('Address %s is allowlisted by rule %s' % (ip, allowed))
|
self.logger.logInfo('Address %s is allowlisted by rule %s' % (ip, allowed))
|
||||||
return
|
return
|
||||||
|
if self.excused.get(ip, 0) > now:
|
||||||
|
self.logger.logInfo('Not counting the failed login of %s, the auth backend was unavailable' % ip)
|
||||||
|
return
|
||||||
if net in self.banned:
|
if net in self.banned:
|
||||||
# log lines of connections from before the ban
|
# log lines of connections from before the ban
|
||||||
return
|
return
|
||||||
@@ -192,6 +208,8 @@ class BanManager:
|
|||||||
for net in [net for net, counter in self.counters.items()
|
for net in [net for net, counter in self.counters.items()
|
||||||
if net not in self.banned and counter['ban_counter'] == 0 and now - counter['last_attempt'] > window]:
|
if net not in self.banned and counter['ban_counter'] == 0 and now - counter['last_attempt'] > window]:
|
||||||
del self.counters[net]
|
del self.counters[net]
|
||||||
|
for ip in [ip for ip, until in self.excused.items() if until <= now]:
|
||||||
|
del self.excused[ip]
|
||||||
|
|
||||||
def apply(self, nets):
|
def apply(self, nets):
|
||||||
for net in self.tables.ban(nets):
|
for net in self.tables.ban(nets):
|
||||||
|
|||||||
@@ -109,6 +109,12 @@ class Netfilter:
|
|||||||
def handle_line(self, line):
|
def handle_line(self, line):
|
||||||
# a broken line must not end the watcher
|
# a broken line must not end the watcher
|
||||||
try:
|
try:
|
||||||
|
excused = Regexes.temporary_failure(line)
|
||||||
|
if excused is not None:
|
||||||
|
ip = Regexes.parse_ip(excused)
|
||||||
|
if self.external(ip):
|
||||||
|
self.bans.excuse(ip)
|
||||||
|
return
|
||||||
result = self.regexes.match(line)
|
result = self.regexes.match(line)
|
||||||
if result is None:
|
if result is None:
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -6,43 +6,20 @@ import re
|
|||||||
class Regexes:
|
class Regexes:
|
||||||
"""Rules for log lines (Redis F2B_REGEX): rule id => regex whose first group captures the client address"""
|
"""Rules for log lines (Redis F2B_REGEX): rule id => regex whose first group captures the client address"""
|
||||||
|
|
||||||
# Anchored to the line start: text clients control in other lines (login names, SMTP commands) must not match.
|
|
||||||
# Failed IMAP, POP3, Sieve and SMTP logins are reported by mailcowauth.php (rule 3), not by Dovecot or Postfix.
|
|
||||||
# Only the master passdb is checked by Dovecot itself (rule 8); the last address is the one Dovecot added.
|
|
||||||
DEFAULTS = {
|
DEFAULTS = {
|
||||||
1: r'^mailcow UI: Invalid password for .+ by ([0-9a-f\.:]+)$',
|
1: r'mailcow UI: Invalid password for .+ by ([0-9a-f\.:]+)',
|
||||||
2: r'^Rspamd UI: Invalid password by ([0-9a-f\.:]+)$',
|
2: r'Rspamd UI: Invalid password by ([0-9a-f\.:]+)',
|
||||||
3: r'^MAILCOWAUTH: Login failed for user .+ with service \w* from IP ([0-9a-f\.:]+)$',
|
3: r'warning: .*\[([0-9a-f\.:]+)\]: SASL .+ authentication failed: (?!.*Connection lost to authentication server).+',
|
||||||
4: r'^warning: non-SMTP command from [^\[\]\s]*\[([0-9a-f\.:]+)\]:.+',
|
4: r'warning: non-SMTP command from .*\[([0-9a-f\.:]+)]:.+',
|
||||||
5: r'^NOQUEUE: reject: RCPT from \[([0-9a-f\.:]+)].+Protocol error.+',
|
5: r'NOQUEUE: reject: RCPT from \[([0-9a-f\.:]+)].+Protocol error.+',
|
||||||
6: r'^(?:\[\d+\]: )?SOGo\w* Login from \'(?:[0-9a-f\.:]+, )*([0-9a-f\.:]+)\' for user .+ might not have worked',
|
6: r'\w+\([^,]+,([0-9a-f\.:]+),<[^>]+>\): Password mismatch \(SHA1 of given password: [a-f0-9]+\)',
|
||||||
7: r'([0-9a-f\.:]+) \"GET \/SOGo\/.* HTTP.+\" 403 .+',
|
7: r'\w+\([^,]+,([0-9a-f\.:]+),<[^>]+>\): unknown user \(SHA1 of given password: [a-f0-9]+\)',
|
||||||
8: r'^auth: passwd-file\(.*,([0-9a-f\.:]+),master(?:,<[^<>]*>)?\): (?:Password mismatch|unknown user)',
|
8: r'SOGo.+ Login from \'([0-9a-f\.:]+)\' for user .+ might not have worked',
|
||||||
|
9: r'([0-9a-f\.:]+) \"GET \/SOGo\/.* HTTP.+\" 403 .+',
|
||||||
}
|
}
|
||||||
# Former default rules (with any rule id) => rule id of their replacement, None: the rule is removed.
|
# Dovecot could not ask the auth backend (identity provider down, mailcowauth.php unreachable). Postfix logs
|
||||||
# Rules the admin changed are kept.
|
# such a temporary failure like a wrong password, so failed logins of the address are not counted for a while.
|
||||||
FORMER_DEFAULTS = {
|
TEMPORARY_FAILURE = re.compile(r'lua\([^,]+,([0-9a-f\.:]+)(?:,<[^>]+>)?\): passdb-lua: Upstream (?:unavailable|unreachable)')
|
||||||
r'mailcow UI: Invalid password for .+ by ([0-9a-f\.:]+)': 1,
|
|
||||||
r'Rspamd UI: Invalid password by ([0-9a-f\.:]+)': 2,
|
|
||||||
r'warning: .*\[([0-9a-f\.:]+)\]: SASL .+ authentication failed': 3,
|
|
||||||
r'warning: .*\[([0-9a-f\.:]+)\]: SASL .+ authentication failed: (?!.*Connection lost to authentication server).+': 3,
|
|
||||||
r'warning: non-SMTP command from .*\[([0-9a-f\.:]+)]:.+': 4,
|
|
||||||
r'NOQUEUE: reject: RCPT from \[([0-9a-f\.:]+)].+Protocol error.+': 5,
|
|
||||||
r"SOGo.+ Login from '([0-9a-f\.:]+)' for user .+ might not have worked": 6,
|
|
||||||
r'SOGo.+ Login from \'([0-9a-f\.:]+)\' for user .+ might not have worked': 6,
|
|
||||||
r'-login: Disconnected \(auth failed, .+\): user=.*, method=.+, rip=([0-9a-f\.:]+),': None,
|
|
||||||
r'-login: Disconnected.+ \(auth failed, .+\): user=.*, method=.+, rip=([0-9a-f\.:]+),': None,
|
|
||||||
r'-login: Aborted login \(auth failed .+\): user=.+, rip=([0-9a-f\.:]+), lip.+': None,
|
|
||||||
r'-login: Aborted login.+ \(auth failed .+\): user=.+, rip=([0-9a-f\.:]+), lip.+': None,
|
|
||||||
r'-login: Aborted login \(tried to use disallowed .+\): user=.+, rip=([0-9a-f\.:]+), lip.+': None,
|
|
||||||
r'-login: Aborted login.+ \(tried to use disallowed .+\): user=.+, rip=([0-9a-f\.:]+), lip.+': None,
|
|
||||||
r'auth: static\([^,]+,([0-9a-f\.:]+),<[^>]+>\): Password mismatch \(SHA1 of given password: [a-f0-9]+\)': 8,
|
|
||||||
r'auth: \w+\([^,]+,([0-9a-f\.:]+),<[^>]+>\): Password mismatch \(SHA1 of given password: [a-f0-9]+\)': 8,
|
|
||||||
r'\w+\([^,]+,([0-9a-f\.:]+),<[^>]+>\): Password mismatch \(SHA1 of given password: [a-f0-9]+\)': 8,
|
|
||||||
r'\w+\([^,]+,([0-9a-f\.:]+),<[^>]+>\): unknown user \(SHA1 of given password: [a-f0-9]+\)': None,
|
|
||||||
}
|
|
||||||
# Lines of the web UI are not sanitized like syslog lines: a newline in a login name must not hide the address
|
|
||||||
CONTROL_CHARS = re.compile(r'[\x00-\x1f\x7f]')
|
|
||||||
|
|
||||||
def __init__(self, logger):
|
def __init__(self, logger):
|
||||||
self.logger = logger
|
self.logger = logger
|
||||||
@@ -65,10 +42,6 @@ class Regexes:
|
|||||||
if not isinstance(stored, dict):
|
if not isinstance(stored, dict):
|
||||||
self.logger.logWarn('F2B_REGEX is no JSON object, keeping the current rules')
|
self.logger.logWarn('F2B_REGEX is no JSON object, keeping the current rules')
|
||||||
return
|
return
|
||||||
migrated = self.migrate(stored)
|
|
||||||
if migrated != stored:
|
|
||||||
self.store_migrated(r)
|
|
||||||
stored = migrated
|
|
||||||
|
|
||||||
rules = []
|
rules = []
|
||||||
for rule_id, regex in sorted(stored.items(), key=lambda item: self.sort_key(item[0])):
|
for rule_id, regex in sorted(stored.items(), key=lambda item: self.sort_key(item[0])):
|
||||||
@@ -81,7 +54,6 @@ class Regexes:
|
|||||||
|
|
||||||
def match(self, line):
|
def match(self, line):
|
||||||
"""(rule id, captured address) of the first rule that matches the line, None if no rule matches"""
|
"""(rule id, captured address) of the first rule that matches the line, None if no rule matches"""
|
||||||
line = self.CONTROL_CHARS.sub('_', line)
|
|
||||||
for rule_id, regex in self.rules:
|
for rule_id, regex in self.rules:
|
||||||
result = regex.search(line)
|
result = regex.search(line)
|
||||||
if result and result.lastindex and result.group(1):
|
if result and result.lastindex and result.group(1):
|
||||||
@@ -89,35 +61,10 @@ class Regexes:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def migrate(cls, stored):
|
def temporary_failure(cls, line):
|
||||||
"""The stored rules with former default rules replaced by the current ones (or removed)"""
|
"""Address of a login that failed because the auth backend was unavailable, None for other lines"""
|
||||||
migrated = {}
|
result = cls.TEMPORARY_FAILURE.search(line)
|
||||||
for rule_id, regex in stored.items():
|
return result.group(1) if result else None
|
||||||
if isinstance(regex, str) and regex in cls.FORMER_DEFAULTS:
|
|
||||||
replacement = cls.FORMER_DEFAULTS[regex]
|
|
||||||
if replacement is None:
|
|
||||||
continue
|
|
||||||
regex = cls.DEFAULTS[replacement]
|
|
||||||
migrated[rule_id] = regex
|
|
||||||
return migrated
|
|
||||||
|
|
||||||
def store_migrated(self, r):
|
|
||||||
# WATCH keeps a save of the UI between reading and writing
|
|
||||||
def replace(pipe):
|
|
||||||
current = json.loads(pipe.get('F2B_REGEX') or '{}')
|
|
||||||
if not isinstance(current, dict):
|
|
||||||
return
|
|
||||||
migrated = self.migrate(current)
|
|
||||||
if migrated == current:
|
|
||||||
return
|
|
||||||
pipe.multi()
|
|
||||||
pipe.set('F2B_REGEX', json.dumps(migrated, ensure_ascii=False))
|
|
||||||
|
|
||||||
try:
|
|
||||||
r.transaction(replace, 'F2B_REGEX')
|
|
||||||
self.logger.logInfo('Replaced former default rules in F2B_REGEX')
|
|
||||||
except Exception as ex:
|
|
||||||
self.logger.logWarn('Could not replace former default rules in F2B_REGEX: %s' % ex)
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def parse_ip(text):
|
def parse_ip(text):
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
FROM nginx:1.30.7-alpine
|
FROM nginx:1.30.6-alpine
|
||||||
LABEL maintainer "The Infrastructure Company GmbH <info@servercow.de>"
|
LABEL maintainer "The Infrastructure Company GmbH <info@servercow.de>"
|
||||||
|
|
||||||
ENV PIP_BREAK_SYSTEM_PACKAGES=1
|
ENV PIP_BREAK_SYSTEM_PACKAGES=1
|
||||||
|
|
||||||
RUN apk upgrade --no-cache && \
|
RUN apk add --no-cache nginx \
|
||||||
apk add --no-cache nginx \
|
|
||||||
python3 \
|
python3 \
|
||||||
py3-pip && \
|
py3-pip && \
|
||||||
pip install --upgrade pip && \
|
pip install --upgrade pip && \
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import os
|
import os
|
||||||
import re
|
|
||||||
import subprocess
|
import subprocess
|
||||||
from jinja2 import Environment, FileSystemLoader
|
from jinja2 import Environment, FileSystemLoader
|
||||||
|
|
||||||
@@ -45,11 +44,6 @@ def prepare_template_vars():
|
|||||||
ipv4_network = os.getenv("IPV4_NETWORK", "172.22.1")
|
ipv4_network = os.getenv("IPV4_NETWORK", "172.22.1")
|
||||||
additional_server_names = os.getenv("ADDITIONAL_SERVER_NAMES", "")
|
additional_server_names = os.getenv("ADDITIONAL_SERVER_NAMES", "")
|
||||||
trusted_proxies = os.getenv("TRUSTED_PROXIES", "")
|
trusted_proxies = os.getenv("TRUSTED_PROXIES", "")
|
||||||
# nginx size syntax, invalid values fall back to the default
|
|
||||||
max_body_size = os.getenv("NGINX_MAX_BODY_SIZE", "128m").strip()
|
|
||||||
if not re.fullmatch(r'[0-9]+[kKmMgG]?', max_body_size):
|
|
||||||
print(f"Invalid NGINX_MAX_BODY_SIZE '{max_body_size}', using 128m")
|
|
||||||
max_body_size = "128m"
|
|
||||||
|
|
||||||
template_vars = {
|
template_vars = {
|
||||||
'IPV4_NETWORK': ipv4_network,
|
'IPV4_NETWORK': ipv4_network,
|
||||||
@@ -66,7 +60,6 @@ def prepare_template_vars():
|
|||||||
'PHPFPMHOST': os.getenv("PHPFPMHOST", "php-fpm-mailcow"),
|
'PHPFPMHOST': os.getenv("PHPFPMHOST", "php-fpm-mailcow"),
|
||||||
'ENABLE_IPV6': os.getenv("ENABLE_IPV6", "true").lower() != "false",
|
'ENABLE_IPV6': os.getenv("ENABLE_IPV6", "true").lower() != "false",
|
||||||
'HTTP_REDIRECT': os.getenv("HTTP_REDIRECT", "n").lower() in ("y", "yes"),
|
'HTTP_REDIRECT': os.getenv("HTTP_REDIRECT", "n").lower() in ("y", "yes"),
|
||||||
'NGINX_MAX_BODY_SIZE': max_body_size,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ssl_dir = '/etc/ssl/mail/'
|
ssl_dir = '/etc/ssl/mail/'
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ ARG MEMCACHED_PECL_VERSION=3.4.0
|
|||||||
# renovate: datasource=github-tags depName=phpredis/phpredis versioning=semver-coerced extractVersion=(?<version>.*)$
|
# renovate: datasource=github-tags depName=phpredis/phpredis versioning=semver-coerced extractVersion=(?<version>.*)$
|
||||||
ARG REDIS_PECL_VERSION=6.3.0
|
ARG REDIS_PECL_VERSION=6.3.0
|
||||||
# renovate: datasource=github-tags depName=composer/composer versioning=semver-coerced extractVersion=(?<version>.*)$
|
# renovate: datasource=github-tags depName=composer/composer versioning=semver-coerced extractVersion=(?<version>.*)$
|
||||||
ARG COMPOSER_VERSION=2.10.2
|
ARG COMPOSER_VERSION=2.11.0
|
||||||
|
|
||||||
RUN apk add -U --no-cache autoconf \
|
RUN apk add -U --no-cache autoconf \
|
||||||
aspell-dev \
|
aspell-dev \
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ WORKDIR /src
|
|||||||
ENV CGO_ENABLED=0 \
|
ENV CGO_ENABLED=0 \
|
||||||
GO111MODULE=on \
|
GO111MODULE=on \
|
||||||
NOOPT=1 \
|
NOOPT=1 \
|
||||||
VERSION=1.14.5
|
VERSION=1.14.0
|
||||||
|
|
||||||
RUN git clone --branch v${VERSION} https://github.com/Zuplu/postfix-tlspol && \
|
RUN git clone --branch v${VERSION} https://github.com/Zuplu/postfix-tlspol && \
|
||||||
cd /src/postfix-tlspol && \
|
cd /src/postfix-tlspol && \
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ RUN groupadd -g 102 postfix \
|
|||||||
postfix \
|
postfix \
|
||||||
postfix-mysql \
|
postfix-mysql \
|
||||||
postfix-pcre \
|
postfix-pcre \
|
||||||
python3 \
|
|
||||||
redis-tools \
|
redis-tools \
|
||||||
sasl2-bin \
|
sasl2-bin \
|
||||||
sudo \
|
sudo \
|
||||||
@@ -47,7 +46,6 @@ COPY postfix.sh /opt/postfix.sh
|
|||||||
COPY rspamd-pipe-ham /usr/local/bin/rspamd-pipe-ham
|
COPY rspamd-pipe-ham /usr/local/bin/rspamd-pipe-ham
|
||||||
COPY rspamd-pipe-spam /usr/local/bin/rspamd-pipe-spam
|
COPY rspamd-pipe-spam /usr/local/bin/rspamd-pipe-spam
|
||||||
COPY whitelist_forwardinghosts.sh /usr/local/bin/whitelist_forwardinghosts.sh
|
COPY whitelist_forwardinghosts.sh /usr/local/bin/whitelist_forwardinghosts.sh
|
||||||
COPY mailcow-policy.py /usr/local/bin/mailcow-policy.py
|
|
||||||
COPY stop-supervisor.sh /usr/local/sbin/stop-supervisor.sh
|
COPY stop-supervisor.sh /usr/local/sbin/stop-supervisor.sh
|
||||||
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
|
||||||
@@ -55,7 +53,6 @@ RUN chmod +x /opt/postfix.sh \
|
|||||||
/usr/local/bin/rspamd-pipe-ham \
|
/usr/local/bin/rspamd-pipe-ham \
|
||||||
/usr/local/bin/rspamd-pipe-spam \
|
/usr/local/bin/rspamd-pipe-spam \
|
||||||
/usr/local/bin/whitelist_forwardinghosts.sh \
|
/usr/local/bin/whitelist_forwardinghosts.sh \
|
||||||
/usr/local/bin/mailcow-policy.py \
|
|
||||||
/usr/local/sbin/stop-supervisor.sh
|
/usr/local/sbin/stop-supervisor.sh
|
||||||
RUN rm -rf /tmp/* /var/tmp/*
|
RUN rm -rf /tmp/* /var/tmp/*
|
||||||
|
|
||||||
|
|||||||
@@ -1,54 +0,0 @@
|
|||||||
#!/usr/bin/python3
|
|
||||||
# Policy service of the mail policies (mailcow-policy in master.cf, spawned by Postfix): reads the policy requests
|
|
||||||
# of smtpd and asks the mailcow UI for the action (nginx:8081/mailpolicy.php). Without an answer the recipient is
|
|
||||||
# deferred; smtpd only asks while policies or internal aliases exist (mysql_mail_policy_maps.cf).
|
|
||||||
|
|
||||||
import http.client
|
|
||||||
import re
|
|
||||||
import socket
|
|
||||||
import sys
|
|
||||||
from urllib.parse import urlencode
|
|
||||||
|
|
||||||
# one line: DUNNO or a rejection with code and text
|
|
||||||
valid_action = re.compile(rb'DUNNO|[45]\d\d [45]\.\d{1,3}\.\d{1,3} [\x20-\x7e]{1,200}')
|
|
||||||
unavailable = b'DEFER_IF_PERMIT Mail policy check temporarily unavailable'
|
|
||||||
# address of nginx, resolved once per process (a lookup costs more than the check)
|
|
||||||
nginx = None
|
|
||||||
|
|
||||||
def check(request):
|
|
||||||
global nginx
|
|
||||||
body = urlencode(sorted(request.items())).encode()
|
|
||||||
try:
|
|
||||||
if nginx is None:
|
|
||||||
nginx = socket.gethostbyname('nginx')
|
|
||||||
# http.client sets TCP_NODELAY, so the body is not held back until the headers are acknowledged
|
|
||||||
# below the timeout of Postfix (main.cf), so an answer always arrives
|
|
||||||
conn = http.client.HTTPConnection(nginx, 8081, timeout=8)
|
|
||||||
try:
|
|
||||||
conn.request('POST', '/mailpolicy.php', body, {'Host': 'nginx', 'Content-Type': 'application/x-www-form-urlencoded'})
|
|
||||||
response = conn.getresponse()
|
|
||||||
action = response.read()
|
|
||||||
finally:
|
|
||||||
conn.close()
|
|
||||||
except (OSError, http.client.HTTPException):
|
|
||||||
# nginx may have a new address after a restart
|
|
||||||
nginx = None
|
|
||||||
return unavailable
|
|
||||||
return action if response.status == 200 and valid_action.fullmatch(action) else unavailable
|
|
||||||
|
|
||||||
def main():
|
|
||||||
request = {}
|
|
||||||
# attributes as bytes: addresses may contain any 8-bit characters
|
|
||||||
for line in sys.stdin.buffer:
|
|
||||||
line = line.rstrip(b'\r\n')
|
|
||||||
if line:
|
|
||||||
name, separator, value = line.partition(b'=')
|
|
||||||
if separator:
|
|
||||||
request[name] = value
|
|
||||||
continue
|
|
||||||
sys.stdout.buffer.write(b'action=' + check(request) + b'\n\n')
|
|
||||||
sys.stdout.buffer.flush()
|
|
||||||
request = {}
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main()
|
|
||||||
@@ -15,21 +15,6 @@ until dig +short mailcow.email > /dev/null; do
|
|||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
# Wait for updated schema (DB_VERSION from docker-compose.yml), the maps read tables the init_db of php-fpm creates on updates
|
|
||||||
DBV_NOW=$(mariadb --ssl=false --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "SELECT version FROM versions WHERE application = 'db_schema';" -BN 2>/dev/null)
|
|
||||||
DBV_WAIT=0
|
|
||||||
while [[ "${DBV_NOW}" != "${DB_VERSION}" ]] && [[ ${DBV_WAIT} -lt 60 ]]; do
|
|
||||||
echo "Waiting for schema update..."
|
|
||||||
sleep 5
|
|
||||||
DBV_WAIT=$((DBV_WAIT + 1))
|
|
||||||
DBV_NOW=$(mariadb --ssl=false --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "SELECT version FROM versions WHERE application = 'db_schema';" -BN 2>/dev/null)
|
|
||||||
done
|
|
||||||
if [[ "${DBV_NOW}" != "${DB_VERSION}" ]]; then
|
|
||||||
echo -e "\e[31mDB schema is ${DBV_NOW}, expected ${DB_VERSION} - starting anyway, check the php-fpm log (init_db)\e[0m"
|
|
||||||
else
|
|
||||||
echo "DB schema is ${DBV_NOW}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cat <<EOF > /etc/aliases
|
cat <<EOF > /etc/aliases
|
||||||
# Autogenerated by mailcow
|
# Autogenerated by mailcow
|
||||||
null: /dev/null
|
null: /dev/null
|
||||||
@@ -178,45 +163,6 @@ query = SELECT CONCAT('smtp_via_transport_maps:', nexthop) AS transport FROM tra
|
|||||||
AND destination = '%s';
|
AND destination = '%s';
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Archive copies (journal) to the archive set in the admin UI: on port 591 the sender archive-bounce@localhost
|
|
||||||
# sends the whole mail through archive_smtp (master.cf), whatever the recipient domain
|
|
||||||
cat <<EOF > /opt/postfix/conf/sql/mysql_archive_sender_filter_maps.cf
|
|
||||||
# Autogenerated by mailcow
|
|
||||||
user = ${DBUSER}
|
|
||||||
password = ${DBPASS}
|
|
||||||
hosts = unix:/var/run/mysqld/mysqld.sock
|
|
||||||
dbname = ${DBNAME}
|
|
||||||
query = SELECT CONCAT('FILTER archive_smtp:', nexthop) AS action FROM archive_transport
|
|
||||||
WHERE active = '1'
|
|
||||||
AND '%s' = 'archive-bounce@localhost'
|
|
||||||
LIMIT 1;
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat <<EOF > /opt/postfix/conf/sql/mysql_archive_sasl_passwd_maps.cf
|
|
||||||
# Autogenerated by mailcow
|
|
||||||
user = ${DBUSER}
|
|
||||||
password = ${DBPASS}
|
|
||||||
hosts = unix:/var/run/mysqld/mysqld.sock
|
|
||||||
dbname = ${DBNAME}
|
|
||||||
query = SELECT CONCAT_WS(':', username, password) AS auth_data FROM archive_transport
|
|
||||||
WHERE nexthop = '%s'
|
|
||||||
AND active = '1'
|
|
||||||
AND username != ''
|
|
||||||
LIMIT 1;
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat <<EOF > /opt/postfix/conf/sql/mysql_archive_tls_policy_maps.cf
|
|
||||||
# Autogenerated by mailcow
|
|
||||||
user = ${DBUSER}
|
|
||||||
password = ${DBPASS}
|
|
||||||
hosts = unix:/var/run/mysqld/mysqld.sock
|
|
||||||
dbname = ${DBNAME}
|
|
||||||
query = SELECT tls_policy FROM archive_transport
|
|
||||||
WHERE nexthop = '%s'
|
|
||||||
AND active = '1'
|
|
||||||
LIMIT 1;
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat <<EOF > /opt/postfix/conf/sql/mysql_virtual_resource_maps.cf
|
cat <<EOF > /opt/postfix/conf/sql/mysql_virtual_resource_maps.cf
|
||||||
# Autogenerated by mailcow
|
# Autogenerated by mailcow
|
||||||
user = ${DBUSER}
|
user = ${DBUSER}
|
||||||
@@ -278,19 +224,6 @@ query = SELECT CONCAT_WS(':', username, password) AS auth_data FROM transports
|
|||||||
LIMIT 1;
|
LIMIT 1;
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Mail policies: while policies or internal aliases exist, smtpd asks the policy service (mailcow_mail_policy in main.cf)
|
|
||||||
cat <<EOF > /opt/postfix/conf/sql/mysql_mail_policy_maps.cf
|
|
||||||
# Autogenerated by mailcow
|
|
||||||
user = ${DBUSER}
|
|
||||||
password = ${DBPASS}
|
|
||||||
hosts = unix:/var/run/mysqld/mysqld.sock
|
|
||||||
dbname = ${DBNAME}
|
|
||||||
query = SELECT 'mailcow_mail_policy' FROM DUAL WHERE '%s' != ''
|
|
||||||
AND (EXISTS (SELECT 1 FROM mail_policy_member JOIN mail_policy ON mail_policy.id = mail_policy_member.policy_id
|
|
||||||
WHERE mail_policy.active = '1')
|
|
||||||
OR EXISTS (SELECT 1 FROM alias WHERE internal = '1' AND active IN ('1', '2')));
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat <<EOF > /opt/postfix/conf/sql/mysql_virtual_alias_domain_maps.cf
|
cat <<EOF > /opt/postfix/conf/sql/mysql_virtual_alias_domain_maps.cf
|
||||||
# Autogenerated by mailcow
|
# Autogenerated by mailcow
|
||||||
user = ${DBUSER}
|
user = ${DBUSER}
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
FROM alpine:3.24
|
|
||||||
|
|
||||||
LABEL maintainer="The Infrastructure Company GmbH <info@servercow.de>"
|
|
||||||
|
|
||||||
ENV LANG=C.UTF-8
|
|
||||||
ENV LC_ALL=C.UTF-8
|
|
||||||
# MariaDB Connector/C >= 3.4 refuses DB servers without TLS, the runner connects through the socket
|
|
||||||
ENV MARIADB_TLS_DISABLE_PEER_VERIFICATION=1
|
|
||||||
|
|
||||||
RUN apk add --no-cache --update \
|
|
||||||
ca-certificates \
|
|
||||||
git \
|
|
||||||
mariadb-client \
|
|
||||||
openssh-client \
|
|
||||||
py3-mysqlclient \
|
|
||||||
py3-pynacl \
|
|
||||||
python3 \
|
|
||||||
restic \
|
|
||||||
tini \
|
|
||||||
tzdata \
|
|
||||||
# dump, export, manifest and the mailcow directory are below /mailcow (paths of the snapshot), only root may read them
|
|
||||||
&& mkdir -m 700 /mailcow
|
|
||||||
|
|
||||||
COPY restic_runner.py /usr/local/bin/restic_runner.py
|
|
||||||
COPY sogo_restore.py /usr/local/bin/sogo_restore.py
|
|
||||||
|
|
||||||
ENTRYPOINT ["/sbin/tini", "--"]
|
|
||||||
CMD ["/usr/bin/python3", "-u", "/usr/local/bin/restic_runner.py"]
|
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -1,118 +0,0 @@
|
|||||||
"""SOGo part of a mailbox restore (component sogo, overwrites), called by the restic runner for one mailbox.
|
|
||||||
|
|
||||||
Runs `sogo-tool restore -f ALL <dir> <user>` and `sogo-tool restore -p <dir> <user>` in the sogo container through
|
|
||||||
dockerapi on the user's file of the nightly sogo-tool backup: missing calendars, address books and entries come back,
|
|
||||||
the names and shares of existing folders and all SOGo preferences are replaced by the backup's, entries changed since
|
|
||||||
stay. Then the user's entries in SOGo's cache (memcached) are removed, so the change shows at once.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import json
|
|
||||||
import os
|
|
||||||
import re
|
|
||||||
import socket
|
|
||||||
import ssl
|
|
||||||
import urllib.request
|
|
||||||
|
|
||||||
dockerapi_url = 'https://dockerapi:443'
|
|
||||||
memcached_addr = ('memcached-mailcow', 11211)
|
|
||||||
# dockerapi stops each of the two sogo-tool runs after 850 s
|
|
||||||
restore_timeout = 1800
|
|
||||||
# accepted by the dockerapi handler as well
|
|
||||||
user_re = re.compile(r'[A-Za-z0-9_][A-Za-z0-9._+-]*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)+')
|
|
||||||
|
|
||||||
|
|
||||||
def _short(text, limit=300):
|
|
||||||
# sogo-tool may print database URLs: no credentials, one line, the end has the error
|
|
||||||
text = re.sub(r'([A-Za-z][A-Za-z0-9+.-]*://)[^\s/@]*@', r'\1***@', str(text))
|
|
||||||
text = ' '.join(text.split())
|
|
||||||
return text if len(text) <= limit else '...' + text[-limit:]
|
|
||||||
|
|
||||||
|
|
||||||
def _api(path, body=None, timeout=60):
|
|
||||||
# dockerapi uses the mail certificate, its name does not match
|
|
||||||
ctx = ssl.create_default_context()
|
|
||||||
ctx.check_hostname = False
|
|
||||||
ctx.verify_mode = ssl.CERT_NONE
|
|
||||||
data = None if body is None else json.dumps(body).encode()
|
|
||||||
req = urllib.request.Request(dockerapi_url + path, data=data, headers={'Content-Type': 'application/json'},
|
|
||||||
method='GET' if body is None else 'POST')
|
|
||||||
with urllib.request.urlopen(req, timeout=timeout, context=ctx) as response:
|
|
||||||
return json.load(response)
|
|
||||||
|
|
||||||
|
|
||||||
def _sogo_container():
|
|
||||||
project = os.environ.get('COMPOSE_PROJECT_NAME', '').lower()
|
|
||||||
by_name = None
|
|
||||||
for cid, info in _api('/containers/json').items():
|
|
||||||
if not cid.isalnum() or not isinstance(info, dict):
|
|
||||||
continue
|
|
||||||
labels = (info.get('Config') or {}).get('Labels') or {}
|
|
||||||
if labels.get('com.docker.compose.service') == 'sogo-mailcow':
|
|
||||||
if not project or labels.get('com.docker.compose.project', '').lower() == project:
|
|
||||||
return cid
|
|
||||||
elif by_name is None and 'sogo-mailcow' in str(info.get('Name', '')):
|
|
||||||
by_name = cid
|
|
||||||
if by_name:
|
|
||||||
return by_name
|
|
||||||
raise RuntimeError('sogo container not found')
|
|
||||||
|
|
||||||
|
|
||||||
def _memcached_delete(keys):
|
|
||||||
keys = [k for k in keys if 0 < len(k.encode()) <= 250 and not re.search(r'[\s\x00-\x1f\x7f]', k)]
|
|
||||||
if not keys:
|
|
||||||
return
|
|
||||||
with socket.create_connection(memcached_addr, timeout=10) as s:
|
|
||||||
for key in keys:
|
|
||||||
s.sendall(b'delete ' + key.encode() + b'\r\n')
|
|
||||||
reply = b''
|
|
||||||
while not reply.endswith(b'\r\n'):
|
|
||||||
chunk = s.recv(64)
|
|
||||||
if not chunk:
|
|
||||||
raise RuntimeError('memcached closed the connection')
|
|
||||||
reply += chunk
|
|
||||||
if reply.strip() not in (b'DELETED', b'NOT_FOUND'):
|
|
||||||
raise RuntimeError('memcached: %s' % _short(reply.decode('ascii', 'replace')))
|
|
||||||
|
|
||||||
|
|
||||||
def _cache_keys(db, username):
|
|
||||||
# preferences and the ACLs of the user's folders (<uid>/Calendar/personal+acl); never read the c_*location
|
|
||||||
# columns of sogo_folder_info (database credentials)
|
|
||||||
keys = ['%s+defaults' % username, '%s+settings' % username]
|
|
||||||
cur = db.cursor()
|
|
||||||
try:
|
|
||||||
cur.execute('SELECT c_path FROM sogo_folder_info WHERE c_path2 = %s', (username,))
|
|
||||||
keys += ['%s+acl' % row[0][len('/Users/'):] for row in cur.fetchall() if row[0].startswith('/Users/')]
|
|
||||||
finally:
|
|
||||||
cur.close()
|
|
||||||
return keys
|
|
||||||
|
|
||||||
|
|
||||||
def restore(db, backup_dir, username, log):
|
|
||||||
"""Restores the SOGo data of one user from <backup_dir>/<username> (staged readable for the sogo user only).
|
|
||||||
db: open MySQLdb connection; log: callable for short progress lines. Returns {"added": 0|1, "errors": [...]}."""
|
|
||||||
result = {'added': 0, 'errors': []}
|
|
||||||
if not user_re.fullmatch(username):
|
|
||||||
result['errors'].append('username not supported by the SOGo restore')
|
|
||||||
return result
|
|
||||||
path = os.path.join(backup_dir, username)
|
|
||||||
if not os.path.isfile(path) or os.path.islink(path):
|
|
||||||
# sogo-tool backup ALL skips users without SOGo folders
|
|
||||||
# a key the UI translates
|
|
||||||
result['note'] = 'no_sogo_data'
|
|
||||||
log('sogo: no SOGo data in the snapshot')
|
|
||||||
return result
|
|
||||||
try:
|
|
||||||
res = _api('/containers/%s/exec' % _sogo_container(), {'cmd': 'sogo', 'task': 'restore', 'dir': backup_dir,
|
|
||||||
'username': username}, timeout=restore_timeout)
|
|
||||||
if not isinstance(res, dict) or res.get('type') != 'success':
|
|
||||||
raise RuntimeError('sogo-tool restore failed: %s' % _short(res.get('msg', '') if isinstance(res, dict) else res))
|
|
||||||
result['added'] = 1
|
|
||||||
log('sogo: calendars, address books and preferences reset to the backup')
|
|
||||||
except Exception as e:
|
|
||||||
result['errors'].append(_short(e))
|
|
||||||
try:
|
|
||||||
# SOGo caches ACLs and preferences for 15 minutes
|
|
||||||
_memcached_delete(_cache_keys(db, username))
|
|
||||||
except Exception as e:
|
|
||||||
result['errors'].append('SOGo cache not cleared, changes may show up after 15 minutes: %s' % _short(e))
|
|
||||||
return result
|
|
||||||
@@ -277,34 +277,9 @@ if [[ ! -z ${SPAMHAUS_DQS_KEY} ]]; then
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
"DBL" {
|
"DBL" {
|
||||||
# full copy of the DBL rule from modules.d/rbl.conf, pointed at DQS:
|
# override the defaults for DBL defined in modules.d/rbl.conf
|
||||||
# the override include replaces the stock rule instead of merging into it
|
|
||||||
rbl = "${SPAMHAUS_DQS_KEY}.dbl.dq.spamhaus.net";
|
rbl = "${SPAMHAUS_DQS_KEY}.dbl.dq.spamhaus.net";
|
||||||
disable_monitoring = true;
|
disable_monitoring = true;
|
||||||
checks = ["emails", "dkim", "helo", "rdns", "replyto", "urls", "content_urls"];
|
|
||||||
no_ip = true;
|
|
||||||
ignore_defaults = true;
|
|
||||||
exclude_users = false;
|
|
||||||
emails_domainonly = true;
|
|
||||||
selector = {
|
|
||||||
from_smtp = "from('smtp'):domain";
|
|
||||||
from_mime = "from('mime'):domain";
|
|
||||||
mid = "header(Message-Id).regexp('@([^\.]+\.[^>]+)').last";
|
|
||||||
}
|
|
||||||
returncodes = {
|
|
||||||
DBL_SPAM = "127.0.1.2";
|
|
||||||
DBL_PHISH = "127.0.1.4";
|
|
||||||
DBL_MALWARE = "127.0.1.5";
|
|
||||||
DBL_BOTNET = "127.0.1.6";
|
|
||||||
DBL_ABUSE = "127.0.1.102";
|
|
||||||
DBL_ABUSE_REDIR = "127.0.1.103";
|
|
||||||
DBL_ABUSE_PHISH = "127.0.1.104";
|
|
||||||
DBL_ABUSE_MALWARE = "127.0.1.105";
|
|
||||||
DBL_ABUSE_BOTNET = "127.0.1.106";
|
|
||||||
DBL_PROHIBIT = "127.0.1.255";
|
|
||||||
DBL_BLOCKED_OPENRESOLVER = "127.255.255.254";
|
|
||||||
DBL_BLOCKED = "127.255.255.255";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
"ZRD" {
|
"ZRD" {
|
||||||
ignore_defaults = true;
|
ignore_defaults = true;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# SOGo built from source to enable security patch application
|
# SOGo built from source to enable security patch application
|
||||||
# Repository: https://github.com/Alinto/sogo
|
# Repository: https://github.com/Alinto/sogo
|
||||||
# Version: SOGo-5.12.13
|
# Version: SOGo-5.12.12
|
||||||
#
|
#
|
||||||
# Applied security patches:
|
# Applied security patches:
|
||||||
# -
|
# -
|
||||||
@@ -12,8 +12,8 @@ FROM debian:bookworm
|
|||||||
LABEL maintainer="The Infrastructure Company GmbH <info@servercow.de>"
|
LABEL maintainer="The Infrastructure Company GmbH <info@servercow.de>"
|
||||||
|
|
||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
ARG SOGO_VERSION=SOGo-5.12.13
|
ARG SOGO_VERSION=SOGo-5.12.12
|
||||||
ARG SOPE_VERSION=SOPE-5.12.13
|
ARG SOPE_VERSION=SOPE-5.12.12
|
||||||
# Security patches to apply (space-separated commit hashes)
|
# Security patches to apply (space-separated commit hashes)
|
||||||
ARG SOGO_SECURITY_PATCHES=""
|
ARG SOGO_SECURITY_PATCHES=""
|
||||||
# renovate: datasource=github-releases depName=tianon/gosu versioning=semver-coerced extractVersion=^(?<version>.*)$
|
# renovate: datasource=github-releases depName=tianon/gosu versioning=semver-coerced extractVersion=^(?<version>.*)$
|
||||||
|
|||||||
@@ -43,19 +43,6 @@ while ! mariadb-admin status --skip-ssl --socket=/var/run/mysqld/mysqld.sock -u$
|
|||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
||||||
# Wait for the schema update (DB_VERSION) at startup, do not restart them meanwhile.
|
|
||||||
DBV_NOW=$(mariadb --skip-ssl --socket=/var/run/mysqld/mysqld.sock -u${DBUSER} -p${DBPASS} ${DBNAME} -e "SELECT version FROM versions WHERE application = 'db_schema';" -BN)
|
|
||||||
DBV_WAIT=0
|
|
||||||
while [[ "${DBV_NOW}" != "${DB_VERSION}" ]] && [[ ${DBV_WAIT} -lt 60 ]]; do
|
|
||||||
echo "Waiting for schema update..."
|
|
||||||
sleep 5
|
|
||||||
DBV_WAIT=$((DBV_WAIT + 1))
|
|
||||||
DBV_NOW=$(mariadb --skip-ssl --socket=/var/run/mysqld/mysqld.sock -u${DBUSER} -p${DBPASS} ${DBNAME} -e "SELECT version FROM versions WHERE application = 'db_schema';" -BN)
|
|
||||||
done
|
|
||||||
if [[ "${DBV_NOW}" != "${DB_VERSION}" ]]; then
|
|
||||||
echo -e "\e[31m$(date) - DB schema is ${DBV_NOW}, expected ${DB_VERSION} - starting checks anyway, check the php-fpm log (init_db)\e[0m"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Do not attempt to write to slave
|
# Do not attempt to write to slave
|
||||||
if [[ ! -z ${REDIS_SLAVEOF_IP} ]]; then
|
if [[ ! -z ${REDIS_SLAVEOF_IP} ]]; then
|
||||||
REDIS_CMDLINE="redis-cli -h ${REDIS_SLAVEOF_IP} -p ${REDIS_SLAVEOF_PORT} -a ${REDISPASS} --no-auth-warning"
|
REDIS_CMDLINE="redis-cli -h ${REDIS_SLAVEOF_IP} -p ${REDIS_SLAVEOF_PORT} -a ${REDISPASS} --no-auth-warning"
|
||||||
|
|||||||
@@ -68,17 +68,13 @@ require_once 'functions.acl.inc.php';
|
|||||||
|
|
||||||
|
|
||||||
$isSOGoRequest = $post['real_rip'] == getenv('IPV4_NETWORK') . '.248';
|
$isSOGoRequest = $post['real_rip'] == getenv('IPV4_NETWORK') . '.248';
|
||||||
// real_rip is the address that connected to Dovecot (for proxied connections the proxy), client_ip the client (for logs)
|
|
||||||
$client_ip = filter_var($post['client_ip'] ?? '', FILTER_VALIDATE_IP) ? $post['client_ip'] : $post['real_rip'];
|
|
||||||
$result = false;
|
$result = false;
|
||||||
// set when the password is right, but the account does not allow this login
|
|
||||||
$denied = false;
|
|
||||||
if ($isSOGoRequest) {
|
if ($isSOGoRequest) {
|
||||||
// This is a SOGo Auth request. First check for SSO password.
|
// This is a SOGo Auth request. First check for SSO password.
|
||||||
$sogo_sso_pass = file_get_contents("/etc/sogo-sso/sogo-sso.pass");
|
$sogo_sso_pass = file_get_contents("/etc/sogo-sso/sogo-sso.pass");
|
||||||
if ($sogo_sso_pass === $post['password']){
|
if ($sogo_sso_pass === $post['password']){
|
||||||
error_log('MAILCOWAUTH: SOGo SSO auth for user ' . $post['username']);
|
error_log('MAILCOWAUTH: SOGo SSO auth for user ' . $post['username']);
|
||||||
set_sasl_log($post['username'], $client_ip, "SOGO");
|
set_sasl_log($post['username'], $post['real_rip'], "SOGO");
|
||||||
$result = true;
|
$result = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -95,10 +91,10 @@ if ($result === false){
|
|||||||
'service' => $post['service'],
|
'service' => $post['service'],
|
||||||
'is_internal' => true,
|
'is_internal' => true,
|
||||||
'remote_addr' => $post['real_rip']
|
'remote_addr' => $post['real_rip']
|
||||||
), $denied);
|
));
|
||||||
if ($result) {
|
if ($result) {
|
||||||
error_log('MAILCOWAUTH: App auth for user ' . $post['username'] . " with service " . $service . " from IP " . $client_ip);
|
error_log('MAILCOWAUTH: App auth for user ' . $post['username'] . " with service " . $service . " from IP " . $post['real_rip']);
|
||||||
set_sasl_log($post['username'], $client_ip, $service);
|
set_sasl_log($post['username'], $post['real_rip'], $service);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($result === false){
|
if ($result === false){
|
||||||
@@ -106,37 +102,26 @@ if ($result === false){
|
|||||||
$iam_provider = identity_provider('init');
|
$iam_provider = identity_provider('init');
|
||||||
$iam_settings = identity_provider('get');
|
$iam_settings = identity_provider('get');
|
||||||
try {
|
try {
|
||||||
$result = user_login($post['username'], $post['password'], array('is_internal' => true, 'service' => $post['service']), $denied);
|
$result = user_login($post['username'], $post['password'], array('is_internal' => true, 'service' => $post['service']));
|
||||||
} catch (\Mailcow\Auth\IdpUnavailable $e) {
|
} catch (\Mailcow\Auth\IdpUnavailable $e) {
|
||||||
// temporary failure for Dovecot, no failed login
|
// temporary failure for Dovecot, no failed login
|
||||||
error_log("MAILCOWAUTH: Identity provider unavailable for user " . $post['username'] . " with service " . $post['service'] . " from IP " . $client_ip . ": " . $e->getMessage());
|
error_log("MAILCOWAUTH: Identity provider unavailable for user " . $post['username'] . " with service " . $post['service'] . " from IP " . $post['real_rip'] . ": " . $e->getMessage());
|
||||||
http_response_code(503); // Service Unavailable
|
http_response_code(503); // Service Unavailable
|
||||||
echo json_encode($return);
|
echo json_encode($return);
|
||||||
session_destroy();
|
session_destroy();
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
if ($result) {
|
if ($result) {
|
||||||
error_log('MAILCOWAUTH: User auth for user ' . $post['username'] . " with service " . $service . " from IP " . $client_ip);
|
error_log('MAILCOWAUTH: User auth for user ' . $post['username'] . " with service " . $post['service'] . " from IP " . $post['real_rip']);
|
||||||
set_sasl_log($post['username'], $client_ip, $service);
|
set_sasl_log($post['username'], $post['real_rip'], $post['service']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
http_response_code(200); // OK
|
http_response_code(200); // OK
|
||||||
$return['success'] = true;
|
$return['success'] = true;
|
||||||
} elseif ($denied) {
|
|
||||||
// Logged, but no failed login for netfilter: e.g. a client of a shared mailbox or without IMAP access
|
|
||||||
error_log("MAILCOWAUTH: Login denied for user " . $post['username'] . " with service " . $service . " from IP " . $client_ip);
|
|
||||||
http_response_code(401); // Unauthorized
|
|
||||||
} else {
|
} else {
|
||||||
// Same line for the log and netfilter, which counts it for IMAP, POP3, Sieve and SMTP (Postfix asks Dovecot);
|
error_log("MAILCOWAUTH: Login failed for user " . $post['username'] . " with service " . $post['service'] . " from IP " . $post['real_rip']);
|
||||||
// SOGo logins have their own rule
|
|
||||||
$failed = "MAILCOWAUTH: Login failed for user " . $post['username'] . " with service " .
|
|
||||||
preg_replace('/[^a-z0-9]/', '', strtolower((string)$service)) . " from IP " . $client_ip;
|
|
||||||
error_log($failed);
|
|
||||||
if (!$isSOGoRequest) {
|
|
||||||
$redis->publish("F2B_CHANNEL", $failed);
|
|
||||||
}
|
|
||||||
http_response_code(401); // Unauthorized
|
http_response_code(401); // Unauthorized
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
function auth_password_verify(request, password)
|
function auth_password_verify(request, password)
|
||||||
|
if request.domain == nil then
|
||||||
|
return dovecot.auth.PASSDB_RESULT_USER_UNKNOWN, "No such user"
|
||||||
|
end
|
||||||
|
|
||||||
local json = require "cjson"
|
local json = require "cjson"
|
||||||
local ltn12 = require "ltn12"
|
local ltn12 = require "ltn12"
|
||||||
local https = require "ssl.https"
|
local https = require "ssl.https"
|
||||||
@@ -7,10 +11,7 @@ function auth_password_verify(request, password)
|
|||||||
local req = {
|
local req = {
|
||||||
username = request.user,
|
username = request.user,
|
||||||
password = password,
|
password = password,
|
||||||
-- address that connected to Dovecot, for proxied connections the proxy
|
|
||||||
real_rip = request.real_rip,
|
real_rip = request.real_rip,
|
||||||
-- address of the client, also for proxied connections
|
|
||||||
client_ip = request.rip,
|
|
||||||
service = request.service
|
service = request.service
|
||||||
}
|
}
|
||||||
local req_json = json.encode(req)
|
local req_json = json.encode(req)
|
||||||
|
|||||||
@@ -51,6 +51,13 @@ recipient_delimiter = +
|
|||||||
auth_master_user_separator = *
|
auth_master_user_separator = *
|
||||||
mail_shared_explicit_inbox = yes
|
mail_shared_explicit_inbox = yes
|
||||||
mail_prefetch_count = 30
|
mail_prefetch_count = 30
|
||||||
|
passdb {
|
||||||
|
driver = lua
|
||||||
|
args = file=/etc/dovecot/auth/passwd-verify.lua blocking=yes cache_key=%s:%u:%w
|
||||||
|
result_success = return-ok
|
||||||
|
result_failure = continue
|
||||||
|
result_internalfail = continue
|
||||||
|
}
|
||||||
# try a master passwd
|
# try a master passwd
|
||||||
passdb {
|
passdb {
|
||||||
driver = passwd-file
|
driver = passwd-file
|
||||||
@@ -60,9 +67,8 @@ passdb {
|
|||||||
}
|
}
|
||||||
# check for regular password - if empty (e.g. force-passwd-reset), previous pass=yes passdbs also fail
|
# check for regular password - if empty (e.g. force-passwd-reset), previous pass=yes passdbs also fail
|
||||||
# a return of the following passdb is mandatory
|
# a return of the following passdb is mandatory
|
||||||
# each check asks mailcowauth.php, which reports a failed login to netfilter once
|
|
||||||
# cache_key with password: the lua default (%u) would let a temporary failure fall back to the negative entry
|
# cache_key with password: the lua default (%u) would let a temporary failure fall back to the negative entry
|
||||||
# of a passdb lookup (master logins) and reject the login as unknown user
|
# of a passdb lookup (master logins) and log "unknown user", which netfilter counts as failed login
|
||||||
passdb {
|
passdb {
|
||||||
driver = lua
|
driver = lua
|
||||||
args = file=/etc/dovecot/auth/passwd-verify.lua blocking=yes cache_key=%s:%u:%w
|
args = file=/etc/dovecot/auth/passwd-verify.lua blocking=yes cache_key=%s:%u:%w
|
||||||
@@ -199,9 +205,6 @@ plugin {
|
|||||||
sieve_plugins = sieve_imapsieve sieve_extprograms
|
sieve_plugins = sieve_imapsieve sieve_extprograms
|
||||||
sieve_vacation_send_from_recipient = yes
|
sieve_vacation_send_from_recipient = yes
|
||||||
sieve_redirect_envelope_from = recipient
|
sieve_redirect_envelope_from = recipient
|
||||||
# Notifications are sent with the address of the mailbox (not :from or postmaster), so mail policies apply;
|
|
||||||
# the old notify extension always sends as postmaster and is on by default, so sieve_extensions disables it
|
|
||||||
sieve_notify_mailto_envelope_from = recipient
|
|
||||||
# From elsewhere to Spam folder
|
# From elsewhere to Spam folder
|
||||||
imapsieve_mailbox1_name = Junk
|
imapsieve_mailbox1_name = Junk
|
||||||
imapsieve_mailbox1_causes = COPY
|
imapsieve_mailbox1_causes = COPY
|
||||||
@@ -218,7 +221,7 @@ plugin {
|
|||||||
quota_warning2 = storage=80%% quota-warning 80 %u
|
quota_warning2 = storage=80%% quota-warning 80 %u
|
||||||
sieve_pipe_bin_dir = /usr/lib/dovecot/sieve
|
sieve_pipe_bin_dir = /usr/lib/dovecot/sieve
|
||||||
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.execute
|
sieve_global_extensions = +vnd.dovecot.pipe +vnd.dovecot.execute
|
||||||
sieve_extensions = -notify +imapflags +vacation-seconds +editheader
|
sieve_extensions = +notify +imapflags +vacation-seconds +editheader
|
||||||
sieve_max_script_size = 1M
|
sieve_max_script_size = 1M
|
||||||
sieve_max_redirects = 100
|
sieve_max_redirects = 100
|
||||||
sieve_max_actions = 101
|
sieve_max_actions = 101
|
||||||
|
|||||||
@@ -47,13 +47,6 @@ http {
|
|||||||
default "";
|
default "";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Client address for PHP: on the internal sogo-auth listener nginx itself is the client,
|
|
||||||
# the real address comes from the X-Real-IP header set by /sogo-auth-verify
|
|
||||||
map $sogo_auth_internal $mailcow_client_ip {
|
|
||||||
"1" $http_x_real_ip;
|
|
||||||
default $remote_addr;
|
|
||||||
}
|
|
||||||
|
|
||||||
{% if HTTP_REDIRECT %}
|
{% if HTTP_REDIRECT %}
|
||||||
# HTTP to HTTPS redirect
|
# HTTP to HTTPS redirect
|
||||||
server {
|
server {
|
||||||
@@ -150,15 +143,6 @@ http {
|
|||||||
access_log /var/log/nginx/access.log;
|
access_log /var/log/nginx/access.log;
|
||||||
root /dynmaps;
|
root /dynmaps;
|
||||||
|
|
||||||
# backup endpoint of the restic runner: large restore requests, long merges of mailboxes and domains
|
|
||||||
location = /backup.php {
|
|
||||||
client_max_body_size 32m;
|
|
||||||
fastcgi_read_timeout 600s;
|
|
||||||
fastcgi_pass {{ PHPFPMHOST }}:9001;
|
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
@@ -168,13 +152,6 @@ http {
|
|||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
location = /retention.php {
|
|
||||||
client_max_body_size 32m;
|
|
||||||
fastcgi_pass {{ PHPFPMHOST }}:9001;
|
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# rspamd meta_exporter:
|
# rspamd meta_exporter:
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ add_header Referrer-Policy strict-origin;
|
|||||||
|
|
||||||
index index.php index.html;
|
index index.php index.html;
|
||||||
|
|
||||||
# PHP accepts no larger requests (post_max_size), SOGo webmail, CalDAV/CardDAV and ActiveSync use NGINX_MAX_BODY_SIZE
|
client_max_body_size 0;
|
||||||
client_max_body_size 64m;
|
|
||||||
|
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_disable "msie6";
|
gzip_disable "msie6";
|
||||||
@@ -94,11 +93,11 @@ location / {
|
|||||||
}
|
}
|
||||||
|
|
||||||
location /qhandler {
|
location /qhandler {
|
||||||
rewrite ^/qhandler/([^/]+)/(.+?)/?$ /qhandler.php?action=$1&hash=$2;
|
rewrite ^/qhandler/(.*)/(.*) /qhandler.php?action=$1&hash=$2;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /edit {
|
location /edit {
|
||||||
rewrite ^/edit/([^/]+)/(.+?)/?$ /edit.php?$1=$2;
|
rewrite ^/edit/(.*)/(.*) /edit.php?$1=$2;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/api/v1/(.*)$ {
|
location ~ ^/api/v1/(.*)$ {
|
||||||
@@ -117,8 +116,7 @@ location ~ \.php$ {
|
|||||||
include /etc/nginx/fastcgi_params;
|
include /etc/nginx/fastcgi_params;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||||
fastcgi_param REMOTE_ADDR $mailcow_client_ip;
|
fastcgi_param HTTP_X_REAL_IP $remote_addr;
|
||||||
fastcgi_param HTTP_X_REAL_IP $mailcow_client_ip;
|
|
||||||
# trusted internal-auth marker; empty for external clients (see nginx.conf map)
|
# trusted internal-auth marker; empty for external clients (see nginx.conf map)
|
||||||
fastcgi_param SOGO_AUTH_INTERNAL $sogo_auth_internal;
|
fastcgi_param SOGO_AUTH_INTERNAL $sogo_auth_internal;
|
||||||
fastcgi_read_timeout 3600;
|
fastcgi_read_timeout 3600;
|
||||||
@@ -183,16 +181,9 @@ location /sogo-auth-verify {
|
|||||||
proxy_set_header Content-Length "";
|
proxy_set_header Content-Length "";
|
||||||
proxy_pass http://127.0.0.1:65510/sogo-auth;
|
proxy_pass http://127.0.0.1:65510/sogo-auth;
|
||||||
proxy_pass_request_body off;
|
proxy_pass_request_body off;
|
||||||
client_max_body_size {{ NGINX_MAX_BODY_SIZE }};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
location ^~ /Microsoft-Server-ActiveSync {
|
location ^~ /Microsoft-Server-ActiveSync {
|
||||||
# Outlook for iOS/Android (Microsoft's sync service) sends EAS commands without credentials
|
|
||||||
# and only authenticates after a 401 Basic challenge. SOGo answers those with 403, so challenge here.
|
|
||||||
if ($http_authorization = "") {
|
|
||||||
add_header WWW-Authenticate 'Basic realm="SOGo"' always;
|
|
||||||
return 401;
|
|
||||||
}
|
|
||||||
auth_request /sogo-auth-verify;
|
auth_request /sogo-auth-verify;
|
||||||
auth_request_set $user $upstream_http_x_user;
|
auth_request_set $user $upstream_http_x_user;
|
||||||
auth_request_set $auth $upstream_http_x_auth;
|
auth_request_set $auth $upstream_http_x_auth;
|
||||||
@@ -213,7 +204,7 @@ location ^~ /Microsoft-Server-ActiveSync {
|
|||||||
proxy_busy_buffers_size 512k;
|
proxy_busy_buffers_size 512k;
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
client_body_buffer_size 512k;
|
client_body_buffer_size 512k;
|
||||||
client_max_body_size {{ NGINX_MAX_BODY_SIZE }};
|
client_max_body_size 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ^~ /SOGo {
|
location ^~ /SOGo {
|
||||||
@@ -264,7 +255,7 @@ location ^~ /SOGo {
|
|||||||
proxy_send_timeout 3600;
|
proxy_send_timeout 3600;
|
||||||
proxy_read_timeout 3600;
|
proxy_read_timeout 3600;
|
||||||
client_body_buffer_size 128k;
|
client_body_buffer_size 128k;
|
||||||
client_max_body_size {{ NGINX_MAX_BODY_SIZE }};
|
client_max_body_size 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ $_SESSION['acl']['sogo_access'] = "1";
|
|||||||
$_SESSION['acl']['protocol_access'] = "1";
|
$_SESSION['acl']['protocol_access'] = "1";
|
||||||
$_SESSION['acl']['mailbox_relayhost'] = "1";
|
$_SESSION['acl']['mailbox_relayhost'] = "1";
|
||||||
$_SESSION['acl']['unlimited_quota'] = "1";
|
$_SESSION['acl']['unlimited_quota'] = "1";
|
||||||
$_SESSION['acl']['archive'] = "1";
|
|
||||||
|
|
||||||
// One run at a time, released when the process ends
|
// One run at a time, released when the process ends
|
||||||
$lock = fopen('/tmp/identity-sync.lock', 'c');
|
$lock = fopen('/tmp/identity-sync.lock', 'c');
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
/watchdog@localhost$/ watchdog_discard:
|
/watchdog@localhost$/ watchdog_discard:
|
||||||
/^archive-bounce@localhost$/ archive_discard:
|
|
||||||
/localhost$/ local:
|
/localhost$/ local:
|
||||||
@@ -50,10 +50,6 @@ postscreen_greet_wait = 3s
|
|||||||
postscreen_non_smtp_command_enable = no
|
postscreen_non_smtp_command_enable = no
|
||||||
postscreen_pipelining_enable = no
|
postscreen_pipelining_enable = no
|
||||||
proxy_read_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_sasl_passwd_maps_transport_maps.cf,
|
proxy_read_maps = proxy:mysql:/opt/postfix/conf/sql/mysql_sasl_passwd_maps_transport_maps.cf,
|
||||||
proxy:mysql:/opt/postfix/conf/sql/mysql_archive_sender_filter_maps.cf,
|
|
||||||
proxy:mysql:/opt/postfix/conf/sql/mysql_archive_sasl_passwd_maps.cf,
|
|
||||||
proxy:mysql:/opt/postfix/conf/sql/mysql_archive_tls_policy_maps.cf,
|
|
||||||
proxy:mysql:/opt/postfix/conf/sql/mysql_mail_policy_maps.cf,
|
|
||||||
proxy:mysql:/opt/postfix/conf/sql/mysql_mbr_access_maps.cf,
|
proxy:mysql:/opt/postfix/conf/sql/mysql_mbr_access_maps.cf,
|
||||||
proxy:mysql:/opt/postfix/conf/sql/mysql_tls_enforce_in_policy.cf,
|
proxy:mysql:/opt/postfix/conf/sql/mysql_tls_enforce_in_policy.cf,
|
||||||
$sender_dependent_default_transport_maps,
|
$sender_dependent_default_transport_maps,
|
||||||
@@ -94,7 +90,6 @@ smtpd_hard_error_limit = ${stress?1}${stress:5}
|
|||||||
smtpd_helo_required = yes
|
smtpd_helo_required = yes
|
||||||
smtpd_proxy_timeout = 600s
|
smtpd_proxy_timeout = 600s
|
||||||
smtpd_recipient_restrictions = check_recipient_mx_access proxy:mysql:/opt/postfix/conf/sql/mysql_mbr_access_maps.cf,
|
smtpd_recipient_restrictions = check_recipient_mx_access proxy:mysql:/opt/postfix/conf/sql/mysql_mbr_access_maps.cf,
|
||||||
check_recipient_access proxy:mysql:/opt/postfix/conf/sql/mysql_mail_policy_maps.cf,
|
|
||||||
permit_sasl_authenticated,
|
permit_sasl_authenticated,
|
||||||
permit_mynetworks,
|
permit_mynetworks,
|
||||||
check_recipient_access proxy:mysql:/opt/postfix/conf/sql/mysql_tls_enforce_in_policy.cf,
|
check_recipient_access proxy:mysql:/opt/postfix/conf/sql/mysql_tls_enforce_in_policy.cf,
|
||||||
@@ -175,11 +170,5 @@ parent_domain_matches_subdomains = debug_peer_list,fast_flush_domains,mynetworks
|
|||||||
# This Option is added to correctly set the X-Original-To Header when mails are send to lmtp (dovecot)
|
# This Option is added to correctly set the X-Original-To Header when mails are send to lmtp (dovecot)
|
||||||
lmtp_destination_recipient_limit=1
|
lmtp_destination_recipient_limit=1
|
||||||
|
|
||||||
# Mail policies: while policies or internal aliases exist, mysql_mail_policy_maps.cf returns this class and smtpd
|
|
||||||
# asks the policy service for every recipient (mailcow-policy in master.cf); no answer defers the recipient
|
|
||||||
smtpd_restriction_classes = mailcow_mail_policy
|
|
||||||
mailcow_mail_policy = check_policy_service { unix:private/mailcow-policy, timeout=10s, try_limit=1, default_action=DEFER_IF_PERMIT }
|
|
||||||
mailcow-policy_time_limit = 3600s
|
|
||||||
|
|
||||||
# DO NOT EDIT ANYTHING BELOW #
|
# DO NOT EDIT ANYTHING BELOW #
|
||||||
# Overrides #
|
# Overrides #
|
||||||
@@ -61,15 +61,13 @@ submission inet n - n - - smtpd
|
|||||||
-o non_smtpd_milters=
|
-o non_smtpd_milters=
|
||||||
-o syslog_name=postfix/quarantine
|
-o syslog_name=postfix/quarantine
|
||||||
|
|
||||||
# used to send bcc mails and archive copies (sender archive-bounce@localhost goes to the archive)
|
# used to send bcc mails
|
||||||
# the archive FILTER comes after the one of MX-based transports, Postfix uses the last FILTER
|
|
||||||
591 inet n - n - - smtpd
|
591 inet n - n - - smtpd
|
||||||
-o smtpd_helo_restrictions=
|
-o smtpd_helo_restrictions=
|
||||||
-o smtpd_client_restrictions=permit_mynetworks,reject
|
-o smtpd_client_restrictions=permit_mynetworks,reject
|
||||||
-o smtpd_tls_auth_only=no
|
-o smtpd_tls_auth_only=no
|
||||||
-o smtpd_milters=
|
-o smtpd_milters=
|
||||||
-o non_smtpd_milters=
|
-o non_smtpd_milters=
|
||||||
-o smtpd_recipient_restrictions=check_recipient_mx_access,proxy:mysql:/opt/postfix/conf/sql/mysql_mbr_access_maps.cf,check_sender_access,proxy:mysql:/opt/postfix/conf/sql/mysql_archive_sender_filter_maps.cf,permit_mynetworks,reject
|
|
||||||
-o syslog_name=postfix/bcc
|
-o syslog_name=postfix/bcc
|
||||||
|
|
||||||
# enforced smtp connector
|
# enforced smtp connector
|
||||||
@@ -83,27 +81,6 @@ smtp_enforced_tls unix - - n - - smtp
|
|||||||
smtp_via_transport_maps unix - - n - - smtp
|
smtp_via_transport_maps unix - - n - - smtp
|
||||||
-o smtp_sasl_password_maps=proxy:mysql:/opt/postfix/conf/sql/mysql_sasl_passwd_maps_transport_maps.cf
|
-o smtp_sasl_password_maps=proxy:mysql:/opt/postfix/conf/sql/mysql_sasl_passwd_maps_transport_maps.cf
|
||||||
|
|
||||||
# archive copies (journal) to the archive set in the admin UI: only mails from archive-bounce@localhost on 591 get here
|
|
||||||
# (FILTER of mysql_archive_sender_filter_maps), sent unchanged, TLS by default, refusals are retried (soft_bounce)
|
|
||||||
# until maximal_queue_lifetime
|
|
||||||
archive_smtp unix - - n - - smtp
|
|
||||||
-o soft_bounce=yes
|
|
||||||
-o smtp_header_checks=
|
|
||||||
-o smtp_mime_header_checks=
|
|
||||||
-o smtp_nested_header_checks=
|
|
||||||
-o smtp_body_checks=
|
|
||||||
-o smtp_line_length_limit=0
|
|
||||||
-o disable_mime_output_conversion=yes
|
|
||||||
-o smtp_tls_security_level=encrypt
|
|
||||||
-o smtp_tls_policy_maps=proxy:mysql:/opt/postfix/conf/sql/mysql_archive_tls_policy_maps.cf
|
|
||||||
-o smtp_sasl_auth_enable=yes
|
|
||||||
-o smtp_sasl_password_maps=proxy:mysql:/opt/postfix/conf/sql/mysql_archive_sasl_passwd_maps.cf
|
|
||||||
-o smtp_sasl_tls_security_options=noanonymous
|
|
||||||
-o syslog_name=postfix/archive
|
|
||||||
# notices about archive copies (delays, bounces) go to archive-bounce@localhost and are dropped here
|
|
||||||
archive_discard unix - - n - - discard
|
|
||||||
-o syslog_name=postfix/archive
|
|
||||||
|
|
||||||
tlsproxy unix - - n - 0 tlsproxy
|
tlsproxy unix - - n - 0 tlsproxy
|
||||||
dnsblog unix - - n - 0 dnsblog
|
dnsblog unix - - n - 0 dnsblog
|
||||||
pickup fifo n - n 60 1 pickup
|
pickup fifo n - n 60 1 pickup
|
||||||
@@ -140,14 +117,10 @@ smtp_sender_cleanup unix n - y - 0 cleanup
|
|||||||
127.0.0.1:10027 inet n n n - 0 spawn user=nobody argv=/usr/local/bin/whitelist_forwardinghosts.sh
|
127.0.0.1:10027 inet n n n - 0 spawn user=nobody argv=/usr/local/bin/whitelist_forwardinghosts.sh
|
||||||
# end whitelist_fwd
|
# end whitelist_fwd
|
||||||
|
|
||||||
# mail policies: policy service of smtpd, asks the mailcow UI (mailcow_mail_policy in main.cf)
|
|
||||||
mailcow-policy unix - n n - 0 spawn user=nobody argv=/usr/local/bin/mailcow-policy.py
|
|
||||||
|
|
||||||
# start watchdog-specific
|
# start watchdog-specific
|
||||||
# logs to local7 (hidden), no mail policy check
|
# logs to local7 (hidden)
|
||||||
589 inet n - n - - smtpd
|
589 inet n - n - - smtpd
|
||||||
-o smtpd_client_restrictions=permit_mynetworks,reject
|
-o smtpd_client_restrictions=permit_mynetworks,reject
|
||||||
-o smtpd_recipient_restrictions=permit_mynetworks,reject
|
|
||||||
-o syslog_name=watchdog
|
-o syslog_name=watchdog
|
||||||
-o syslog_facility=local7
|
-o syslog_facility=local7
|
||||||
-o smtpd_milters=
|
-o smtpd_milters=
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Whitelist generated by Postwhite v3.4 on Sun Nov 1 00:23:09 UTC 2026
|
# Whitelist generated by Postwhite v3.4 on Thu Oct 1 00:35:20 UTC 2026
|
||||||
# https://github.com/stevejenkins/postwhite/
|
# https://github.com/stevejenkins/postwhite/
|
||||||
# 2237 total rules
|
# 2246 total rules
|
||||||
2a00:1450:4000::/36 permit
|
2a00:1450:4000::/36 permit
|
||||||
2a00:1450:4864::/56 permit
|
2a00:1450:4864::/56 permit
|
||||||
2a01:111:f400::/48 permit
|
2a01:111:f400::/48 permit
|
||||||
@@ -197,9 +197,6 @@
|
|||||||
44.246.68.102 permit
|
44.246.68.102 permit
|
||||||
44.246.77.92 permit
|
44.246.77.92 permit
|
||||||
45.14.148.0/22 permit
|
45.14.148.0/22 permit
|
||||||
45.128.172.192/27 permit
|
|
||||||
45.128.172.224/28 permit
|
|
||||||
45.128.174.0/25 permit
|
|
||||||
45.143.132.0/24 permit
|
45.143.132.0/24 permit
|
||||||
45.143.133.0/24 permit
|
45.143.133.0/24 permit
|
||||||
45.143.134.0/24 permit
|
45.143.134.0/24 permit
|
||||||
@@ -675,6 +672,7 @@
|
|||||||
85.215.255.47 permit
|
85.215.255.47 permit
|
||||||
85.215.255.48 permit
|
85.215.255.48 permit
|
||||||
85.215.255.49 permit
|
85.215.255.49 permit
|
||||||
|
86.61.88.25 permit
|
||||||
87.238.80.0/21 permit
|
87.238.80.0/21 permit
|
||||||
87.248.103.12 permit
|
87.248.103.12 permit
|
||||||
87.248.103.21 permit
|
87.248.103.21 permit
|
||||||
@@ -1347,11 +1345,11 @@
|
|||||||
107.20.210.250 permit
|
107.20.210.250 permit
|
||||||
107.22.191.150 permit
|
107.22.191.150 permit
|
||||||
108.174.0.0/24 permit
|
108.174.0.0/24 permit
|
||||||
108.174.0.93 permit
|
108.174.0.215 permit
|
||||||
108.174.3.0/24 permit
|
108.174.3.0/24 permit
|
||||||
108.174.3.93 permit
|
108.174.3.215 permit
|
||||||
108.174.6.0/24 permit
|
108.174.6.0/24 permit
|
||||||
108.174.6.93 permit
|
108.174.6.215 permit
|
||||||
108.175.18.45 permit
|
108.175.18.45 permit
|
||||||
108.175.30.45 permit
|
108.175.30.45 permit
|
||||||
108.179.144.0/20 permit
|
108.179.144.0/20 permit
|
||||||
@@ -1534,6 +1532,11 @@
|
|||||||
147.154.63.0/24 permit
|
147.154.63.0/24 permit
|
||||||
147.154.126.0/24 permit
|
147.154.126.0/24 permit
|
||||||
147.154.191.0/24 permit
|
147.154.191.0/24 permit
|
||||||
|
147.243.1.47 permit
|
||||||
|
147.243.1.48 permit
|
||||||
|
147.243.1.153 permit
|
||||||
|
147.243.128.24 permit
|
||||||
|
147.243.128.26 permit
|
||||||
148.105.0.0/16 permit
|
148.105.0.0/16 permit
|
||||||
148.105.8.0/21 permit
|
148.105.8.0/21 permit
|
||||||
148.116.32.128/25 permit
|
148.116.32.128/25 permit
|
||||||
@@ -1543,7 +1546,7 @@
|
|||||||
149.97.173.180 permit
|
149.97.173.180 permit
|
||||||
149.118.160.128/25 permit
|
149.118.160.128/25 permit
|
||||||
150.136.21.199 permit
|
150.136.21.199 permit
|
||||||
150.171.109.66 permit
|
150.171.109.178 permit
|
||||||
150.230.98.160 permit
|
150.230.98.160 permit
|
||||||
151.145.38.14 permit
|
151.145.38.14 permit
|
||||||
152.67.105.195 permit
|
152.67.105.195 permit
|
||||||
@@ -1559,6 +1562,7 @@
|
|||||||
155.248.237.141 permit
|
155.248.237.141 permit
|
||||||
157.56.120.128/26 permit
|
157.56.120.128/26 permit
|
||||||
157.58.30.128/25 permit
|
157.58.30.128/25 permit
|
||||||
|
157.58.196.96/29 permit
|
||||||
157.58.249.3 permit
|
157.58.249.3 permit
|
||||||
157.137.32.128/25 permit
|
157.137.32.128/25 permit
|
||||||
157.137.96.128/25 permit
|
157.137.96.128/25 permit
|
||||||
@@ -1647,6 +1651,7 @@
|
|||||||
167.89.75.126 permit
|
167.89.75.126 permit
|
||||||
167.89.75.136 permit
|
167.89.75.136 permit
|
||||||
167.89.75.164 permit
|
167.89.75.164 permit
|
||||||
|
167.220.67.232/29 permit
|
||||||
168.107.248.128/25 permit
|
168.107.248.128/25 permit
|
||||||
168.110.160.128/25 permit
|
168.110.160.128/25 permit
|
||||||
168.110.248.128/25 permit
|
168.110.248.128/25 permit
|
||||||
@@ -1974,6 +1979,8 @@
|
|||||||
207.46.22.35 permit
|
207.46.22.35 permit
|
||||||
207.46.50.72 permit
|
207.46.50.72 permit
|
||||||
207.46.50.82 permit
|
207.46.50.82 permit
|
||||||
|
207.46.52.71 permit
|
||||||
|
207.46.52.79 permit
|
||||||
207.67.38.0/24 permit
|
207.67.38.0/24 permit
|
||||||
207.67.98.192/27 permit
|
207.67.98.192/27 permit
|
||||||
207.97.204.96/29 permit
|
207.97.204.96/29 permit
|
||||||
@@ -2131,6 +2138,8 @@
|
|||||||
212.227.126.227 permit
|
212.227.126.227 permit
|
||||||
213.199.128.139 permit
|
213.199.128.139 permit
|
||||||
213.199.128.145 permit
|
213.199.128.145 permit
|
||||||
|
213.199.138.181 permit
|
||||||
|
213.199.138.191 permit
|
||||||
216.17.150.242 permit
|
216.17.150.242 permit
|
||||||
216.17.150.251 permit
|
216.17.150.251 permit
|
||||||
216.24.224.0/20 permit
|
216.24.224.0/20 permit
|
||||||
@@ -2219,23 +2228,23 @@
|
|||||||
2001:748:400:3301::4 permit
|
2001:748:400:3301::4 permit
|
||||||
2404:6800:4000::/36 permit
|
2404:6800:4000::/36 permit
|
||||||
2404:6800:4864::/56 permit
|
2404:6800:4864::/56 permit
|
||||||
2603:1061:14:41::1 permit
|
2603:1061:14:1d0::1 permit
|
||||||
2607:13c0:0001:0000:0000:0000:0000:7000/116 permit
|
2607:13c0:0001:0000:0000:0000:0000:7000/116 permit
|
||||||
2607:13c0:0002:0000:0000:0000:0000:1000/116 permit
|
2607:13c0:0002:0000:0000:0000:0000:1000/116 permit
|
||||||
2607:13c0:0004:0000:0000:0000:0000:0000/116 permit
|
2607:13c0:0004:0000:0000:0000:0000:0000/116 permit
|
||||||
2607:f8b0:4000::/36 permit
|
2607:f8b0:4000::/36 permit
|
||||||
2607:f8b0:4864::/56 permit
|
2607:f8b0:4864::/56 permit
|
||||||
2620:109:c003:104::/64 permit
|
2620:109:c003:104::/64 permit
|
||||||
2620:109:c003:104::5d permit
|
2620:109:c003:104::215 permit
|
||||||
2620:109:c006:104::/64 permit
|
2620:109:c006:104::/64 permit
|
||||||
2620:109:c006:104::5d permit
|
2620:109:c006:104::215 permit
|
||||||
2620:109:c00d:104::/64 permit
|
2620:109:c00d:104::/64 permit
|
||||||
2620:10d:c090:400::8:1 permit
|
2620:10d:c090:400::8:1 permit
|
||||||
2620:10d:c091:400::8:1 permit
|
2620:10d:c091:400::8:1 permit
|
||||||
2620:10d:c09b:400::8:1 permit
|
2620:10d:c09b:400::8:1 permit
|
||||||
2620:10d:c09c:400::8:1 permit
|
2620:10d:c09c:400::8:1 permit
|
||||||
2620:119:50c0:207::/64 permit
|
2620:119:50c0:207::/64 permit
|
||||||
2620:119:50c0:207::5d permit
|
2620:119:50c0:207::215 permit
|
||||||
2800:3f0:4000::/36 permit
|
2800:3f0:4000::/36 permit
|
||||||
2800:3f0:4864::/56 permit
|
2800:3f0:4864::/56 permit
|
||||||
49.12.4.251 permit # checks.mailcow.email
|
49.12.4.251 permit # checks.mailcow.email
|
||||||
|
|||||||
@@ -1,47 +0,0 @@
|
|||||||
<?php
|
|
||||||
// Archive decision for an accepted mail, asked by the MAILCOW_ARCHIVE symbol of rspamd
|
|
||||||
// Request: JSON {from, rcpt[], user, bcc, qid, received, sha256}; answer: JSON {archive, rcpt, sender, headers}
|
|
||||||
header('Content-Type: application/json');
|
|
||||||
require_once "vars.inc.php";
|
|
||||||
require_once __DIR__ . '/../web/inc/lib/vendor/autoload.php';
|
|
||||||
// Do not show errors, we log to using error_log
|
|
||||||
ini_set('error_reporting', 0);
|
|
||||||
// Init database
|
|
||||||
$dsn = $database_type . ":unix_socket=" . $database_sock . ";dbname=" . $database_name;
|
|
||||||
$opt = [
|
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
||||||
PDO::ATTR_EMULATE_PREPARES => false,
|
|
||||||
];
|
|
||||||
try {
|
|
||||||
$pdo = new PDO($dsn, $database_user, $database_pass, $opt);
|
|
||||||
}
|
|
||||||
catch (PDOException $e) {
|
|
||||||
error_log("ARCHIVE: " . $e . PHP_EOL);
|
|
||||||
http_response_code(501);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
// Init Redis, it keeps the global switch; without it nothing is archived
|
|
||||||
$redis = new Redis();
|
|
||||||
try {
|
|
||||||
$redis->connect('redis-mailcow', 6379);
|
|
||||||
$redis->auth(getenv("REDISPASS"));
|
|
||||||
}
|
|
||||||
catch (Exception $e) {
|
|
||||||
$redis = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
$request = json_decode(file_get_contents('php://input'), true);
|
|
||||||
if (!is_array($request)) {
|
|
||||||
http_response_code(400);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
$archive = \Mailcow\Archive\ArchiveModule::create($pdo, \Mailcow\Core\Context::system(), $redis);
|
|
||||||
echo json_encode($archive->journal->prepare($request));
|
|
||||||
}
|
|
||||||
catch (Throwable $e) {
|
|
||||||
error_log("ARCHIVE: " . $e->getMessage() . PHP_EOL);
|
|
||||||
http_response_code(502);
|
|
||||||
}
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
<?php
|
|
||||||
// Backup with restic: endpoint of the runner in the restic container (Mailcow\Backup)
|
|
||||||
// GET ?domains=1: {"domains": [...]}, all domains
|
|
||||||
// GET ?export=<domain>[&after=<username>]: a page of the export of a domain (the first with domain_data and aliases,
|
|
||||||
// every page with a part of the mailboxes and "next_after", the last username to ask for the next page with, null
|
|
||||||
// after the last), incl. password hashes, DKIM keys and secrets; the runner merges the pages into
|
|
||||||
// /mailcow/export/<domain>.json of the snapshot.
|
|
||||||
// POST {"action": "restore_domain", "job": <id>, "data": <domain_data>}: recreates a deleted domain
|
|
||||||
// POST {"action": "restore_aliases", "job": <id>, "aliases": [...]}: a part (at most 500) of the aliases of a domain restore
|
|
||||||
// POST {"action": "restore", "job": <id>, "username": <mailbox>, "data": <its section of the export>}: one mailbox
|
|
||||||
// (created first when it was deleted); all answer {"result": {<component>: {"added", "skipped", "errors"}}}
|
|
||||||
// All need the header X-Backup-Token: HMAC-SHA256 of "backup" with the database password as key
|
|
||||||
header('Content-Type: application/json');
|
|
||||||
require_once "vars.inc.php";
|
|
||||||
require_once __DIR__ . '/../web/inc/lib/vendor/autoload.php';
|
|
||||||
// Do not show errors, we log to using error_log
|
|
||||||
ini_set('error_reporting', 0);
|
|
||||||
if (empty($database_pass) || !hash_equals(hash_hmac('sha256', 'backup', $database_pass), (string)($_SERVER['HTTP_X_BACKUP_TOKEN'] ?? ''))) {
|
|
||||||
http_response_code(403);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
// Init database
|
|
||||||
$dsn = $database_type . ":unix_socket=" . $database_sock . ";dbname=" . $database_name;
|
|
||||||
$opt = [
|
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
||||||
PDO::ATTR_EMULATE_PREPARES => false,
|
|
||||||
];
|
|
||||||
try {
|
|
||||||
$pdo = new PDO($dsn, $database_user, $database_pass, $opt);
|
|
||||||
}
|
|
||||||
catch (PDOException $e) {
|
|
||||||
error_log("BACKUP: " . $e . PHP_EOL);
|
|
||||||
http_response_code(501);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
// DKIM keys, rate limits and the domain map are kept in Redis
|
|
||||||
$redis = new Redis();
|
|
||||||
if (!empty(getenv('REDIS_SLAVEOF_IP'))) {
|
|
||||||
$redis->connect(getenv('REDIS_SLAVEOF_IP'), getenv('REDIS_SLAVEOF_PORT'));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$redis->connect('redis-mailcow', 6379);
|
|
||||||
}
|
|
||||||
$redis->auth(getenv("REDISPASS"));
|
|
||||||
$config = array(
|
|
||||||
'timezone' => getenv('TZ') ?: 'UTC',
|
|
||||||
'alias_disable_external_domains' => ($ALIAS_DISABLE_EXTERNAL_DOMAINS ?? false) === true,
|
|
||||||
);
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
||||||
$body = json_decode((string)file_get_contents('php://input'), true);
|
|
||||||
if (!is_array($body)) {
|
|
||||||
http_response_code(400);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
// The restore has the side effects of the UI: SOGo view and restart, Dovecot auth cache, group shares (legacy code)
|
|
||||||
require_once __DIR__ . '/../web/inc/functions.inc.php';
|
|
||||||
require_once __DIR__ . '/../web/inc/functions.auth.inc.php';
|
|
||||||
require_once __DIR__ . '/../web/inc/functions.docker.inc.php';
|
|
||||||
require_once __DIR__ . '/../web/inc/functions.mailbox.inc.php';
|
|
||||||
require_once __DIR__ . '/../web/inc/functions.ratelimit.inc.php';
|
|
||||||
require_once __DIR__ . '/../web/inc/functions.acl.inc.php';
|
|
||||||
// The legacy mailbox functions run as admin, without a session
|
|
||||||
$_SESSION = array(
|
|
||||||
'mailcow_cc_username' => 'admin',
|
|
||||||
'mailcow_cc_role' => 'admin',
|
|
||||||
'access_all_exception' => '0',
|
|
||||||
'acl' => array_fill_keys(array('tls_policy', 'quarantine_notification', 'quarantine_category', 'ratelimit', 'sogo_access',
|
|
||||||
'protocol_access', 'mailbox_relayhost', 'unlimited_quota'), '1'),
|
|
||||||
);
|
|
||||||
$backup = \Mailcow\Backup\BackupModule::create($pdo, \Mailcow\Core\Context::system(), $config, $redis);
|
|
||||||
echo json_encode($backup->api->post($body), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$backup = \Mailcow\Backup\BackupModule::create($pdo, \Mailcow\Core\Context::system(), $config, $redis);
|
|
||||||
if (isset($_GET['export'])) {
|
|
||||||
echo json_encode($backup->api->export((string)$_GET['export'], (isset($_GET['after']) && is_string($_GET['after'])) ? $_GET['after'] : null),
|
|
||||||
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_THROW_ON_ERROR);
|
|
||||||
}
|
|
||||||
elseif (isset($_GET['domains'])) {
|
|
||||||
echo json_encode($backup->api->domains());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
http_response_code(400);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (\Mailcow\Core\UserError $e) {
|
|
||||||
http_response_code(($e->key === 'domain_not_found') ? 404 : 400);
|
|
||||||
echo json_encode(array('error' => $e->key, 'args' => $e->args));
|
|
||||||
}
|
|
||||||
catch (Throwable $e) {
|
|
||||||
error_log("BACKUP: " . $e->getMessage() . PHP_EOL);
|
|
||||||
http_response_code(500);
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
// Mail policy check for one recipient, asked by the Postfix policy service (mailcow-policy in master.cf)
|
|
||||||
// Request: POST with the attributes of the Postfix policy request; answer: the action (DUNNO or the rejection)
|
|
||||||
header('Content-Type: text/plain');
|
|
||||||
require_once "vars.inc.php";
|
|
||||||
require_once __DIR__ . '/../web/inc/lib/vendor/autoload.php';
|
|
||||||
// Do not show errors, we log to using error_log
|
|
||||||
ini_set('error_reporting', 0);
|
|
||||||
// Init database
|
|
||||||
$dsn = $database_type . ":unix_socket=" . $database_sock . ";dbname=" . $database_name;
|
|
||||||
$opt = [
|
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
||||||
PDO::ATTR_EMULATE_PREPARES => false,
|
|
||||||
];
|
|
||||||
try {
|
|
||||||
$pdo = new PDO($dsn, $database_user, $database_pass, $opt);
|
|
||||||
}
|
|
||||||
catch (PDOException $e) {
|
|
||||||
error_log("MAILPOLICY: " . $e . PHP_EOL);
|
|
||||||
http_response_code(501);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($_POST['request']) || $_POST['request'] !== 'smtpd_access_policy') {
|
|
||||||
http_response_code(400);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
$value = fn(string $key): string => is_string($_POST[$key] ?? null) ? $_POST[$key] : '';
|
|
||||||
|
|
||||||
try {
|
|
||||||
$policy = \Mailcow\MailPolicy\MailPolicyModule::create($pdo, \Mailcow\Core\Context::system());
|
|
||||||
echo $policy->api->check($value('sender'), $value('recipient'), $value('sasl_username'), (int)$value('server_port'), $value('helo_name'));
|
|
||||||
}
|
|
||||||
catch (Throwable $e) {
|
|
||||||
// the policy service answers with a temporary error
|
|
||||||
error_log("MAILPOLICY: " . $e->getMessage() . PHP_EOL);
|
|
||||||
http_response_code(500);
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
<?php
|
|
||||||
// Retention rules for the nightly run in the dovecot container (retention_runner.py)
|
|
||||||
// GET ?after=<username>&limit=<n>: a page of the plan, per mailbox the folders to clean up (JSON)
|
|
||||||
// POST (JSON {"results": [...], "summary": [...], "run": {...}}): the results
|
|
||||||
// Both need the header X-Retention-Token: HMAC-SHA256 of "retention" with the database password as key
|
|
||||||
header('Content-Type: application/json');
|
|
||||||
require_once "vars.inc.php";
|
|
||||||
require_once __DIR__ . '/../web/inc/lib/vendor/autoload.php';
|
|
||||||
// Do not show errors, we log to using error_log
|
|
||||||
ini_set('error_reporting', 0);
|
|
||||||
if (empty($database_pass) || !hash_equals(hash_hmac('sha256', 'retention', $database_pass), (string)($_SERVER['HTTP_X_RETENTION_TOKEN'] ?? ''))) {
|
|
||||||
http_response_code(403);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
// Init database
|
|
||||||
$dsn = $database_type . ":unix_socket=" . $database_sock . ";dbname=" . $database_name;
|
|
||||||
$opt = [
|
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
|
||||||
PDO::ATTR_EMULATE_PREPARES => false,
|
|
||||||
];
|
|
||||||
try {
|
|
||||||
$pdo = new PDO($dsn, $database_user, $database_pass, $opt);
|
|
||||||
}
|
|
||||||
catch (PDOException $e) {
|
|
||||||
error_log("RETENTION: " . $e . PHP_EOL);
|
|
||||||
http_response_code(501);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
$retention = \Mailcow\Retention\RetentionModule::create($pdo, \Mailcow\Core\Context::system());
|
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
|
||||||
$body = json_decode((string)file_get_contents('php://input'), true);
|
|
||||||
if (!is_array($body) || !is_array($body['results'] ?? null)) {
|
|
||||||
http_response_code(400);
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
echo json_encode(['stored' => $retention->api->report($body['results'], is_array($body['summary'] ?? null) ? $body['summary'] : [],
|
|
||||||
is_array($body['run'] ?? null) ? $body['run'] : null)]);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
echo json_encode($retention->api->plan((string)($_GET['after'] ?? ''), (int)($_GET['limit'] ?? 0)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (\Mailcow\Core\UserError $e) {
|
|
||||||
http_response_code(400);
|
|
||||||
}
|
|
||||||
catch (Throwable $e) {
|
|
||||||
error_log("RETENTION: " . $e->getMessage() . PHP_EOL);
|
|
||||||
http_response_code(500);
|
|
||||||
}
|
|
||||||
@@ -469,5 +469,35 @@ while ($row = array_shift($rows)) {
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
// Start internal aliases
|
||||||
|
|
||||||
|
$stmt = $pdo->query("SELECT `id`, `address`, `domain` FROM `alias` WHERE `active` = '1' AND `internal` = '1'");
|
||||||
|
$aliases = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
while ($alias = array_shift($aliases)) {
|
||||||
|
// build allowed_domains regex and add target domain and alias domains
|
||||||
|
$stmt = $pdo->prepare("SELECT `alias_domain` FROM `alias_domain` WHERE `active` = '1' AND `target_domain` = :target_domain");
|
||||||
|
$stmt->execute(array(':target_domain' => $alias['domain']));
|
||||||
|
$allowed_domains = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
$allowed_domains = array_map(function($item) {
|
||||||
|
return str_replace('.', '\.', $item['alias_domain']);
|
||||||
|
}, $allowed_domains);
|
||||||
|
$allowed_domains[] = str_replace('.', '\.', $alias['domain']);
|
||||||
|
$allowed_domains = implode('|', $allowed_domains);
|
||||||
|
?>
|
||||||
|
internal_alias_<?=$alias['id'];?> {
|
||||||
|
priority = 10;
|
||||||
|
rcpt = "<?=$alias['address'];?>";
|
||||||
|
from = "/^((?!.*@(<?=$allowed_domains;?>)).)*$/";
|
||||||
|
apply "default" {
|
||||||
|
MAILCOW_INTERNAL_ALIAS = 9999.0;
|
||||||
|
}
|
||||||
|
symbols [
|
||||||
|
"MAILCOW_INTERNAL_ALIAS"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,7 @@
|
|||||||
|
MX_IMPLICIT {
|
||||||
|
expression = "MX_GOOD & MX_MISSING";
|
||||||
|
score = -0.01;
|
||||||
|
}
|
||||||
VIRUS_FOUND {
|
VIRUS_FOUND {
|
||||||
expression = "CLAM_VIRUS & !MAILCOW_WHITE";
|
expression = "CLAM_VIRUS & !MAILCOW_WHITE";
|
||||||
score = 2000.0;
|
score = 2000.0;
|
||||||
|
|||||||
@@ -23,6 +23,24 @@ symbols {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
group "MX" {
|
||||||
|
"MX_INVALID" {
|
||||||
|
score = 0.5;
|
||||||
|
description = "No connectable MX";
|
||||||
|
one_shot = true;
|
||||||
|
}
|
||||||
|
"MX_MISSING" {
|
||||||
|
score = 2.0;
|
||||||
|
description = "No MX record";
|
||||||
|
one_shot = true;
|
||||||
|
}
|
||||||
|
"MX_GOOD" {
|
||||||
|
score = -0.01;
|
||||||
|
description = "MX was ok";
|
||||||
|
one_shot = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
group "reputation" {
|
group "reputation" {
|
||||||
symbols = {
|
symbols = {
|
||||||
"IP_REPUTATION_HAM" {
|
"IP_REPUTATION_HAM" {
|
||||||
|
|||||||
@@ -5,6 +5,12 @@ RCPT_MAILCOW_DOMAIN {
|
|||||||
symbols_set = ["RCPT_MAILCOW_DOMAIN"];
|
symbols_set = ["RCPT_MAILCOW_DOMAIN"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WHITELISTED_FWD_HOST {
|
||||||
|
type = "ip";
|
||||||
|
map = "redis://WHITELISTED_FWD_HOST";
|
||||||
|
symbols_set = ["WHITELISTED_FWD_HOST"];
|
||||||
|
}
|
||||||
|
|
||||||
BULK_HEADER {
|
BULK_HEADER {
|
||||||
type = "content";
|
type = "content";
|
||||||
map = "${LOCAL_CONFDIR}/custom/bulk_header.map";
|
map = "${LOCAL_CONFDIR}/custom/bulk_header.map";
|
||||||
@@ -145,6 +151,20 @@ BAD_LANG {
|
|||||||
score = 5.0;
|
score = 5.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BAZAAR_ABUSE_CH {
|
||||||
|
type = "selector";
|
||||||
|
selector = "attachments(hex,md5)";
|
||||||
|
map = "https://bazaar.abuse.ch/export/txt/md5/recent/";
|
||||||
|
score = 10.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
URLHAUS_ABUSE_CH {
|
||||||
|
type = "selector";
|
||||||
|
selector = "urls";
|
||||||
|
map = "https://urlhaus.abuse.ch/downloads/text_online/";
|
||||||
|
score = 10.0;
|
||||||
|
}
|
||||||
|
|
||||||
SMTP_LIMITED_ACCESS {
|
SMTP_LIMITED_ACCESS {
|
||||||
type = "user";
|
type = "user";
|
||||||
map = "redis://SMTP_LIMITED_ACCESS";
|
map = "redis://SMTP_LIMITED_ACCESS";
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
timeout = 8.0;
|
timeout = 8.0;
|
||||||
symbol_bad_mx = "MX_INVALID";
|
symbol_bad_mx = "MX_INVALID";
|
||||||
|
symbol_no_mx = "MX_MISSING";
|
||||||
symbol_good_mx = "MX_GOOD";
|
symbol_good_mx = "MX_GOOD";
|
||||||
expire = 86400;
|
expire = 86400;
|
||||||
key_prefix = "rmx";
|
key_prefix = "rmx";
|
||||||
|
|||||||
@@ -9,5 +9,3 @@ disable_monitoring = true;
|
|||||||
# instead of silently accepting the message without further processing.
|
# instead of silently accepting the message without further processing.
|
||||||
soft_reject_on_timeout = true;
|
soft_reject_on_timeout = true;
|
||||||
local_addrs = /etc/rspamd/custom/mailcow_networks.map;
|
local_addrs = /etc/rspamd/custom/mailcow_networks.map;
|
||||||
# Must not be lower than message_size_limit in postfix main.cf
|
|
||||||
max_message = 134217728;
|
|
||||||
@@ -150,41 +150,41 @@ rspamd_config:register_symbol({
|
|||||||
local function ipv6_to_segments(ip_str)
|
local function ipv6_to_segments(ip_str)
|
||||||
-- Remove zone identifier if present (e.g., %eth0)
|
-- Remove zone identifier if present (e.g., %eth0)
|
||||||
ip_str = ip_str:gsub("%%.*$", "")
|
ip_str = ip_str:gsub("%%.*$", "")
|
||||||
|
|
||||||
local segments = {}
|
local segments = {}
|
||||||
|
|
||||||
-- Handle :: compression
|
-- Handle :: compression
|
||||||
if ip_str:find('::') then
|
if ip_str:find('::') then
|
||||||
local before, after = ip_str:match('^(.*)::(.*)$')
|
local before, after = ip_str:match('^(.*)::(.*)$')
|
||||||
before = before or ''
|
before = before or ''
|
||||||
after = after or ''
|
after = after or ''
|
||||||
|
|
||||||
local before_parts = {}
|
local before_parts = {}
|
||||||
local after_parts = {}
|
local after_parts = {}
|
||||||
|
|
||||||
if before ~= '' then
|
if before ~= '' then
|
||||||
for seg in before:gmatch('[^:]+') do
|
for seg in before:gmatch('[^:]+') do
|
||||||
table.insert(before_parts, tonumber(seg, 16) or 0)
|
table.insert(before_parts, tonumber(seg, 16) or 0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if after ~= '' then
|
if after ~= '' then
|
||||||
for seg in after:gmatch('[^:]+') do
|
for seg in after:gmatch('[^:]+') do
|
||||||
table.insert(after_parts, tonumber(seg, 16) or 0)
|
table.insert(after_parts, tonumber(seg, 16) or 0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Add before segments
|
-- Add before segments
|
||||||
for _, seg in ipairs(before_parts) do
|
for _, seg in ipairs(before_parts) do
|
||||||
table.insert(segments, seg)
|
table.insert(segments, seg)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Add compressed zeros
|
-- Add compressed zeros
|
||||||
local zeros_needed = 8 - #before_parts - #after_parts
|
local zeros_needed = 8 - #before_parts - #after_parts
|
||||||
for i = 1, zeros_needed do
|
for i = 1, zeros_needed do
|
||||||
table.insert(segments, 0)
|
table.insert(segments, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Add after segments
|
-- Add after segments
|
||||||
for _, seg in ipairs(after_parts) do
|
for _, seg in ipairs(after_parts) do
|
||||||
table.insert(segments, seg)
|
table.insert(segments, seg)
|
||||||
@@ -195,12 +195,12 @@ rspamd_config:register_symbol({
|
|||||||
table.insert(segments, tonumber(seg, 16) or 0)
|
table.insert(segments, tonumber(seg, 16) or 0)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Ensure we have exactly 8 segments
|
-- Ensure we have exactly 8 segments
|
||||||
while #segments < 8 do
|
while #segments < 8 do
|
||||||
table.insert(segments, 0)
|
table.insert(segments, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
return segments
|
return segments
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -208,46 +208,46 @@ rspamd_config:register_symbol({
|
|||||||
local function get_ipv6_variants(ip_str)
|
local function get_ipv6_variants(ip_str)
|
||||||
local variants = {}
|
local variants = {}
|
||||||
local seen = {}
|
local seen = {}
|
||||||
|
|
||||||
local function add_variant(v)
|
local function add_variant(v)
|
||||||
if v and not seen[v] then
|
if v and not seen[v] then
|
||||||
table.insert(variants, v)
|
table.insert(variants, v)
|
||||||
seen[v] = true
|
seen[v] = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- For IPv4, just return the original
|
-- For IPv4, just return the original
|
||||||
if not ip_str:find(':') then
|
if not ip_str:find(':') then
|
||||||
add_variant(ip_str)
|
add_variant(ip_str)
|
||||||
return variants
|
return variants
|
||||||
end
|
end
|
||||||
|
|
||||||
local segments = ipv6_to_segments(ip_str)
|
local segments = ipv6_to_segments(ip_str)
|
||||||
|
|
||||||
-- 1. Fully expanded form (all zeros shown as 0000)
|
-- 1. Fully expanded form (all zeros shown as 0000)
|
||||||
local expanded_parts = {}
|
local expanded_parts = {}
|
||||||
for _, seg in ipairs(segments) do
|
for _, seg in ipairs(segments) do
|
||||||
table.insert(expanded_parts, string.format('%04x', seg))
|
table.insert(expanded_parts, string.format('%04x', seg))
|
||||||
end
|
end
|
||||||
add_variant(table.concat(expanded_parts, ':'))
|
add_variant(table.concat(expanded_parts, ':'))
|
||||||
|
|
||||||
-- 2. Standard form (no leading zeros, but all segments present)
|
-- 2. Standard form (no leading zeros, but all segments present)
|
||||||
local standard_parts = {}
|
local standard_parts = {}
|
||||||
for _, seg in ipairs(segments) do
|
for _, seg in ipairs(segments) do
|
||||||
table.insert(standard_parts, string.format('%x', seg))
|
table.insert(standard_parts, string.format('%x', seg))
|
||||||
end
|
end
|
||||||
add_variant(table.concat(standard_parts, ':'))
|
add_variant(table.concat(standard_parts, ':'))
|
||||||
|
|
||||||
-- 3. Find all possible :: compressions
|
-- 3. Find all possible :: compressions
|
||||||
-- RFC 5952: compress the longest run of consecutive zeros
|
-- RFC 5952: compress the longest run of consecutive zeros
|
||||||
-- But we need to check all possibilities since Redis might have any form
|
-- But we need to check all possibilities since Redis might have any form
|
||||||
|
|
||||||
-- Find all zero runs
|
-- Find all zero runs
|
||||||
local zero_runs = {}
|
local zero_runs = {}
|
||||||
local in_run = false
|
local in_run = false
|
||||||
local run_start = 0
|
local run_start = 0
|
||||||
local run_length = 0
|
local run_length = 0
|
||||||
|
|
||||||
for i = 1, 8 do
|
for i = 1, 8 do
|
||||||
if segments[i] == 0 then
|
if segments[i] == 0 then
|
||||||
if not in_run then
|
if not in_run then
|
||||||
@@ -266,21 +266,21 @@ rspamd_config:register_symbol({
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Don't forget the last run
|
-- Don't forget the last run
|
||||||
if in_run and run_length >= 1 then
|
if in_run and run_length >= 1 then
|
||||||
table.insert(zero_runs, {start = run_start, length = run_length})
|
table.insert(zero_runs, {start = run_start, length = run_length})
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Generate variant for each zero run compression
|
-- Generate variant for each zero run compression
|
||||||
for _, run in ipairs(zero_runs) do
|
for _, run in ipairs(zero_runs) do
|
||||||
local parts = {}
|
local parts = {}
|
||||||
|
|
||||||
-- Before compression
|
-- Before compression
|
||||||
for i = 1, run.start - 1 do
|
for i = 1, run.start - 1 do
|
||||||
table.insert(parts, string.format('%x', segments[i]))
|
table.insert(parts, string.format('%x', segments[i]))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- The compression
|
-- The compression
|
||||||
if run.start == 1 then
|
if run.start == 1 then
|
||||||
table.insert(parts, '')
|
table.insert(parts, '')
|
||||||
@@ -291,22 +291,22 @@ rspamd_config:register_symbol({
|
|||||||
else
|
else
|
||||||
table.insert(parts, '')
|
table.insert(parts, '')
|
||||||
end
|
end
|
||||||
|
|
||||||
-- After compression
|
-- After compression
|
||||||
for i = run.start + run.length, 8 do
|
for i = run.start + run.length, 8 do
|
||||||
table.insert(parts, string.format('%x', segments[i]))
|
table.insert(parts, string.format('%x', segments[i]))
|
||||||
end
|
end
|
||||||
|
|
||||||
local compressed = table.concat(parts, ':'):gsub('::+', '::')
|
local compressed = table.concat(parts, ':'):gsub('::+', '::')
|
||||||
add_variant(compressed)
|
add_variant(compressed)
|
||||||
end
|
end
|
||||||
|
|
||||||
return variants
|
return variants
|
||||||
end
|
end
|
||||||
|
|
||||||
local from_ip_string = tostring(ip)
|
local from_ip_string = tostring(ip)
|
||||||
local ip_check_table = {}
|
local ip_check_table = {}
|
||||||
|
|
||||||
-- Add all variants of the exact IP
|
-- Add all variants of the exact IP
|
||||||
for _, variant in ipairs(get_ipv6_variants(from_ip_string)) do
|
for _, variant in ipairs(get_ipv6_variants(from_ip_string)) do
|
||||||
table.insert(ip_check_table, variant)
|
table.insert(ip_check_table, variant)
|
||||||
@@ -318,18 +318,18 @@ rspamd_config:register_symbol({
|
|||||||
maxbits = 32
|
maxbits = 32
|
||||||
minbits = 8
|
minbits = 8
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Add all CIDR notations with variants
|
-- Add all CIDR notations with variants
|
||||||
for i=maxbits,minbits,-1 do
|
for i=maxbits,minbits,-1 do
|
||||||
local masked_ip = ip:apply_mask(i)
|
local masked_ip = ip:apply_mask(i)
|
||||||
local cidr_base = masked_ip:to_string()
|
local cidr_base = masked_ip:to_string()
|
||||||
|
|
||||||
for _, variant in ipairs(get_ipv6_variants(cidr_base)) do
|
for _, variant in ipairs(get_ipv6_variants(cidr_base)) do
|
||||||
local cidr = variant .. "/" .. i
|
local cidr = variant .. "/" .. i
|
||||||
table.insert(ip_check_table, cidr)
|
table.insert(ip_check_table, cidr)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function keep_spam_cb(err, data)
|
local function keep_spam_cb(err, data)
|
||||||
if err then
|
if err then
|
||||||
rspamd_logger.infox(rspamd_config, "keep_spam query request for ip %s returned invalid or empty data (\"%s\") or error (\"%s\")", ip, data, err)
|
rspamd_logger.infox(rspamd_config, "keep_spam query request for ip %s returned invalid or empty data (\"%s\") or error (\"%s\")", ip, data, err)
|
||||||
@@ -345,7 +345,7 @@ rspamd_config:register_symbol({
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
table.insert(ip_check_table, 1, 'KEEP_SPAM')
|
table.insert(ip_check_table, 1, 'KEEP_SPAM')
|
||||||
local redis_ret_user = rspamd_redis_make_request(task,
|
local redis_ret_user = rspamd_redis_make_request(task,
|
||||||
redis_params, -- connect params
|
redis_params, -- connect params
|
||||||
@@ -362,61 +362,6 @@ rspamd_config:register_symbol({
|
|||||||
priority = 19
|
priority = 19
|
||||||
})
|
})
|
||||||
|
|
||||||
rspamd_config:register_symbol({
|
|
||||||
name = 'WHITELISTED_FWD_HOST',
|
|
||||||
type = 'prefilter',
|
|
||||||
score = 0.0,
|
|
||||||
callback = function(task)
|
|
||||||
local rspamd_logger = require "rspamd_logger"
|
|
||||||
local redis_params = rspamd_parse_redis_server('fwd_host')
|
|
||||||
local ip = task:get_from_ip()
|
|
||||||
|
|
||||||
if ip == nil or not ip:is_valid() then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
local from_ip_string = tostring(ip)
|
|
||||||
local ip_check_table = {'WHITELISTED_FWD_HOST', from_ip_string}
|
|
||||||
|
|
||||||
local maxbits = 128
|
|
||||||
local minbits = 7
|
|
||||||
if ip:get_version() == 4 then
|
|
||||||
maxbits = 32
|
|
||||||
minbits = 8
|
|
||||||
end
|
|
||||||
for i=maxbits,minbits,-1 do
|
|
||||||
table.insert(ip_check_table, ip:apply_mask(i):to_string() .. "/" .. i)
|
|
||||||
end
|
|
||||||
|
|
||||||
local function fwd_host_cb(err, data)
|
|
||||||
if err or type(data) ~= 'table' then
|
|
||||||
rspamd_logger.infox(rspamd_config, "fwd_host query request for ip %s returned invalid or empty data (\"%s\") or error (\"%s\")", ip, data, err)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
for _,v in pairs(data) do
|
|
||||||
if type(v) == 'string' then
|
|
||||||
task:insert_result('WHITELISTED_FWD_HOST', 1.0, from_ip_string)
|
|
||||||
task:set_flag('pass_all')
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local redis_ret = rspamd_redis_make_request(task,
|
|
||||||
redis_params, -- connect params
|
|
||||||
'WHITELISTED_FWD_HOST', -- hash key
|
|
||||||
false, -- is write
|
|
||||||
fwd_host_cb, --callback
|
|
||||||
'HMGET', -- command
|
|
||||||
ip_check_table -- arguments
|
|
||||||
)
|
|
||||||
if not redis_ret then
|
|
||||||
rspamd_logger.infox(rspamd_config, "cannot check fwd_host redis map")
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
priority = 18
|
|
||||||
})
|
|
||||||
|
|
||||||
rspamd_config:register_symbol({
|
rspamd_config:register_symbol({
|
||||||
name = 'TLS_HEADER',
|
name = 'TLS_HEADER',
|
||||||
type = 'postfilter',
|
type = 'postfilter',
|
||||||
@@ -445,8 +390,9 @@ rspamd_config:register_symbol({
|
|||||||
local rspamd_logger = require "rspamd_logger"
|
local rspamd_logger = require "rspamd_logger"
|
||||||
local redis_params = rspamd_parse_redis_server('taghandler')
|
local redis_params = rspamd_parse_redis_server('taghandler')
|
||||||
local rspamd_http = require "rspamd_http"
|
local rspamd_http = require "rspamd_http"
|
||||||
local rcpts = task:get_recipients({'smtp', 'orig'})
|
local rcpts = task:get_recipients('smtp')
|
||||||
local lua_util = require "lua_util"
|
local lua_util = require "lua_util"
|
||||||
|
local tagged_rcpt = task:get_symbol("TAGGED_RCPT")
|
||||||
|
|
||||||
local function remove_moo_tag()
|
local function remove_moo_tag()
|
||||||
local moo_tag_header = task:get_header('X-Moo-Tag', false)
|
local moo_tag_header = task:get_header('X-Moo-Tag', false)
|
||||||
@@ -471,9 +417,8 @@ rspamd_config:register_symbol({
|
|||||||
|
|
||||||
-- Check if recipient has a tag (contains '+')
|
-- Check if recipient has a tag (contains '+')
|
||||||
local tag = nil
|
local tag = nil
|
||||||
local base_user, tag_part = rcpt_user:match('^([^%+]+)%+(.+)$')
|
if tagged_rcpt ~= nil then
|
||||||
if base_user and tag_part then
|
tag = tagged_rcpt
|
||||||
tag = tag_part
|
|
||||||
rspamd_logger.infox("TAG_MOO: found tag in recipient: %s (base: %s, tag: %s)", rcpt_addr, base_user, tag)
|
rspamd_logger.infox("TAG_MOO: found tag in recipient: %s (base: %s, tag: %s)", rcpt_addr, base_user, tag)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -496,7 +441,7 @@ rspamd_config:register_symbol({
|
|||||||
|
|
||||||
-- Check if we have a pre-result (e.g., from KEEP_SPAM or POSTMASTER_HANDLER)
|
-- Check if we have a pre-result (e.g., from KEEP_SPAM or POSTMASTER_HANDLER)
|
||||||
local allow_processing = false
|
local allow_processing = false
|
||||||
|
|
||||||
if task.has_pre_result then
|
if task.has_pre_result then
|
||||||
local has_pre, pre_action = task:has_pre_result()
|
local has_pre, pre_action = task:has_pre_result()
|
||||||
if has_pre then
|
if has_pre then
|
||||||
@@ -553,7 +498,8 @@ rspamd_config:register_symbol({
|
|||||||
else
|
else
|
||||||
rspamd_logger.infox("TAG_MOO: user wants subject modified for tagged mail")
|
rspamd_logger.infox("TAG_MOO: user wants subject modified for tagged mail")
|
||||||
local sbj = task:get_header('Subject') or ''
|
local sbj = task:get_header('Subject') or ''
|
||||||
new_sbj = '=?UTF-8?B?' .. tostring(util.encode_base64('[' .. tag .. '] ' .. sbj)) .. '?='
|
local tag_value = tag[1] and tag[1].options and tag[1].options[1] or ''
|
||||||
|
new_sbj = '=?UTF-8?B?' .. tostring(util.encode_base64('[' .. tag_value .. '] ' .. sbj)) .. '?='
|
||||||
task:set_milter_reply({
|
task:set_milter_reply({
|
||||||
remove_headers = {
|
remove_headers = {
|
||||||
['Subject'] = 1,
|
['Subject'] = 1,
|
||||||
@@ -819,22 +765,13 @@ rspamd_config:register_symbol({
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Expand a domain footer: replace only "{= key =}" placeholders with their values.
|
|
||||||
-- Unknown placeholders render empty, matching the previous engine behaviour.
|
|
||||||
local function expand_footer(template, replacements)
|
|
||||||
return (template:gsub('{=%s*([%w_]+)%s*=}', function(key)
|
|
||||||
local value = replacements[key]
|
|
||||||
if value == nil then return '' end
|
|
||||||
return tostring(value)
|
|
||||||
end))
|
|
||||||
end
|
|
||||||
|
|
||||||
rspamd_config:register_symbol({
|
rspamd_config:register_symbol({
|
||||||
name = 'MOO_FOOTER',
|
name = 'MOO_FOOTER',
|
||||||
type = 'prefilter',
|
type = 'prefilter',
|
||||||
callback = function(task)
|
callback = function(task)
|
||||||
local cjson = require "cjson"
|
local cjson = require "cjson"
|
||||||
local lua_mime = require "lua_mime"
|
local lua_mime = require "lua_mime"
|
||||||
|
local lua_util = require "lua_util"
|
||||||
local rspamd_logger = require "rspamd_logger"
|
local rspamd_logger = require "rspamd_logger"
|
||||||
local rspamd_http = require "rspamd_http"
|
local rspamd_http = require "rspamd_http"
|
||||||
local envfrom = task:get_from(1)
|
local envfrom = task:get_from(1)
|
||||||
@@ -907,10 +844,10 @@ rspamd_config:register_symbol({
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if footer.html and footer.html ~= "" then
|
if footer.html and footer.html ~= "" then
|
||||||
footer.html = expand_footer(footer.html, replacements)
|
footer.html = lua_util.jinja_template(footer.html, replacements, true)
|
||||||
end
|
end
|
||||||
if footer.plain and footer.plain ~= "" then
|
if footer.plain and footer.plain ~= "" then
|
||||||
footer.plain = expand_footer(footer.plain, replacements)
|
footer.plain = lua_util.jinja_template(footer.plain, replacements, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- add footer
|
-- add footer
|
||||||
@@ -961,9 +898,6 @@ rspamd_config:register_symbol({
|
|||||||
|
|
||||||
if not seen_cte and rewrite.need_rewrite_ct then
|
if not seen_cte and rewrite.need_rewrite_ct then
|
||||||
out[#out + 1] = string.format('%s: %s', 'Content-Transfer-Encoding', new_cte)
|
out[#out + 1] = string.format('%s: %s', 'Content-Transfer-Encoding', new_cte)
|
||||||
task:set_milter_reply({
|
|
||||||
add_headers = {['Content-Transfer-Encoding'] = new_cte}
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- End of headers
|
-- End of headers
|
||||||
@@ -1013,134 +947,3 @@ rspamd_config:register_symbol({
|
|||||||
end,
|
end,
|
||||||
priority = 1
|
priority = 1
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Archive: a copy of every accepted mail of an archived mailbox goes by SMTP to the archive, through Postfix (port 591)
|
|
||||||
rspamd_config:register_symbol({
|
|
||||||
name = 'MAILCOW_ARCHIVE',
|
|
||||||
type = 'idempotent',
|
|
||||||
flags = 'empty,explicit_disable,ignore_passthrough',
|
|
||||||
callback = function(task)
|
|
||||||
local rspamd_http = require "rspamd_http"
|
|
||||||
local rspamd_logger = require "rspamd_logger"
|
|
||||||
local rspamd_text = require "rspamd_text"
|
|
||||||
local rspamd_util = require "rspamd_util"
|
|
||||||
local hash = require "rspamd_cryptobox_hash"
|
|
||||||
local lua_smtp = require "lua_smtp"
|
|
||||||
local cjson = require "cjson"
|
|
||||||
|
|
||||||
-- accepted mails only: no reject, soft reject (greylisting included), discard or quarantine
|
|
||||||
local action = task:get_metric_action('default')
|
|
||||||
local accepted = (action == 'no action' or action == 'add header' or action == 'rewrite subject' or action == 'greylist')
|
|
||||||
local pre_accept = false
|
|
||||||
if task.has_pre_result then
|
|
||||||
local has_pre, pre_action = task:has_pre_result()
|
|
||||||
pre_accept = (has_pre and pre_action == 'accept')
|
|
||||||
end
|
|
||||||
if not accepted and not pre_accept then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local rcpts = {}
|
|
||||||
for _, r in ipairs(task:get_recipients('smtp') or {}) do
|
|
||||||
if r.addr and r.addr ~= '' then
|
|
||||||
table.insert(rcpts, r.addr)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if #rcpts == 0 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local from = task:get_from('smtp')
|
|
||||||
local from_addr = (from and from[1] and from[1].addr) or ''
|
|
||||||
local qid = task:get_queue_id() or ''
|
|
||||||
-- the BCC symbol sends copies under the same condition, they bypass rspamd
|
|
||||||
local bcc = (pre_accept or (action ~= 'greylist' and accepted)) and not task:has_symbol('ENCRYPTED_CHAT')
|
|
||||||
local redis_params = rspamd_parse_redis_server('archive')
|
|
||||||
|
|
||||||
-- not archived: counted and listed for the archive status in the UI
|
|
||||||
-- the Message-ID finds the mail in the archive log of the UI
|
|
||||||
local message_id = task:get_message_id()
|
|
||||||
if not message_id or message_id == 'undef' then
|
|
||||||
message_id = ''
|
|
||||||
end
|
|
||||||
local function dropped(reason)
|
|
||||||
rspamd_logger.errx(task, "archive: mail %s is not archived: %s", qid, reason)
|
|
||||||
rspamd_redis_make_request(task, redis_params, 'ARCHIVE_DROPPED', true, function() end, 'INCR', {'ARCHIVE_DROPPED'})
|
|
||||||
rspamd_redis_make_request(task, redis_params, 'ARCHIVE_DROPPED_LOG', true, function() end, 'LPUSH',
|
|
||||||
{'ARCHIVE_DROPPED_LOG', cjson.encode({time = os.time(), qid = qid, reason = tostring(reason), message_id = message_id})})
|
|
||||||
rspamd_redis_make_request(task, redis_params, 'ARCHIVE_DROPPED_LOG', true, function() end, 'LTRIM', {'ARCHIVE_DROPPED_LOG', '0', '99'})
|
|
||||||
end
|
|
||||||
|
|
||||||
local function archive()
|
|
||||||
-- the archive gets the mail as accepted, with CRLF line ends and a final CRLF (also what the hash covers)
|
|
||||||
local content = rspamd_text.fromstring(tostring(task:get_content()))
|
|
||||||
content:normalize_newlines('smtp')
|
|
||||||
if #content < 2 or content:at(#content) ~= 10 or content:at(#content - 1) ~= 13 then
|
|
||||||
content = rspamd_text.fromtable({content, '\r\n'})
|
|
||||||
end
|
|
||||||
local body = {
|
|
||||||
from = from_addr,
|
|
||||||
rcpt = rcpts,
|
|
||||||
user = task:get_user() or '',
|
|
||||||
bcc = bcc,
|
|
||||||
qid = qid,
|
|
||||||
received = rspamd_util.get_time(),
|
|
||||||
sha256 = hash.create_specific('sha256', content):hex()
|
|
||||||
}
|
|
||||||
|
|
||||||
local function sent_cb(ok, err)
|
|
||||||
if not ok then
|
|
||||||
dropped(err)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function journal_cb(err, code, res_body)
|
|
||||||
if err or code ~= 200 then
|
|
||||||
dropped(string.format('owner lookup failed (%s, %s)', err, code))
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local ok, res = pcall(cjson.decode, tostring(res_body))
|
|
||||||
if not ok or type(res) ~= 'table' then
|
|
||||||
dropped('invalid answer of the owner lookup')
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if res.archive ~= true then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
-- lua_smtp ends the data with CRLF.CRLF, so the last CRLF of the content is left to it
|
|
||||||
lua_smtp.sendmail({
|
|
||||||
task = task,
|
|
||||||
host = os.getenv("IPV4_NETWORK") .. '.253',
|
|
||||||
port = 591,
|
|
||||||
from = res.sender,
|
|
||||||
recipients = res.rcpt,
|
|
||||||
helo = 'archive',
|
|
||||||
timeout = 20,
|
|
||||||
}, {res.headers or '', content:span(1, #content - 2)}, sent_cb)
|
|
||||||
end
|
|
||||||
|
|
||||||
rspamd_http.request({
|
|
||||||
task = task,
|
|
||||||
url = 'http://nginx:8081/archive.php',
|
|
||||||
body = cjson.encode(body),
|
|
||||||
timeout = (#rcpts > 100) and 10.0 or 2.0,
|
|
||||||
callback = journal_cb,
|
|
||||||
headers = {['Content-Type'] = 'application/json'},
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
local function enabled_cb(err, data)
|
|
||||||
if not err and type(data) == 'string' and data == '1' then
|
|
||||||
archive()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
rspamd_redis_make_request(task,
|
|
||||||
redis_params, -- connect params
|
|
||||||
'ARCHIVE_ENABLED', -- hash key
|
|
||||||
false, -- is write
|
|
||||||
enabled_cb, --callback
|
|
||||||
'GET', -- command
|
|
||||||
{'ARCHIVE_ENABLED'} -- arguments
|
|
||||||
)
|
|
||||||
end
|
|
||||||
})
|
|
||||||
@@ -109,7 +109,7 @@ foreach ($rcpts as $rcpt) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Skip if domain is excluded
|
// Skip if domain is excluded
|
||||||
if (is_array($exclude_domains) && in_array($parsed_rcpt['domain'], $exclude_domains)) {
|
if (in_array($parsed_rcpt['domain'], $exclude_domains)) {
|
||||||
error_log(sprintf("QUARANTINE: Skipped domain %s", $parsed_rcpt['domain']) . PHP_EOL);
|
error_log(sprintf("QUARANTINE: Skipped domain %s", $parsed_rcpt['domain']) . PHP_EOL);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -216,9 +216,8 @@ foreach ($rcpts as $rcpt) {
|
|||||||
foreach ($rcpt_final_mailboxes as $rcpt_final) {
|
foreach ($rcpt_final_mailboxes as $rcpt_final) {
|
||||||
error_log("QUARANTINE: quarantine pipe: processing quarantine message for rcpt " . $rcpt_final . PHP_EOL);
|
error_log("QUARANTINE: quarantine pipe: processing quarantine message for rcpt " . $rcpt_final . PHP_EOL);
|
||||||
try {
|
try {
|
||||||
// qhash is the secret of the release/delete links in notifications, so it must not be derivable
|
$stmt = $pdo->prepare("INSERT INTO `quarantine` (`qid`, `subject`, `score`, `sender`, `rcpt`, `symbols`, `user`, `ip`, `msg`, `action`, `fuzzy_hashes`)
|
||||||
$stmt = $pdo->prepare("INSERT INTO `quarantine` (`qid`, `subject`, `score`, `sender`, `rcpt`, `symbols`, `user`, `ip`, `msg`, `action`, `fuzzy_hashes`, `qhash`)
|
VALUES (:qid, :subject, :score, :sender, :rcpt, :symbols, :user, :ip, :msg, :action, :fuzzy_hashes)");
|
||||||
VALUES (:qid, :subject, :score, :sender, :rcpt, :symbols, :user, :ip, :msg, :action, :fuzzy_hashes, :qhash)");
|
|
||||||
$stmt->execute(array(
|
$stmt->execute(array(
|
||||||
':qid' => $qid,
|
':qid' => $qid,
|
||||||
':subject' => $subject,
|
':subject' => $subject,
|
||||||
@@ -230,9 +229,11 @@ foreach ($rcpt_final_mailboxes as $rcpt_final) {
|
|||||||
':ip' => $ip,
|
':ip' => $ip,
|
||||||
':msg' => $raw_data,
|
':msg' => $raw_data,
|
||||||
':action' => $action,
|
':action' => $action,
|
||||||
':fuzzy_hashes' => $fuzzy,
|
':fuzzy_hashes' => $fuzzy
|
||||||
':qhash' => bin2hex(random_bytes(32))
|
|
||||||
));
|
));
|
||||||
|
$lastId = $pdo->lastInsertId();
|
||||||
|
$stmt_update = $pdo->prepare("UPDATE `quarantine` SET `qhash` = SHA2(CONCAT(`id`, `qid`), 256) WHERE `id` = :id");
|
||||||
|
$stmt_update->execute(array(':id' => $lastId));
|
||||||
$stmt = $pdo->prepare('DELETE FROM `quarantine` WHERE `rcpt` = :rcpt AND `id` NOT IN (
|
$stmt = $pdo->prepare('DELETE FROM `quarantine` WHERE `rcpt` = :rcpt AND `id` NOT IN (
|
||||||
SELECT `id`
|
SELECT `id`
|
||||||
FROM (
|
FROM (
|
||||||
|
|||||||
@@ -11,8 +11,6 @@ $_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
|
|||||||
|
|
||||||
$js_minifier->add('/web/js/site/imapsync.js');
|
$js_minifier->add('/web/js/site/imapsync.js');
|
||||||
$js_minifier->add('/web/js/site/groups.js');
|
$js_minifier->add('/web/js/site/groups.js');
|
||||||
$js_minifier->add('/web/js/site/mail-policy.js');
|
|
||||||
$js_minifier->add('/web/js/site/retention.js');
|
|
||||||
$js_minifier->add('/web/js/site/mailbox.js');
|
$js_minifier->add('/web/js/site/mailbox.js');
|
||||||
$js_minifier->add('/web/js/presets/sieveMailbox.js');
|
$js_minifier->add('/web/js/presets/sieveMailbox.js');
|
||||||
$js_minifier->add('/web/js/site/pwgen.js');
|
$js_minifier->add('/web/js/site/pwgen.js');
|
||||||
@@ -48,9 +46,6 @@ $template_data = [
|
|||||||
'lang_edit' => json_encode($lang['edit']),
|
'lang_edit' => json_encode($lang['edit']),
|
||||||
'lang_datatables' => json_encode($lang['datatables']),
|
'lang_datatables' => json_encode($lang['datatables']),
|
||||||
'imapsync_redirect_uri' => \Mailcow\Imapsync\ImapsyncModule::fromGlobals()->oauth->redirectUri(),
|
'imapsync_redirect_uri' => \Mailcow\Imapsync\ImapsyncModule::fromGlobals()->oauth->redirectUri(),
|
||||||
'archive_enabled' => \Mailcow\Archive\ArchiveModule::fromGlobals()->settings->enabled(),
|
|
||||||
'mail_policy_groups' => \Mailcow\MailPolicy\MailPolicyModule::fromGlobals()->policies->groupChoices($domains),
|
|
||||||
'retention_groups' => \Mailcow\Retention\RetentionModule::fromGlobals()->rules->groupChoices($domains),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/footer.inc.php';
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/footer.inc.php';
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<?php
|
|
||||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php';
|
|
||||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/triggers.admin.inc.php';
|
|
||||||
|
|
||||||
protect_route(['admin']);
|
|
||||||
|
|
||||||
$role = "admin";
|
|
||||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/restore.inc.php';
|
|
||||||
@@ -13,8 +13,6 @@ $js_minifier->add('/web/js/site/admin.js');
|
|||||||
$js_minifier->add('/web/js/presets/rspamd.js');
|
$js_minifier->add('/web/js/presets/rspamd.js');
|
||||||
$js_minifier->add('/web/js/site/pwgen.js');
|
$js_minifier->add('/web/js/site/pwgen.js');
|
||||||
$js_minifier->add('/web/js/site/identity.js');
|
$js_minifier->add('/web/js/site/identity.js');
|
||||||
$js_minifier->add('/web/js/site/archive.js');
|
|
||||||
$js_minifier->add('/web/js/site/backup.js');
|
|
||||||
|
|
||||||
// all domains
|
// all domains
|
||||||
$domains = mailbox('get', 'domains');
|
$domains = mailbox('get', 'domains');
|
||||||
@@ -118,15 +116,11 @@ $template_data = [
|
|||||||
'ui_theme' => customize('get', 'ui_theme'),
|
'ui_theme' => customize('get', 'ui_theme'),
|
||||||
'password_complexity' => password_complexity('get'),
|
'password_complexity' => password_complexity('get'),
|
||||||
'imapsync_settings' => \Mailcow\Imapsync\ImapsyncModule::fromGlobals()->api->getSettings(),
|
'imapsync_settings' => \Mailcow\Imapsync\ImapsyncModule::fromGlobals()->api->getSettings(),
|
||||||
'archive_settings' => \Mailcow\Archive\ArchiveModule::fromGlobals()->api->getSettings(),
|
|
||||||
'show_rspamd_global_filters' => @$_SESSION['show_rspamd_global_filters'],
|
'show_rspamd_global_filters' => @$_SESSION['show_rspamd_global_filters'],
|
||||||
'cors_settings' => $cors_settings,
|
'cors_settings' => $cors_settings,
|
||||||
'is_https' => isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on',
|
'is_https' => isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on',
|
||||||
'iam_settings' => $iam_settings,
|
'iam_settings' => $iam_settings,
|
||||||
'mbox_templates' => $mbox_templates,
|
'mbox_templates' => $mbox_templates,
|
||||||
'backup_timezone' => getenv('TZ') ?: 'UTC',
|
|
||||||
'backup_hostname' => getenv('MAILCOW_HOSTNAME') ?: '',
|
|
||||||
'backup_demo_mode' => $DEMO_MODE,
|
|
||||||
'lang_admin' => json_encode($lang['admin']),
|
'lang_admin' => json_encode($lang['admin']),
|
||||||
'lang_datatables' => json_encode($lang['datatables'])
|
'lang_datatables' => json_encode($lang['datatables'])
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -14,19 +14,3 @@ body {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
background: #fafafa;
|
background: #fafafa;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* mailcow: inline code in descriptions in the text colour instead of bold purple */
|
|
||||||
.swagger-ui .markdown code,
|
|
||||||
.swagger-ui .renderedMarkdown code {
|
|
||||||
color: inherit;
|
|
||||||
font-weight: normal;
|
|
||||||
font-size: 0.9em;
|
|
||||||
background: rgba(0, 0, 0, 0.04);
|
|
||||||
padding: 0 3px;
|
|
||||||
}
|
|
||||||
|
|
||||||
html.dark-mode .swagger-ui .markdown code,
|
|
||||||
html.dark-mode .swagger-ui .renderedMarkdown code {
|
|
||||||
color: inherit;
|
|
||||||
background: rgba(255, 255, 255, 0.08);
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,79 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en-US">
|
<html lang="en-US">
|
||||||
|
<head>
|
||||||
|
<title>Swagger UI: OAuth2 Redirect</title>
|
||||||
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<script src="oauth2-redirect.js"></script>
|
<script>
|
||||||
|
'use strict';
|
||||||
|
function run () {
|
||||||
|
var oauth2 = window.opener.swaggerUIRedirectOauth2;
|
||||||
|
var sentState = oauth2.state;
|
||||||
|
var redirectUrl = oauth2.redirectUrl;
|
||||||
|
var isValid, qp, arr;
|
||||||
|
|
||||||
|
if (/code|token|error/.test(window.location.hash)) {
|
||||||
|
qp = window.location.hash.substring(1).replace('?', '&');
|
||||||
|
} else {
|
||||||
|
qp = location.search.substring(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
arr = qp.split("&");
|
||||||
|
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
|
||||||
|
qp = qp ? JSON.parse('{' + arr.join() + '}',
|
||||||
|
function (key, value) {
|
||||||
|
return key === "" ? value : decodeURIComponent(value);
|
||||||
|
}
|
||||||
|
) : {};
|
||||||
|
|
||||||
|
isValid = qp.state === sentState;
|
||||||
|
|
||||||
|
if ((
|
||||||
|
oauth2.auth.schema.get("flow") === "accessCode" ||
|
||||||
|
oauth2.auth.schema.get("flow") === "authorizationCode" ||
|
||||||
|
oauth2.auth.schema.get("flow") === "authorization_code"
|
||||||
|
) && !oauth2.auth.code) {
|
||||||
|
if (!isValid) {
|
||||||
|
oauth2.errCb({
|
||||||
|
authId: oauth2.auth.name,
|
||||||
|
source: "auth",
|
||||||
|
level: "warning",
|
||||||
|
message: "Authorization may be unsafe, passed state was changed in server. The passed state wasn't returned from auth server."
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (qp.code) {
|
||||||
|
delete oauth2.state;
|
||||||
|
oauth2.auth.code = qp.code;
|
||||||
|
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
|
||||||
|
} else {
|
||||||
|
let oauthErrorMsg;
|
||||||
|
if (qp.error) {
|
||||||
|
oauthErrorMsg = "["+qp.error+"]: " +
|
||||||
|
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
|
||||||
|
(qp.error_uri ? "More info: "+qp.error_uri : "");
|
||||||
|
}
|
||||||
|
|
||||||
|
oauth2.errCb({
|
||||||
|
authId: oauth2.auth.name,
|
||||||
|
source: "auth",
|
||||||
|
level: "error",
|
||||||
|
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server."
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});
|
||||||
|
}
|
||||||
|
window.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.readyState !== 'loading') {
|
||||||
|
run();
|
||||||
|
} else {
|
||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
run();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -1 +0,0 @@
|
|||||||
"use strict";function run(){var e,r,t,a=window.opener.swaggerUIRedirectOauth2,o=a.state,n=a.redirectUrl;if((t=(r=/code|token|error/.test(window.location.hash)?window.location.hash.substring(1).replace("?","&"):location.search.substring(1)).split("&")).forEach((function(e,r,t){t[r]='"'+e.replace("=",'":"')+'"'})),e=(r=r?JSON.parse("{"+t.join()+"}",(function(e,r){return""===e?r:decodeURIComponent(r)})):{}).state===o,"accessCode"!==a.auth.schema.get("flow")&&"authorizationCode"!==a.auth.schema.get("flow")&&"authorization_code"!==a.auth.schema.get("flow")||a.auth.code)a.callback({auth:a.auth,token:r,isValid:e,redirectUrl:n});else if(e||a.errCb({authId:a.auth.name,source:"auth",level:"warning",message:"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"}),r.code)delete a.state,a.auth.code=r.code,a.callback({auth:a.auth,redirectUrl:n});else{let e;r.error&&(e="["+r.error+"]: "+(r.error_description?r.error_description+". ":"no accessCode received from the server. ")+(r.error_uri?"More info: "+r.error_uri:"")),a.errCb({authId:a.auth.name,source:"auth",level:"error",message:e||"[Authorization failed]: no accessCode received from the server"})}window.close()}"loading"!==document.readyState?run():document.addEventListener("DOMContentLoaded",(function(){run()}));
|
|
||||||
+7577
-15864
File diff suppressed because it is too large.
Load diff
@@ -1,2 +1,3 @@
|
|||||||
/*! For license information please see swagger-ui-bundle.js.LICENSE.txt */
|
/*! For license information please see swagger-ui-bundle.js.LICENSE.txt */
|
||||||
!function webpackUniversalModuleDefinition(s,o){"object"==typeof exports&&"object"==typeof module?module.exports=o():"function"==typeof define&&define.amd?define([],o):"object"==typeof exports?exports.SwaggerUIBundle=o():s.SwaggerUIBundle=o()}(this,(()=>(()=>{var s={67526(s,o){"use strict";o.byteLength=function byteLength(s){var o=getLens(s),i=o[0],a=o[1];return 3*(i+a)/4-a},o.toByteArray=function toByteArray(s){var o,i,_=getLens(s),w=_[0],x=_[1],C=new u(function _byteLength(s,o,i){return 3*(o+i)/4-i}(0,w,x)),j=0,L=x>0?w-4:w;for(i=0;i<L;i+=4)o=a[s.charCodeAt(i)]<<18|a[s.charCodeAt(i+1)]<<12|a[s.charCodeAt(i+2)]<<6|a[s.charCodeAt(i+3)],C[j++]=o>>16&255,C[j++]=o>>8&255,C[j++]=255&o;2===x&&(o=a[s.charCodeAt(i)]<<2|a[s.charCodeAt(i+1)]>>4,C[j++]=255&o);1===x&&(o=a[s.charCodeAt(i)]<<10|a[s.charCodeAt(i+1)]<<4|a[s.charCodeAt(i+2)]>>2,C[j++]=o>>8&255,C[j++]=255&o);return C},o.fromByteArray=function fromByteArray(s){for(var o,a=s.length,u=a%3,_=[],w=16383,x=0,C=a-u;x<C;x+=w)_.push(encodeChunk(s,x,x+w>C?C:x+w));1===u?(o=s[a-1],_.push(i[o>>2]+i[o<<4&63]+"==")):2===u&&(o=(s[a-2]<<8)+s[a-1],_.push(i[o>>10]+i[o>>4&63]+i[o<<2&63]+"="));return _.join("")};for(var i=[],a=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w=0;w<64;++w)i[w]=_[w],a[_.charCodeAt(w)]=w;function getLens(s){var o=s.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=s.indexOf("=");return-1===i&&(i=o),[i,i===o?0:4-i%4]}function encodeChunk(s,o,a){for(var u,_,w=[],x=o;x<a;x+=3)u=(s[x]<<16&16711680)+(s[x+1]<<8&65280)+(255&s[x+2]),w.push(i[(_=u)>>18&63]+i[_>>12&63]+i[_>>6&63]+i[63&_]);return w.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},48287(s,o,i){"use strict";const a=i(67526),u=i(251),_="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;o.Buffer=Buffer,o.SlowBuffer=function SlowBuffer(s){+s!=s&&(s=0);return Buffer.alloc(+s)},o.INSPECT_MAX_BYTES=50;const w=2147483647;function createBuffer(s){if(s>w)throw new RangeError('The value "'+s+'" is invalid for option "size"');const o=new Uint8Array(s);return Object.setPrototypeOf(o,Buffer.prototype),o}function Buffer(s,o,i){if("number"==typeof s){if("string"==typeof o)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(s)}return from(s,o,i)}function from(s,o,i){if("string"==typeof s)return function fromString(s,o){"string"==typeof o&&""!==o||(o="utf8");if(!Buffer.isEncoding(o))throw new TypeError("Unknown encoding: "+o);const i=0|byteLength(s,o);let a=createBuffer(i);const u=a.write(s,o);u!==i&&(a=a.slice(0,u));return a}(s,o);if(ArrayBuffer.isView(s))return function fromArrayView(s){if(isInstance(s,Uint8Array)){const o=new Uint8Array(s);return fromArrayBuffer(o.buffer,o.byteOffset,o.byteLength)}return fromArrayLike(s)}(s);if(null==s)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof s);if(isInstance(s,ArrayBuffer)||s&&isInstance(s.buffer,ArrayBuffer))return fromArrayBuffer(s,o,i);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(s,SharedArrayBuffer)||s&&isInstance(s.buffer,SharedArrayBuffer)))return fromArrayBuffer(s,o,i);if("number"==typeof s)throw new TypeError('The "value" argument must not be of type number. Received type number');const a=s.valueOf&&s.valueOf();if(null!=a&&a!==s)return Buffer.from(a,o,i);const u=function fromObject(s){if(Buffer.isBuffer(s)){const o=0|checked(s.length),i=createBuffer(o);return 0===i.length||s.copy(i,0,0,o),i}if(void 0!==s.length)return"number"!=typeof s.length||numberIsNaN(s.length)?createBuffer(0):fromArrayLike(s);if("Buffer"===s.type&&Array.isArray(s.data))return fromArrayLike(s.data)}(s);if(u)return u;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof s[Symbol.toPrimitive])return Buffer.from(s[Symbol.toPrimitive]("string"),o,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof s)}function assertSize(s){if("number"!=typeof s)throw new TypeError('"size" argument must be of type number');if(s<0)throw new RangeError('The value "'+s+'" is invalid for option "size"')}function allocUnsafe(s){return assertSize(s),createBuffer(s<0?0:0|checked(s))}function fromArrayLike(s){const o=s.length<0?0:0|checked(s.length),i=createBuffer(o);for(let a=0;a<o;a+=1)i[a]=255&s[a];return i}function fromArrayBuffer(s,o,i){if(o<0||s.byteLength<o)throw new RangeError('"offset" is outside of buffer bounds');if(s.byteLength<o+(i||0))throw new RangeError('"length" is outside of buffer bounds');let a;return a=void 0===o&&void 0===i?new Uint8Array(s):void 0===i?new Uint8Array(s,o):new Uint8Array(s,o,i),Object.setPrototypeOf(a,Buffer.prototype),a}function checked(s){if(s>=w)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w.toString(16)+"
Line truncated
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUIBundle=t():e.SwaggerUIBundle=t()}(this,(()=>(()=>{var e={17967:(e,t)=>{"use strict";t.N=void 0;var n=/^([^\w]*)(javascript|data|vbscript)/im,r=/&#(\w+)(^\w|;)?/g,o=/&(newline|tab);/gi,s=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,i=/^.+(:|:)/gim,a=[".","/"];t.N=function(e){var t,l=(t=e||"",t.replace(r,(function(e,t){return String.fromCharCode(t)}))).replace(o,"").replace(s,"").trim();if(!l)return"about:blank";if(function(e){return a.indexOf(e[0])>-1}(l))return l;var c=l.match(i);if(!c)return l;var u=c[0];return n.test(u)?"about:blank":l}},53795:(e,t,n)=>{"use strict";n.d(t,{Z:()=>P});var r=n(23101),o=n.n(r),s=n(61125),i=n.n(s),a=n(11882),l=n.n(a),c=n(97606),u=n.n(c),p=n(67294),h=n(43393);function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function v(e,t){return v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}function b(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var w={};function E(e,t,n){return function(e){return null==e}(e)?n:function(e){return null!==e&&"object"===f(e)&&"function"==typeof e.get&&"function"==typeof e.has}(e)?e.has(t)?e.get(t):n:hasOwnProperty.call(e,t)?e[t]:n}function x(e,t,n){for(var r=0;r!==t.length;)if((e=E(e,t[r++],w))===w)return n;return e}function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=function(e,t){return function(n){if("string"==typeof n)return(0,h.is)(t[n],e[n]);if(Array.isArray(n))return(0,h.is)(x(t,n),x(e,n));throw new TypeError("Invalid key: expected Array or string: "+n)}}(t,n),o=e||Object.keys(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(n,!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n,{},t));return o.every(r)}const _=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),b(this,y(t).apply(this,arguments))}var n,r,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(t,e),n=t,r=[{key:"shouldComponentUpdate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!S(this.updateOnProps,this.props,e,"updateOnProps")||!S(this.updateOnStates,this.state,t,"updateOnStates")}}],r&&d(n.prototype,r),o&&d(n,o),t}(p.Component);var j=n(23930),O=n.n(j),k=n(45697),A=n.n(k);const C=e=>{const t=e.replace(/~1/g,"/").replace(/~0/g,"~");try{return decodeURIComponent(t)}catch{return t}};class P extends _{constructor(){super(...arguments),i()(this,"getModelName",(e=>-1!==l()(e).call(e,"#/definitions/")?C(e.replace(/^.*#\/definitions\//,"")):-1!==l()(e).call(e,"#/components/schemas/")?C(e.replace(/^.*#\/components\/schemas\//,"")):void 0)),i()(this,"getRefSchema",(e=>{let{specSelectors:t}=this.props;return t.findDefinition(e)}))}render(){let{getComponent:e,getConfigs:t,specSelectors:r,schema:s,required:i,name:a,isRef:l,specPath:c,displayName:u,includeReadOnly:h,includeWriteOnly:f}=this.props;const d=e("ObjectModel"),m=e("ArrayModel"),g=e("PrimitiveModel");let y="object",v=s&&s.get("$$ref");if(!a&&v&&(a=this.getModelName(v)),!s&&v&&(s=this.getRefSchema(a)),!s)return p.createElement("span",{className:"model model-title"},p.createElement("span",{className:"model-title__text"},u||a),p.createElement("img",{src:n(2517),height:"20px",width:"20px"}));const b=r.isOAS3()&&s.get("deprecated");switch(l=void 0!==l?l:!!v,y=s&&s.get("type")||y,y){case"object":return p.createElement(d,o()({className:"object"},this.props,{specPath:c,getConfigs:t,scLine truncated
|
||||||
|
//# sourceMappingURL=swagger-ui-bundle.js.map
|
||||||
@@ -1,131 +0,0 @@
|
|||||||
/*!
|
|
||||||
Copyright (c) 2018 Jed Watson.
|
|
||||||
Licensed under the MIT License (MIT), see
|
|
||||||
http://jedwatson.github.io/classnames
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @description Recursive object extending
|
|
||||||
* @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
|
|
||||||
* @license MIT
|
|
||||||
*
|
|
||||||
* The MIT License (MIT)
|
|
||||||
*
|
|
||||||
* Copyright (c) 2013-2018 Viacheslav Lotsmanov
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The buffer module from node.js, for the browser.
|
|
||||||
*
|
|
||||||
* @author Feross Aboukhadijeh <https://feross.org>
|
|
||||||
* @license MIT
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
||||||
* (c) 2017-2021 Joachim Wester
|
|
||||||
* MIT license
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
||||||
* (c) 2017-2022 Joachim Wester
|
|
||||||
* MIT licensed
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* repeat-string <https://github.com/jonschlinkert/repeat-string>
|
|
||||||
*
|
|
||||||
* Copyright (c) 2014-2015, Jon Schlinkert.
|
|
||||||
* Licensed under the MIT License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */
|
|
||||||
|
|
||||||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
||||||
|
|
||||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
||||||
|
|
||||||
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @license
|
|
||||||
* MIT License
|
|
||||||
*
|
|
||||||
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @license React
|
|
||||||
* react-dom.production.min.js
|
|
||||||
*
|
|
||||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @license React
|
|
||||||
* react.production.min.js
|
|
||||||
*
|
|
||||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @license React
|
|
||||||
* scheduler.production.min.js
|
|
||||||
*
|
|
||||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @license React
|
|
||||||
* use-sync-external-store-with-selector.production.js
|
|
||||||
*
|
|
||||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*/
|
|
||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"swagger-ui-bundle.js","mappings":";CAAA,SAAUA,iCAAiCC,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAyB,gBAAID,IAE7BD,EAAsB,gBAAIC,GAC3B,CATD,CASGK,MAAM,cCRLC,EADAC,gCCCJC,OAAOC,eAAeR,EAAS,aAAc,CAAES,OAAO,IACtDT,EAAQU,UAAYV,EAAQW,wBAA0BX,EAAQY,eAAiBZ,EAAQa,oBAAsBb,EAAQc,oBA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KuI,aAAcD,KAGtBX,GAAUW,IACdX,EAAS3H,KAAKwI,aAAcvD,KAG1B0C,EACF,OAAOc,EAAAA,cAAA,QAAMC,UAAU,qBACfD,EAAAA,cAAA,QAAMC,UAAU,qBAAsBX,GAAe9C,GACrDwD,EAAAA,cAAA,OAAKE,IAALine truncated
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
/*! For license information please see swagger-ui-es-bundle-core.js.LICENSE.txt */
|
/*! For license information please see swagger-ui-es-bundle-core.js.LICENSE.txt */
|
||||||
import*as e from"base64-js";import*as t from"ieee754";import*as r from"to-buffer";import{Component as n,PureComponent as a,createContext as s,createElement as o,default as i,forwardRef as l,useCallback as c,useContext as u,useEffect as p,useLayoutEffect as m,useMemo as d,useRef as h,useState as f}from"react";import{applyMiddleware as g,bindActionCreators as y,compose as S,createStore as v}from"redux";import*as b from"immutable";import{serializeError as w}from"serialize-error";import{default as _}from"lodash/merge";import"lodash/camelCase";import"lodash/upperFirst";import{default as C}from"lodash/memoize";import{default as x}from"lodash/find";import{default as O}from"lodash/some";import{default as N}from"lodash/eq";import{default as A}from"lodash/isFunction";import{default as k}from"css.escape";import{default as I}from"url-parse";import{createSelector as j}from"reselect";import{default as T}from"prop-types";import{default as R}from"lodash/omit";import{JSON_SCHEMA as M,default as P}from"js-yaml";import{default as B}from"zenscroll";import{default as L}from"react-immutable-proptypes";import{default as q}from"lodash/reduce";import{default as U}from"lodash/get";import{default as D}from"@babel/runtime-corejs3/helpers/extends";import{default as J}from"classnames";import{CopyToClipboard as $}from"react-copy-to-clipboard";import{default as V}from"react-immutable-pure-component";import{useVirtualizer as F,useWindowVirtualizer as z}from"@tanstack/react-virtual";import{default as K}from"react-debounce-input";import{default as W}from"lodash/isPlainObject";import{default as H}from"randexp";import{default as G}from"lodash/isEmpty";import{default as X}from"lodash/constant";import{default as Y}from"lodash/isString";import{default as Q}from"lodash/debounce";import{default as Z}from"lodash/set";import{default as ee}from"lodash/fp/assocPath";import{default as te}from"swagger-client/es/resolver/strategies/generic";import{default as re}from"swagger-client/es/resolver/strategies/openapi-2";import{default as ne}from"swagger-client/es/resolver/strategies/openapi-3-0";import{default as ae}from"swagger-client/es/resolver/strategies/openapi-3-1-apidom";import{default as se}from"swagger-client/es/resolver/strategies/openapi-3-2-apidom";import{makeResolve as oe}from"swagger-client/es/resolver";import{buildRequest as ie,execute as le}from"swagger-client/es/execute";import{default as ce,makeHttp as ue,serializeRes as pe}from"swagger-client/es/http";import{makeResolveSubtree as me}from"swagger-client/es/subtree-resolver";import{opId as de}from"swagger-client/es/helpers";import{default as he}from"react-dom";import{Provider as fe,connect as ge}from"react-redux";import{default as ye}from"lodash/identity";import{default as Se}from"react-syntax-highlighter/dist/esm/light";import{default as Ee}from"react-syntax-highlighter/dist/esm/languages/hljs/javascript";import{default as ve}from"react-syntax-highlighter/dist/esm/languages/hljs/json";import{default as be}from"react-syntax-highlighter/dist/esm/languages/hljs/xml";import{default as we}from"react-syntax-highlighter/dist/esm/languages/hljs/bash";import{default as _e}from"react-syntax-highlighter/dist/esm/languages/hljs/yaml";import{default as Ce}from"react-syntax-highlighter/dist/esm/languages/hljs/http";import{default as xe}from"react-syntax-highlighter/dist/esm/languages/hljs/powershell";import{default as Oe}from"react-syntax-highlighter/dist/esm/styles/hljs/agate";import{default as Ne}from"react-syntax-highlighter/dist/esm/styles/hljs/arta";import{default as Ae}from"react-syntax-highlighter/dist/esm/styles/hljs/monokai";import{default as ke}from"react-syntax-highlighter/dist/esm/styles/hljs/nord";import{default as Ie}from"react-syntax-highlighter/dist/esm/styles/hljs/obsidian";import{default as je}from"react-syntax-highlighter/dist/esm/styles/hljs/tomorrow-night";import{default as Te}from"react-syntax-highlighter/dist/esm/styles/hljs/idea";import{default as Re}from"js-file-download";import{default as Me}from"lodash/zipObject";import{default as Pe}from"lodash/toString";import{default as Be}from"xml-but-prettier";import{default as Le}from"lodash/toLower";import{Remarkable as qe}from"remarkable";import{linkify as Ue}from"remarkable/linkify";import{default as De}from"dompurify";import{default as Je}from"lodash/escapeRegExp";import{default as $e}from"lodash/has";import{default as Ve}from"lodash/fp/set";var Fe={287:function(e,t,r){const n=r(987),a=r(362),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=Buffer,t.SlowBuffer=function SlowBuffer(e){+e!=e&&(e=0);return Buffer.alloc(+e)},t.INSPECT_MAX_BYTES=50;const o=2147483647;function createBuffer(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,Buffer.prototype),t}function Buffer(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. ReLine truncated
|
import*as e from"react-immutable-pure-component";import*as t from"remarkable/linkify";import*as a from"dompurify";import*as n from"zenscroll";import*as r from"lodash/reduce";import*as s from"@babel/runtime-corejs3/core-js-stable/string/raw";import*as o from"@babel/runtime-corejs3/core-js-stable/number/epsilon";import*as l from"@babel/runtime-corejs3/core-js-stable/instance/repeat";import*as i from"@babel/runtime-corejs3/core-js-stable/instance/fill";import*as c from"lodash/zipObject";import*as u from"@babel/runtime-corejs3/core-js-stable/promise";import*as d from"@babel/runtime-corejs3/core-js-stable/date/now";import*as p from"lodash/isString";import*as m from"lodash/debounce";import*as f from"lodash/set";import*as h from"lodash/fp/assocPath";import*as g from"swagger-client/es/resolver/strategies/generic";import*as y from"swagger-client/es/resolver/strategies/openapi-2";import*as v from"swagger-client/es/resolver/strategies/openapi-3-0";import*as E from"swagger-client/es/resolver/strategies/openapi-3-1-apidom";import*as S from"swagger-client/es/resolver";import*as w from"swagger-client/es/execute";import*as b from"swagger-client/es/http";import*as x from"swagger-client/es/subtree-resolver";import*as _ from"react-dom";import*as C from"react-redux";import*as j from"lodash/omit";import*as O from"react-syntax-highlighter/dist/esm/light";import*as N from"react-syntax-highlighter/dist/esm/languages/hljs/javascript";import*as k from"react-syntax-highlighter/dist/esm/languages/hljs/json";import*as A from"react-syntax-highlighter/dist/esm/languages/hljs/xml";import*as I from"react-syntax-highlighter/dist/esm/languages/hljs/bash";import*as R from"react-syntax-highlighter/dist/esm/languages/hljs/yaml";import*as P from"react-syntax-highlighter/dist/esm/languages/hljs/http";import*as T from"react-syntax-highlighter/dist/esm/languages/hljs/powershell";import*as M from"react-syntax-highlighter/dist/esm/styles/hljs/agate";import*as D from"react-syntax-highlighter/dist/esm/styles/hljs/arta";import*as L from"react-syntax-highlighter/dist/esm/styles/hljs/monokai";import*as q from"react-syntax-highlighter/dist/esm/styles/hljs/nord";import*as B from"react-syntax-highlighter/dist/esm/styles/hljs/obsidian";import*as U from"react-syntax-highlighter/dist/esm/styles/hljs/tomorrow-night";import*as J from"@babel/runtime-corejs3/core-js-stable/instance/starts-with";import*as $ from"@braintree/sanitize-url";import*as K from"lodash/camelCase";import*as V from"lodash/upperFirst";import*as F from"lodash/find";import*as z from"lodash/eq";import*as W from"css.escape";import*as H from"@babel/runtime-corejs3/core-js-stable/instance/find-index";import*as G from"@babel/runtime-corejs3/core-js-stable/array/from";import*as Z from"@babel/runtime-corejs3/core-js-stable/array/is-array";import*as Y from"@babel/runtime-corejs3/core-js-stable/instance/bind";import*as X from"@babel/runtime-corejs3/core-js-stable/instance/concat";import*as Q from"@babel/runtime-corejs3/core-js-stable/instance/entries";import*as ee from"@babel/runtime-corejs3/core-js-stable/instance/every";import*as te from"@babel/runtime-corejs3/core-js-stable/instance/filter";import*as ae from"@babel/runtime-corejs3/core-js-stable/instance/find";import*as ne from"@babel/runtime-corejs3/core-js-stable/instance/for-each";import*as re from"@babel/runtime-corejs3/core-js-stable/instance/includes";import*as se from"@babel/runtime-corejs3/core-js-stable/instance/index-of";import*as oe from"@babel/runtime-corejs3/core-js-stable/instance/keys";import*as le from"@babel/runtime-corejs3/core-js-stable/instance/map";import*as ie from"@babel/runtime-corejs3/core-js-stable/instance/reduce";import*as ce from"@babel/runtime-corejs3/core-js-stable/instance/slice";import*as ue from"@babel/runtime-corejs3/core-js-stable/instance/some";import*as de from"@babel/runtime-corejs3/core-js-stable/instance/sort";import*as pe from"@babel/runtime-corejs3/core-js-stable/instance/trim";import*as me from"@babel/runtime-corejs3/core-js-stable/json/stringify";import*as fe from"@babel/runtime-corejs3/core-js-stable/map";import*as he from"@babel/runtime-corejs3/core-js-stable/number/is-integer";import*as ge from"@babel/runtime-corejs3/core-js-stable/object/assign";import*as ye from"@babel/runtime-corejs3/core-js-stable/object/entries";import*as ve from"@babel/runtime-corejs3/core-js-stable/object/from-entries";import*as Ee from"@babel/runtime-corejs3/core-js-stable/object/keys";import*as Se from"@babel/runtime-corejs3/core-js-stable/object/values";import*as we from"@babel/runtime-corejs3/core-js-stable/set";import*as be from"@babel/runtime-corejs3/core-js-stable/set-timeout";import*as xe from"@babel/runtime-corejs3/core-js-stable/url";import*as _e from"@babel/runtime-corejs3/core-js-stable/weak-map";import*as Ce from"@babel/runtime-corejs3/core-js-stable/weak-set";import*as je from"@babel/runtime-corejs3/helpers/classPrivateFieldGet";import*as Oe from"@babel/runtime-corejs3/helpers/defineProperty";import*as Ne from"@babelLine truncated
|
||||||
//# sourceMappingURL=swagger-ui-es-bundle-core.js.map
|
//# sourceMappingURL=swagger-ui-es-bundle-core.js.map
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @description Recursive object extending
|
|
||||||
* @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
|
|
||||||
* @license MIT
|
|
||||||
*
|
|
||||||
* The MIT License (MIT)
|
|
||||||
*
|
|
||||||
* Copyright (c) 2013-2018 Viacheslav Lotsmanov
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The buffer module from node.js, for the browser.
|
|
||||||
*
|
|
||||||
* @author Feross Aboukhadijeh <https://feross.org>
|
|
||||||
* @license MIT
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"swagger-ui-es-bundle-core.js","mappings":";q0IAUA,MAAMA,EAAS,EAAQ,KACjBC,EAAU,EAAQ,KAClBC,EACe,mBAAXC,QAAkD,mBAAlBA,OAAY,IAChDA,OAAY,IAAE,8BACd,KAENC,EAAQC,OAASA,OACjBD,EAAQE,WAyTR,SAASA,WAAYC,IACdA,GAAUA,IACbA,EAAS,GAEX,OAAOF,OAAOG,OAAOD,EACvB,EA7TAH,EAAQK,kBAAoB,GAE5B,MAAMC,EAAe,WAwDrB,SAASC,aAAcJ,GACrB,GAAIA,EAASG,EACX,MAAM,IAAIE,WAAW,cAAgBL,EAAS,kCAGhD,MAAMM,EAAM,IAAIC,WAAWP,GAE3B,OADAQ,OAAOC,eAAeH,EAAK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b,EAAUW,2BAA4B,GAGjCP,EAAAA,QAAAA,SAAmBI,EAAK,CAC7BM,SAAU,CAAC,UACXC,YAAa,CLine truncated
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
/*! For license information please see swagger-ui-es-bundle.js.LICENSE.txt */
|
/*! For license information please see swagger-ui-es-bundle.js.LICENSE.txt */
|
||||||
(()=>{var s={67526(s,o){"use strict";o.byteLength=function byteLength(s){var o=getLens(s),i=o[0],a=o[1];return 3*(i+a)/4-a},o.toByteArray=function toByteArray(s){var o,i,_=getLens(s),w=_[0],x=_[1],C=new u(function _byteLength(s,o,i){return 3*(o+i)/4-i}(0,w,x)),j=0,L=x>0?w-4:w;for(i=0;i<L;i+=4)o=a[s.charCodeAt(i)]<<18|a[s.charCodeAt(i+1)]<<12|a[s.charCodeAt(i+2)]<<6|a[s.charCodeAt(i+3)],C[j++]=o>>16&255,C[j++]=o>>8&255,C[j++]=255&o;2===x&&(o=a[s.charCodeAt(i)]<<2|a[s.charCodeAt(i+1)]>>4,C[j++]=255&o);1===x&&(o=a[s.charCodeAt(i)]<<10|a[s.charCodeAt(i+1)]<<4|a[s.charCodeAt(i+2)]>>2,C[j++]=o>>8&255,C[j++]=255&o);return C},o.fromByteArray=function fromByteArray(s){for(var o,a=s.length,u=a%3,_=[],w=16383,x=0,C=a-u;x<C;x+=w)_.push(encodeChunk(s,x,x+w>C?C:x+w));1===u?(o=s[a-1],_.push(i[o>>2]+i[o<<4&63]+"==")):2===u&&(o=(s[a-2]<<8)+s[a-1],_.push(i[o>>10]+i[o>>4&63]+i[o<<2&63]+"="));return _.join("")};for(var i=[],a=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w=0;w<64;++w)i[w]=_[w],a[_.charCodeAt(w)]=w;function getLens(s){var o=s.length;if(o%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=s.indexOf("=");return-1===i&&(i=o),[i,i===o?0:4-i%4]}function encodeChunk(s,o,a){for(var u,_,w=[],x=o;x<a;x+=3)u=(s[x]<<16&16711680)+(s[x+1]<<8&65280)+(255&s[x+2]),w.push(i[(_=u)>>18&63]+i[_>>12&63]+i[_>>6&63]+i[63&_]);return w.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},48287(s,o,i){"use strict";const a=i(67526),u=i(251),_="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;o.Buffer=Buffer,o.SlowBuffer=function SlowBuffer(s){+s!=s&&(s=0);return Buffer.alloc(+s)},o.INSPECT_MAX_BYTES=50;const w=2147483647;function createBuffer(s){if(s>w)throw new RangeError('The value "'+s+'" is invalid for option "size"');const o=new Uint8Array(s);return Object.setPrototypeOf(o,Buffer.prototype),o}function Buffer(s,o,i){if("number"==typeof s){if("string"==typeof o)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(s)}return from(s,o,i)}function from(s,o,i){if("string"==typeof s)return function fromString(s,o){"string"==typeof o&&""!==o||(o="utf8");if(!Buffer.isEncoding(o))throw new TypeError("Unknown encoding: "+o);const i=0|byteLength(s,o);let a=createBuffer(i);const u=a.write(s,o);u!==i&&(a=a.slice(0,u));return a}(s,o);if(ArrayBuffer.isView(s))return function fromArrayView(s){if(isInstance(s,Uint8Array)){const o=new Uint8Array(s);return fromArrayBuffer(o.buffer,o.byteOffset,o.byteLength)}return fromArrayLike(s)}(s);if(null==s)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof s);if(isInstance(s,ArrayBuffer)||s&&isInstance(s.buffer,ArrayBuffer))return fromArrayBuffer(s,o,i);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(s,SharedArrayBuffer)||s&&isInstance(s.buffer,SharedArrayBuffer)))return fromArrayBuffer(s,o,i);if("number"==typeof s)throw new TypeError('The "value" argument must not be of type number. Received type number');const a=s.valueOf&&s.valueOf();if(null!=a&&a!==s)return Buffer.from(a,o,i);const u=function fromObject(s){if(Buffer.isBuffer(s)){const o=0|checked(s.length),i=createBuffer(o);return 0===i.length||s.copy(i,0,0,o),i}if(void 0!==s.length)return"number"!=typeof s.length||numberIsNaN(s.length)?createBuffer(0):fromArrayLike(s);if("Buffer"===s.type&&Array.isArray(s.data))return fromArrayLike(s.data)}(s);if(u)return u;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof s[Symbol.toPrimitive])return Buffer.from(s[Symbol.toPrimitive]("string"),o,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof s)}function assertSize(s){if("number"!=typeof s)throw new TypeError('"size" argument must be of type number');if(s<0)throw new RangeError('The value "'+s+'" is invalid for option "size"')}function allocUnsafe(s){return assertSize(s),createBuffer(s<0?0:0|checked(s))}function fromArrayLike(s){const o=s.length<0?0:0|checked(s.length),i=createBuffer(o);for(let a=0;a<o;a+=1)i[a]=255&s[a];return i}function fromArrayBuffer(s,o,i){if(o<0||s.byteLength<o)throw new RangeError('"offset" is outside of buffer bounds');if(s.byteLength<o+(i||0))throw new RangeError('"length" is outside of buffer bounds');let a;return a=void 0===o&&void 0===i?new Uint8Array(s):void 0===i?new Uint8Array(s,o):new Uint8Array(s,o,i),Object.setPrototypeOf(a,Buffer.prototype),a}function checked(s){if(s>=w)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w.toString(16)+" bytes");return 0|s}function byteLength(s,o){if(Buffer.isBuffer(s))return s.length;if(ArrayBuffer.isView(s)||isInstance(s,ArrayBuffer))return s.byteLength;if("string"!=typeof s)throw new TypeError('The "string" argument must be one of type string, Buffer,Line truncated
|
(()=>{var e={17967:(e,t)=>{"use strict";t.N=void 0;var n=/^([^\w]*)(javascript|data|vbscript)/im,r=/&#(\w+)(^\w|;)?/g,o=/&(newline|tab);/gi,s=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,i=/^.+(:|:)/gim,a=[".","/"];t.N=function(e){var t,l=(t=e||"",t.replace(r,(function(e,t){return String.fromCharCode(t)}))).replace(o,"").replace(s,"").trim();if(!l)return"about:blank";if(function(e){return a.indexOf(e[0])>-1}(l))return l;var c=l.match(i);if(!c)return l;var u=c[0];return n.test(u)?"about:blank":l}},53795:(e,t,n)=>{"use strict";n.d(t,{Z:()=>P});var r=n(23101),o=n.n(r),s=n(61125),i=n.n(s),a=n(11882),l=n.n(a),c=n(97606),u=n.n(c),p=n(67294),h=n(43393);function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){return y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},y(e)}function v(e,t){return v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},v(e,t)}function b(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}var w={};function E(e,t,n){return function(e){return null==e}(e)?n:function(e){return null!==e&&"object"===f(e)&&"function"==typeof e.get&&"function"==typeof e.has}(e)?e.has(t)?e.get(t):n:hasOwnProperty.call(e,t)?e[t]:n}function x(e,t,n){for(var r=0;r!==t.length;)if((e=E(e,t[r++],w))===w)return n;return e}function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=function(e,t){return function(n){if("string"==typeof n)return(0,h.is)(t[n],e[n]);if(Array.isArray(n))return(0,h.is)(x(t,n),x(e,n));throw new TypeError("Invalid key: expected Array or string: "+n)}}(t,n),o=e||Object.keys(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(n,!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n,{},t));return o.every(r)}const _=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),b(this,y(t).apply(this,arguments))}var n,r,o;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(t,e),n=t,r=[{key:"shouldComponentUpdate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!S(this.updateOnProps,this.props,e,"updateOnProps")||!S(this.updateOnStates,this.state,t,"updateOnStates")}}],r&&d(n.prototype,r),o&&d(n,o),t}(p.Component);var j=n(23930),O=n.n(j),k=n(45697),A=n.n(k);const C=e=>{const t=e.replace(/~1/g,"/").replace(/~0/g,"~");try{return decodeURIComponent(t)}catch{return t}};class P extends _{constructor(){super(...arguments),i()(this,"getModelName",(e=>-1!==l()(e).call(e,"#/definitions/")?C(e.replace(/^.*#\/definitions\//,"")):-1!==l()(e).call(e,"#/components/schemas/")?C(e.replace(/^.*#\/components\/schemas\//,"")):void 0)),i()(this,"getRefSchema",(e=>{let{specSelectors:t}=this.props;return t.findDefinition(e)}))}render(){let{getComponent:e,getConfigs:t,specSelectors:r,schema:s,required:i,name:a,isRef:l,specPath:c,displayName:u,includeReadOnly:h,includeWriteOnly:f}=this.props;const d=e("ObjectModel"),m=e("ArrayModel"),g=e("PrimitiveModel");let y="object",v=s&&s.get("$$ref");if(!a&&v&&(a=this.getModelName(v)),!s&&v&&(s=this.getRefSchema(a)),!s)return p.createElement("span",{className:"model model-title"},p.createElement("span",{className:"model-title__text"},u||a),p.createElement("img",{src:n(2517),height:"20px",width:"20px"}));const b=r.isOAS3()&&s.get("deprecated");switch(l=void 0!==l?l:!!v,y=s&&s.get("type")||y,y){case"object":return p.createElement(d,o()({className:"object"},this.props,{specPath:c,getConfigs:t,schema:s,name:a,deprecated:b,isRef:l,includeReadOnly:h,includeWriteOnly:f}));case"array":return p.createElement(m,o()({className:"array"},this.props,{getConfigs:t,schema:s,name:a,deprecated:b,required:i,includeReadOnly:h,inLine truncated
|
||||||
|
//# sourceMappingURL=swagger-ui-es-bundle.js.map
|
||||||
@@ -1,131 +0,0 @@
|
|||||||
/*!
|
|
||||||
Copyright (c) 2018 Jed Watson.
|
|
||||||
Licensed under the MIT License (MIT), see
|
|
||||||
http://jedwatson.github.io/classnames
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* @description Recursive object extending
|
|
||||||
* @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
|
|
||||||
* @license MIT
|
|
||||||
*
|
|
||||||
* The MIT License (MIT)
|
|
||||||
*
|
|
||||||
* Copyright (c) 2013-2018 Viacheslav Lotsmanov
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
||||||
* this software and associated documentation files (the "Software"), to deal in
|
|
||||||
* the Software without restriction, including without limitation the rights to
|
|
||||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
||||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
* subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
||||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
||||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
||||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
||||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* The buffer module from node.js, for the browser.
|
|
||||||
*
|
|
||||||
* @author Feross Aboukhadijeh <https://feross.org>
|
|
||||||
* @license MIT
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
||||||
* (c) 2017-2021 Joachim Wester
|
|
||||||
* MIT license
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
||||||
* (c) 2017-2022 Joachim Wester
|
|
||||||
* MIT licensed
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
|
||||||
* repeat-string <https://github.com/jonschlinkert/repeat-string>
|
|
||||||
*
|
|
||||||
* Copyright (c) 2014-2015, Jon Schlinkert.
|
|
||||||
* Licensed under the MIT License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE */
|
|
||||||
|
|
||||||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
||||||
|
|
||||||
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|
|
||||||
|
|
||||||
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @license
|
|
||||||
* MIT License
|
|
||||||
*
|
|
||||||
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @license React
|
|
||||||
* react-dom.production.min.js
|
|
||||||
*
|
|
||||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @license React
|
|
||||||
* react.production.min.js
|
|
||||||
*
|
|
||||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @license React
|
|
||||||
* scheduler.production.min.js
|
|
||||||
*
|
|
||||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @license React
|
|
||||||
* use-sync-external-store-with-selector.production.js
|
|
||||||
*
|
|
||||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*/
|
|
||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"swagger-ui-es-bundle.js","mappings":";UACIA,EADAC,gCCCJC,OAAOC,eAAeC,EAAS,aAAc,CAAEC,OAAO,IACtDD,EAAQE,UAAYF,EAAQG,wBAA0BH,EAAQI,eAAiBJ,EAAQK,oBAAsBL,EAAQM,oBAAsBN,EAAQO,kBAAoBP,EAAQQ,0BAAuB,EACtMR,EAAQQ,qBAAuB,wCAC/BR,EAAQO,kBAAoB,mBAC5BP,EAAQM,oBAAsB,oBAC9BN,EAAQK,oBAAsB,qDAC9BL,EAAQI,eAAiB,oBACzBJ,EAAQG,wBAA0B,CAAC,IAAK,KACxCH,EAAQE,UAAY,4CCPpBF,EAAQ,OAAc,EACtB,IAAIS,EAAc,EAAQ,OA4C1BT,EAAQ,EAjCR,SAASU,YAAYC,GACjB,IAAKA,EACD,OAAOF,EAAYP,UAEvB,IAAIU,EAVsBC,EAWtBC,EAAaH,EACjB,GAKIC,GAJAE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OILine truncated
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
/*! For license information please see swagger-ui-standalone-preset.js.LICENSE.txt */
|
/*! For license information please see swagger-ui-standalone-preset.js.LICENSE.txt */
|
||||||
!function webpackUniversalModuleDefinition(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SwaggerUIStandalonePreset=e():t.SwaggerUIStandalonePreset=e()}(this,(()=>(()=>{var t={7526(t,e){"use strict";e.byteLength=function byteLength(t){var e=getLens(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function toByteArray(t){var e,r,i=getLens(t),a=i[0],s=i[1],u=new o(function _byteLength(t,e,r){return 3*(e+r)/4-r}(0,a,s)),c=0,l=s>0?a-4:a;for(r=0;r<l;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],u[c++]=e>>16&255,u[c++]=e>>8&255,u[c++]=255&e;2===s&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[c++]=255&e);1===s&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[c++]=e>>8&255,u[c++]=255&e);return u},e.fromByteArray=function fromByteArray(t){for(var e,n=t.length,o=n%3,i=[],a=16383,s=0,u=n-o;s<u;s+=a)i.push(encodeChunk(t,s,s+a>u?u:s+a));1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function getLens(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function encodeChunk(t,e,n){for(var o,i,a=[],s=e;s<n;s+=3)o=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8287(t,e,r){"use strict";const n=r(7526),o=r(251),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=Buffer,e.SlowBuffer=function SlowBuffer(t){+t!=t&&(t=0);return Buffer.alloc(+t)},e.INSPECT_MAX_BYTES=50;const a=2147483647;function createBuffer(t){if(t>a)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,Buffer.prototype),e}function Buffer(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return allocUnsafe(t)}return from(t,e,r)}function from(t,e,r){if("string"==typeof t)return function fromString(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!Buffer.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|byteLength(t,e);let n=createBuffer(r);const o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return function fromArrayView(t){if(isInstance(t,Uint8Array)){const e=new Uint8Array(t);return fromArrayBuffer(e.buffer,e.byteOffset,e.byteLength)}return fromArrayLike(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(isInstance(t,ArrayBuffer)||t&&isInstance(t.buffer,ArrayBuffer))return fromArrayBuffer(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(isInstance(t,SharedArrayBuffer)||t&&isInstance(t.buffer,SharedArrayBuffer)))return fromArrayBuffer(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return Buffer.from(n,e,r);const o=function fromObject(t){if(Buffer.isBuffer(t)){const e=0|checked(t.length),r=createBuffer(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||numberIsNaN(t.length)?createBuffer(0):fromArrayLike(t);if("Buffer"===t.type&&Array.isArray(t.data))return fromArrayLike(t.data)}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return Buffer.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function assertSize(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function allocUnsafe(t){return assertSize(t),createBuffer(t<0?0:0|checked(t))}function fromArrayLike(t){const e=t.length<0?0:0|checked(t.length),r=createBuffer(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function fromArrayBuffer(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,Buffer.prototype),n}function checked(t){if(t>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Line truncated
|
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SwaggerUIStandalonePreset=e():t.SwaggerUIStandalonePreset=e()}(this,(()=>(()=>{var t={7967:(t,e)=>{"use strict";var r=/^([^\w]*)(javascript|data|vbscript)/im,n=/&#(\w+)(^\w|;)?/g,i=/&(newline|tab);/gi,o=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,u=/^.+(:|:)/gim,s=[".","/"]},9742:(t,e)=>{"use strict";e.byteLength=function(t){var e=s(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=s(t),u=o[0],a=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,u,a)),f=0,l=a>0?u-4:u;for(r=0;r<l;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],c[f++]=e>>16&255,c[f++]=e>>8&255,c[f++]=255&e;2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[f++]=255&e);1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[f++]=e>>8&255,c[f++]=255&e);return c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],u=16383,s=0,c=n-i;s<c;s+=u)o.push(a(t,s,s+u>c?c:s+u));1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0;u<64;++u)r[u]=o[u],n[o.charCodeAt(u)]=u;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function a(t,e,n){for(var i,o,u=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),u.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return u.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(t,e,r)=>{"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},e.INSPECT_MAX_BYTES=50;const u=2147483647;function s(t){if(t>u)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,a.prototype),e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|M(t,e);let n=s(r);const i=n.write(t,e);i!==r&&(n=n.slice(0,i));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if($(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return h(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if($(t,ArrayBuffer)||t&&$(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&($(t,SharedArrayBuffer)||t&&$(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return a.from(n,e,r);const i=function(t){if(a.isBuffer(t)){const e=0|y(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||X(t.length)?s(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return f(t),s(t<0?0:0|y(t))}function h(t){const e=t.length<0?0:0|y(t.length),r=s(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function p(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,a.prototype),n}function y(t){if(t>=u)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u.toString(16)+" bytes");return 0|t}function M(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||$(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.leLine truncated
|
||||||
|
//# sourceMappingURL=swagger-ui-standalone-preset.js.map
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
/*!
|
|
||||||
* The buffer module from node.js, for the browser.
|
|
||||||
*
|
|
||||||
* @author Feross Aboukhadijeh <https://feross.org>
|
|
||||||
* @license MIT
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
||||||
|
|
||||||
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @license
|
|
||||||
* MIT License
|
|
||||||
*
|
|
||||||
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @license React
|
|
||||||
* react.production.min.js
|
|
||||||
*
|
|
||||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the MIT license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree.
|
|
||||||
*/
|
|
||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"swagger-ui-standalone-preset.js","mappings":";CAAA,SAAUA,iCAAiCC,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,GAAIH,GACe,iBAAZC,QACdA,QAAmC,0BAAID,IAEvCD,EAAgC,0BAAIC,GACrC,CATD,CASGK,MAAM,2CCRTC,OAAOC,eAAeN,EAAS,aAAc,CAAEO,OAAO,IACtDP,EAAQQ,UAAYR,EAAQS,wBAA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,SAAShB,EAAeiB,GACtB,MAAMvE,EAASuE,EAAMvE,OAAS,EAAI,EAA4B,EAAxB6D,EAAQU,EAAMvE,QAC9C6B,EAAMF,EAAa3B,GACzB,IAAK,IAAIV,EAAI,EAAGA,EAAIU,EAAQV,GAAK,EAC/BuC,EAAIvC,GAAgB,IAAXiF,EAAMLine truncated
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
.swagger-ui{color:#3b4151;container-name:swagger-ui;container-type:inline-size;/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */font-family:sans-serif}.swagger-ui html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}.swagger-ui body{margin:0}.swagger-ui article,.swagger-ui aside,.swagger-ui footer,.swagger-ui header,.swagger-ui nav,.swagger-ui section{display:block}.swagger-ui h1{font-size:2em;margin:.67em 0}.swagger-ui figcaption,.swagger-ui figure,.swagger-ui main{display:block}.swagger-ui figure{margin:1em 40px}.swagger-ui hr{box-sizing:content-box;height:0;overflow:visible}.swagger-ui pre{font-family:monospace,monospace;font-size:1em}.swagger-ui a{background-color:transparent;-webkit-text-decoration-skip:objects}.swagger-ui abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.swagger-ui b,.swagger-ui strong{font-weight:inherit;font-weight:bolder}.swagger-ui code,.swagger-ui kbd,.swagger-ui samp{font-family:monospace,monospace;font-size:1em}.swagger-ui dfn{font-style:italic}.swagger-ui mark{background-color:#ff0;color:#000}.swagger-ui small{font-size:80%}.swagger-ui sub,.swagger-ui sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.swagger-ui sub{bottom:-.25em}.swagger-ui sup{top:-.5em}.swagger-ui audio,.swagger-ui video{display:inline-block}.swagger-ui audio:not([controls]){display:none;height:0}.swagger-ui img{border-style:none}.swagger-ui svg:not(:root){overflow:hidden}.swagger-ui button,.swagger-ui input,.swagger-ui optgroup,.swagger-ui select,.swagger-ui textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}.swagger-ui button,.swagger-ui input{overflow:visible}.swagger-ui button,.swagger-ui select{text-transform:none}.swagger-ui [type=reset],.swagger-ui [type=submit],.swagger-ui button,.swagger-ui html [type=button]{-webkit-appearance:button}.swagger-ui [type=button]::-moz-focus-inner,.swagger-ui [type=reset]::-moz-focus-inner,.swagger-ui [type=submit]::-moz-focus-inner,.swagger-ui button::-moz-focus-inner{border-style:none;padding:0}.swagger-ui [type=button]:-moz-focusring,.swagger-ui [type=reset]:-moz-focusring,.swagger-ui [type=submit]:-moz-focusring,.swagger-ui button:-moz-focusring{outline:1px dotted ButtonText}.swagger-ui fieldset{padding:.35em .75em .625em}.swagger-ui legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}.swagger-ui progress{display:inline-block;vertical-align:baseline}.swagger-ui textarea{overflow:auto}.swagger-ui [type=checkbox],.swagger-ui [type=radio]{box-sizing:border-box;padding:0}.swagger-ui [type=number]::-webkit-inner-spin-button,.swagger-ui [type=number]::-webkit-outer-spin-button{height:auto}.swagger-ui [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.swagger-ui [type=search]::-webkit-search-cancel-button,.swagger-ui [type=search]::-webkit-search-decoration{-webkit-appearance:none}.swagger-ui ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.swagger-ui details,.swagger-ui menu{display:block}.swagger-ui summary{display:list-item}.swagger-ui canvas{display:inline-block}.swagger-ui [hidden],.swagger-ui template{display:none}.swagger-ui .debug *{outline:1px solid gold}.swagger-ui .debug-white *{outline:1px solid #fff}.swagger-ui .debug-black *{outline:1px solid #000}.swagger-ui .debug-grid{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzV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cGXiYEAGBIKGBne//fFpwAgwAB98AaF2pjlUQAAAABJRU5ErkJggg==) repeat 0 0}.swagger-ui .debug-grid-16{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpLine truncated
|
.swagger-ui{color:#3b4151;font-family:sans-serif/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */}.swagger-ui html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;line-height:1.15}.swagger-ui body{margin:0}.swagger-ui article,.swagger-ui aside,.swagger-ui footer,.swagger-ui header,.swagger-ui nav,.swagger-ui section{display:block}.swagger-ui h1{font-size:2em;margin:.67em 0}.swagger-ui figcaption,.swagger-ui figure,.swagger-ui main{display:block}.swagger-ui figure{margin:1em 40px}.swagger-ui hr{box-sizing:content-box;height:0;overflow:visible}.swagger-ui pre{font-family:monospace,monospace;font-size:1em}.swagger-ui a{-webkit-text-decoration-skip:objects;background-color:transparent}.swagger-ui abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.swagger-ui b,.swagger-ui strong{font-weight:inherit;font-weight:bolder}.swagger-ui code,.swagger-ui kbd,.swagger-ui samp{font-family:monospace,monospace;font-size:1em}.swagger-ui dfn{font-style:italic}.swagger-ui mark{background-color:#ff0;color:#000}.swagger-ui small{font-size:80%}.swagger-ui sub,.swagger-ui sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}.swagger-ui sub{bottom:-.25em}.swagger-ui sup{top:-.5em}.swagger-ui audio,.swagger-ui video{display:inline-block}.swagger-ui audio:not([controls]){display:none;height:0}.swagger-ui img{border-style:none}.swagger-ui svg:not(:root){overflow:hidden}.swagger-ui button,.swagger-ui input,.swagger-ui optgroup,.swagger-ui select,.swagger-ui textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}.swagger-ui button,.swagger-ui input{overflow:visible}.swagger-ui button,.swagger-ui select{text-transform:none}.swagger-ui [type=reset],.swagger-ui [type=submit],.swagger-ui button,.swagger-ui html [type=button]{-webkit-appearance:button}.swagger-ui [type=button]::-moz-focus-inner,.swagger-ui [type=reset]::-moz-focus-inner,.swagger-ui [type=submit]::-moz-focus-inner,.swagger-ui button::-moz-focus-inner{border-style:none;padding:0}.swagger-ui [type=button]:-moz-focusring,.swagger-ui [type=reset]:-moz-focusring,.swagger-ui [type=submit]:-moz-focusring,.swagger-ui button:-moz-focusring{outline:1px dotted ButtonText}.swagger-ui fieldset{padding:.35em .75em .625em}.swagger-ui legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}.swagger-ui progress{display:inline-block;vertical-align:baseline}.swagger-ui textarea{overflow:auto}.swagger-ui [type=checkbox],.swagger-ui [type=radio]{box-sizing:border-box;padding:0}.swagger-ui [type=number]::-webkit-inner-spin-button,.swagger-ui [type=number]::-webkit-outer-spin-button{height:auto}.swagger-ui [type=search]{-webkit-appearance:textfield;outline-offset:-2px}.swagger-ui [type=search]::-webkit-search-cancel-button,.swagger-ui [type=search]::-webkit-search-decoration{-webkit-appearance:none}.swagger-ui ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}.swagger-ui details,.swagger-ui menu{display:block}.swagger-ui summary{display:list-item}.swagger-ui canvas{display:inline-block}.swagger-ui [hidden],.swagger-ui template{display:none}.swagger-ui .debug *{outline:1px solid gold}.swagger-ui .debug-white *{outline:1px solid #fff}.swagger-ui .debug-black *{outline:1px solid #000}.swagger-ui .debug-grid{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj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VHjaYvz//z8DLsD4gcGXiYEAGBIKGBne//fFpwAgwAB98AaF2pjlUQAAAABJRU5ErkJggg==) repeat 0 0}.swagger-ui .debug-grid-16{background:transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyhpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+ILine truncated
|
||||||
|
|
||||||
/*# sourceMappingURL=swagger-ui.css.map*/
|
/*# sourceMappingURL=swagger-ui.css.map*/
|
||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"swagger-ui.css","mappings":"AAAA,YCII,aCcU,CFfd,yBACE,2BACA,4EGEF,CFJE,sBEIF,CDWc,iCCCZ,0BACA,8BACA,kBAUF,QACE,iHAOF,aAME,gBAQF,aACE,eACA,4DAWF,aAGE,oBAOF,eACE,gBAQF,sBACE,SACA,iBACA,iBAQF,+BACE,cACA,eAWF,4BACE,qCACA,yBAQF,kBACE,CACA,yBACA,CADA,wCACA,CADA,gCACA,kCAOF,mBAEE,CAOF,kBAPE,CASA,kDAQF,+BAGE,cACA,iBAOF,iBACE,kBAOF,qBACE,WACA,mBAOF,aACE,iCAQF,aAEE,cACA,kBACA,wBACA,iBAGF,aACE,iBAGF,SACE,qCAUF,oBAEE,mCAOF,YACE,SACA,iBAOF,iBACE,4BAOF,eACE,mGAWF,sBAKE,eACA,iBACA,SACA,sCAQF,gBAEE,uCAQF,mBAEE,sGASF,yBAIE,yKAOF,iBAIE,UACA,6JAOF,6BAIE,sBAOF,0BACE,oBAUF,qBACE,cACA,cACA,eACA,UACA,mBACA,sBAQF,oBACE,wBACA,sBAOF,aACE,sDAQF,qBAEE,UACA,2GAOF,WAEE,2BAQF,4BACE,oBACA,8GAOF,uBAEE,0CAQF,yBACE,aACA,sCAWF,aAEE,qBAOF,iBACE,oBAUF,oBACE,CAQA,0CAUF,YACE,sBCnbF,kDACA,kDACA,+CCDA,yEACE,4BAGF,yEACE,iCAGF,kEACE,kCAGF,kEACE,2tBClBF,qBAkCE,2BCrBF,QACE,kBACA,iCAGF,sDACA,sDAEA,kDACA,sDAEA,oDACA,mDAEA,oDACA,mDAEA,qDACA,mDAEA,sDAKI,QACA,CAEA,WACA,CAHA,MACA,CALJ,iBACI,CACA,OACA,CAFA,KACA,CAGA,UACA,CACA,WACA,oCAGJ,6BACI,QACE,kBACA,oCAEF,yDACA,yDACA,qDACA,yDACA,uDACA,sDACA,uDACA,sDACA,wDACA,sDACA,yDAII,QACA,CAEA,WACA,CAHA,MACA,CALJ,iBACI,CACA,OACA,CAFA,KACA,CAGA,UACA,CACA,WACA,yDAIR,4BACI,QACE,kBACA,mCAEF,wDACA,wDACA,oDACA,wDACA,sDACA,qDACA,sDACA,qDACA,uDACA,qDACA,wDAII,QACA,CAEA,WACA,CAHA,MACA,CALJ,iBACI,CACA,OACA,CAFA,KACA,CAGA,UACA,CACA,WACA,qCAIR,4BACI,QACE,kBACA,mCAEF,wDACA,wDACA,oDACA,wDACA,sDACA,qDACA,sDACA,qDACA,uDACA,qDACA,wDAII,QACA,CAEA,WACA,CAHA,MACA,CALJ,iBACI,CACA,OACA,CAFA,KACA,CAGA,UACA,CACA,WACA,kBC3HR,kCCQE,qDACA,qEAEF,sBACE,wDACA,0FAGF,qBACE,uDACA,sEAGF,qBACE,uDACA,0DCVA,uBACA,CAFF,2BAEE,qBAIA,uBACA,CAFF,2BAEE,uBAIA,wBACA,CAFF,2BAEE,wBAIA,0BACA,CAFF,2BAEE,sBAIA,qBACA,CAFF,2BAEE,oCAGF,0BAEI,uBACA,CAFF,2BAEE,wBAIA,uBACA,CAFF,2BAEE,0BAIA,wBACA,CAFF,2BAEE,2BAIA,0BACA,CAFF,2BAEE,yBAIA,qBACA,CAFF,2BAEE,yDAIJ,yBA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BACA,oBCkBF,2BACA,8BACALine truncated
|
{"version":3,"file":"swagger-ui.css","mappings":"AAAA,YCII,aCYU,CDdV,sBEKJ,4EDSc,CCEd,iBAEE,0BACA,8BAFA,gBAEA,CAUF,iBACE,SAOF,gHAME,cAQF,eACE,cACA,eAWF,2DAGE,cAOF,mBACE,gBAQF,eACE,uBACA,SACA,iBAQF,gBACE,gCACA,cAWF,cAEE,qCADA,4BACA,CAQF,wBACE,mBAEA,oGAOF,iCAEE,oBASA,kBATA,CAiBF,kDAGE,gCACA,cAOF,gBACE,kBAOF,iBACE,sBACA,WAOF,kBACE,cAQF,gCAEE,cACA,cACA,kBACA,wBAGF,gBACE,cAGF,gBACE,UAUF,oCAEE,qBAOF,kCACE,aACA,SAOF,gBACE,kBAOF,2BACE,gBAWF,kGAKE,uBACA,eACA,iBACA,SAQF,qCAEE,iBAQF,sCAEE,oBASF,qGAIE,0BAOF,wKAIE,kBACA,UAOF,4JAIE,8BAOF,qBACE,2BAUF,mBACE,sBACA,cACA,cACA,eACA,UACA,mBAQF,qBACE,qBACA,wBAOF,qBACE,cAQF,qDAEE,sBACA,UAOF,0GAEE,YAQF,0BACE,6BACA,oBAOF,6GAEE,wBAQF,yCACE,0BACA,aAWF,qCAEE,cAOF,oBACE,kBAUF,mBACE,qBAkBF,0CACE,aCnbF,4CACA,kDACA,kDCDA,wBACE,0EAGF,2BACE,0EAGF,gCACE,mEAGF,iCACE,mEClBF,0tBAkCE,sBCrBF,0BACE,SACA,kBAGF,sDACA,uDAEA,kDACA,sDAEA,oDACA,mDAEA,oDACA,mDAEA,qDACA,mDAEA,mDAEA,kCAII,SAGA,YAFA,OAJA,kBAEA,QADA,MAIA,WAEA,YAGJ,mCACI,6BACE,SACA,kBAEF,yDACA,0DACA,qDACA,yDACA,uDACA,sDACA,uDACA,sDACA,wDACA,sDACA,sDACA,qCAII,SAGA,YAFA,OAJA,kBAEA,QADA,MAIA,WAEA,aAIR,uDACI,4BACE,SACA,kBAEF,wDACA,yDACA,oDACA,wDACA,sDACA,qDACA,sDACA,qDACA,uDACA,qDACA,qDACA,oCAII,SAGA,YAFA,OAJA,kBAEA,QADA,MAIA,WAEA,aAIR,mCACI,4BACE,SACA,kBAEF,wDACA,yDACA,oDACA,wDACA,sDACA,qDACA,sDACA,qDACA,uDACA,qDACA,qDACA,oCAII,SAGA,YAFA,OAJA,kBAEA,QADA,MAIA,WAEA,aC3HR,+BCQE,mDACA,uDAEF,mCACE,sDACA,2DAGF,uDACE,qDACA,0DAGF,mCACE,qDACA,0DCXF,uBAEE,wBADA,2BACA,CAGF,oBAEE,wBADA,2BACA,CAGF,sBAEE,yBADA,2BACA,CAGF,uBAEE,2BADA,2BACA,CAGF,qBAEE,sBADA,2BACA,CAGF,mCACE,0BAEE,wBADA,2BACA,CAGF,uBAEE,wBADA,2BACA,CAGF,yBAEE,yBADA,2BACA,CAGF,0BAEE,2BADA,2BACA,CAGF,wBAEE,sBADA,2BACA,EAIJ,uDACE,yBAEE,wBADA,2BACA,CAGF,sBAEE,wBADA,2BACA,CAGF,wBAEE,yBADA,2BACA,CAGF,yBAEE,2BADA,2BACA,CAGF,uBAEE,sBADA,2BACA,EAIJ,mCACE,yBAEE,wBADA,2BACA,CAGF,sBAEE,wBADA,2BACA,CAGF,wBAEE,yBADA,2BACA,CAGF,yBAEE,2BADA,2BACA,CAGF,uBAEE,sBADA,2BACA,EChHJ,uCACA,+DACA,iCAEA,mCACE,0CACA,kEACA,qCAGF,uDACE,yCACA,iEACA,oCAGF,mCACE,yCACA,iEACA,oCCPA,oDACA,4DACA,gEACA,kEACA,8DACA,iDAGF,mCACE,uDACA,+DACA,mEACA,qEACA,iEACA,qDAGF,uDACE,sDACA,8DACA,kEACA,oEACA,gEACA,oDAGF,mCACE,sDACA,8DACA,kEACA,oEACA,gEACA,oDCnCF,uCC2CQ,CD1CR,4CC2Ca,CD1Cb,2CC2CY,CD1CZ,0CC2CW,CD1CX,sCC2CO,CD1CP,wCC2CS,CD1CT,8CC2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,yCHnBkB,CGoBlB,uCHpBkB,EIxCpB,2DJ8Ce,CI7Cf,2DJ8Ce,CI7Cf,+DJ8Ce,CI7Cf,6DJ8Ce,CI7Cf,6DJ8Ce,CI5Cf,mCACE,8DJuCa,CItCb,8DJuCa,CItCb,kEJuCa,CItCb,gEJuCa,CItCb,gEJuCa,EIpCf,uDACE,6DJ+Ba,CI9Bb,6DJ+Ba,CI9Bb,iEJ+Ba,CI9Bb,+DJ+Ba,CI9Bb,+DJ+Ba,EI5Bf,mCACE,6DJuBa,CItBb,6DJuBa,CItBb,iEJuBa,CItBb,+DJuBa,CItBb,+DJuBa,EKxDf,iBACE,gBACA,kBACA,gBCkBF,yBACA,6BACA,+BACA,2BAEA,4BACA,gCACA,kCACA,8BAEA,4BACA,gCACA,kCACA,8BAEA,8BACA,kCACA,oCACA,gCAEA,8BACA,kCACA,oCACA,gCAGA,4BAGE,SACA,OAFA,QADA,KAGA,CAGF,mCACE,4BACA,8BACA,gCACA,kCACA,+BACA,iCACA,mCACA,qCACA,+BACA,iCACA,mCACA,qCACA,iCACA,qCACA,uCACA,mCACA,iCACA,qCACA,uCACA,mCACA,+BAGE,SACA,OAFA,QADA,KAGA,EAIJ,uDACE,2BACA,6BACA,+BACA,iLine truncated
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
!function webpackUniversalModuleDefinition(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUICore=t():e.SwaggerUICore=t()}(this,(()=>(()=>{"use strict";var e={158(e){e.exports=require("buffer")}},t={};function __webpack_require__(a){var r=t[a];if(void 0!==r)return r.exports;var n=t[a]={exports:{}};return e[a](n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var a in t)__webpack_require__.o(t,a)&&!__webpack_require__.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};__webpack_require__.d(a,{default:()=>Cl});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{CLEAR:()=>$,CLEAR_BY:()=>L,NEW_AUTH_ERR:()=>V,NEW_SPEC_ERR:()=>R,NEW_SPEC_ERR_BATCH:()=>J,NEW_THROWN_ERR:()=>P,NEW_THROWN_ERR_BATCH:()=>T,clear:()=>clear,clearBy:()=>clearBy,newAuthErr:()=>newAuthErr,newSpecErr:()=>newSpecErr,newSpecErrBatch:()=>newSpecErrBatch,newThrownErr:()=>newThrownErr,newThrownErrBatch:()=>newThrownErrBatch});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{AUTHORIZE:()=>ue,AUTHORIZE_OAUTH2:()=>he,CONFIGURE_AUTH:()=>ge,LOGOUT:()=>de,RESTORE_AUTHORIZATION:()=>ye,SHOW_AUTH_POPUP:()=>me,authPopup:()=>authPopup,authorize:()=>authorize,authorizeAccessCodeWithBasicAuthentication:()=>authorizeAccessCodeWithBasicAuthentication,authorizeAccessCodeWithFormParams:()=>authorizeAccessCodeWithFormParams,authorizeApplication:()=>authorizeApplication,authorizeOauth2:()=>authorizeOauth2,authorizeOauth2WithPersistOption:()=>authorizeOauth2WithPersistOption,authorizePassword:()=>authorizePassword,authorizeRequest:()=>authorizeRequest,authorizeWithPersistOption:()=>authorizeWithPersistOption,configureAuth:()=>configureAuth,logout:()=>logout,logoutWithPersistOption:()=>logoutWithPersistOption,persistAuthorizationIfNeeded:()=>persistAuthorizationIfNeeded,preAuthorizeImplicit:()=>preAuthorizeImplicit,restoreAuthorization:()=>restoreAuthorization,showDefinitions:()=>showDefinitions});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{authorized:()=>ve,definitionsForRequirements:()=>definitionsForRequirements,definitionsToAuthorize:()=>_e,getConfigs:()=>we,getDefinitionsByNames:()=>getDefinitionsByNames,isAuthorized:()=>isAuthorized,selectAuthPath:()=>selectAuthPath,shownDefinitions:()=>Ee});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{TOGGLE_CONFIGS:()=>qe,UPDATE_CONFIGS:()=>Ie,downloadConfig:()=>downloadConfig,getConfigByUrl:()=>getConfigByUrl,loaded:()=>actions_loaded,toggle:()=>toggle,update:()=>update});var l={};__webpack_require__.r(l),__webpack_require__.d(l,{get:()=>get});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{transform:()=>transform});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{transform:()=>parameter_oneof_transform});var p={};__webpack_require__.r(p),__webpack_require__.d(p,{allErrors:()=>Ye,lastError:()=>Qe});var m={};__webpack_require__.r(m),__webpack_require__.d(m,{SHOW:()=>nt,UPDATE_FILTER:()=>at,UPDATE_LAYOUT:()=>tt,UPDATE_MODE:()=>rt,changeMode:()=>changeMode,show:()=>actions_show,updateFilter:()=>updateFilter,updateLayout:()=>updateLayout});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{current:()=>current,currentFilter:()=>currentFilter,isShown:()=>isShown,showSummary:()=>ot,whatMode:()=>whatMode});var d={};__webpack_require__.r(d),__webpack_require__.d(d,{taggedOperations:()=>taggedOperations});var h={};__webpack_require__.r(h),__webpack_require__.d(h,{getActiveLanguage:()=>it,getDefaultExpanded:()=>pt,getGenerators:()=>ct,getSnippetGenerators:()=>getSnippetGenerators});var g={};__webpack_require__.r(g),__webpack_require__.d(g,{JsonSchemaArrayItemFile:()=>JsonSchemaArrayItemFile,JsonSchemaArrayItemText:()=>JsonSchemaArrayItemText,JsonSchemaForm:()=>JsonSchemaForm,JsonSchema_array:()=>JsonSchema_array,JsonSchema_boolean:()=>JsonSchema_boolean,JsonSchema_object:()=>JsonSchema_object,JsonSchema_string:()=>JsonSchema_string});var y={};__webpack_require__.r(y),__webpack_require__.d(y,{allowTryItOutFor:()=>allowTryItOutFor,basePath:()=>ga,canExecuteScheme:()=>canExecuteScheme,consumes:()=>pa,consumesOptionsFor:()=>consumesOptionsFor,contentTypeValues:()=>contentTypeValues,currentProducesFor:()=>currentProducesFor,definitions:()=>ha,externalDocs:()=>na,findDefinition:()=>findDefinition,getOAS3RequiredRequestBodyContentType:()=>getOAS3RequiredRequestBodyContentType,getParameter:()=>getParameter,hasHost:()=>Ca,host:()=>ya,info:()=>ra,isMediaTypeSchemaPropertiesEqual:()=>isMediaTypeSchemaPropertiesEqual,isOAS3:()=>aa,lastError:()=>Ht,mutatedLine truncated
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUICore=t():e.SwaggerUICore=t()}(this,(()=>(()=>{var e={6024:(e,t,n)=>{"use strict";n.d(t,{Z:()=>E});var s=n(4250),r=n.n(s),a=n(1093),o=n.n(a),l=n(8493),c=n.n(l),i=n(3942),u=n.n(i),p=n(6689),m=n.n(p);const d=require("react-immutable-pure-component");var h=n.n(d),g=n(8082),f=n.n(g),y=n(580),S=n.n(y);const v=e=>{const t=e.replace(/~1/g,"/").replace(/~0/g,"~");try{return decodeURIComponent(t)}catch{return t}};class E extends(h()){constructor(){super(...arguments),o()(this,"getModelName",(e=>-1!==c()(e).call(e,"#/definitions/")?v(e.replace(/^.*#\/definitions\//,"")):-1!==c()(e).call(e,"#/components/schemas/")?v(e.replace(/^.*#\/components\/schemas\//,"")):void 0)),o()(this,"getRefSchema",(e=>{let{specSelectors:t}=this.props;return t.findDefinition(e)}))}render(){let{getComponent:e,getConfigs:t,specSelectors:s,schema:a,required:o,name:l,isRef:c,specPath:i,displayName:u,includeReadOnly:p,includeWriteOnly:d}=this.props;const h=e("ObjectModel"),g=e("ArrayModel"),f=e("PrimitiveModel");let y="object",S=a&&a.get("$$ref");if(!l&&S&&(l=this.getModelName(S)),!a&&S&&(a=this.getRefSchema(l)),!a)return m().createElement("span",{className:"model model-title"},m().createElement("span",{className:"model-title__text"},u||l),m().createElement("img",{src:n(2517),height:"20px",width:"20px"}));const v=s.isOAS3()&&a.get("deprecated");switch(c=void 0!==c?c:!!S,y=a&&a.get("type")||y,y){case"object":return m().createElement(h,r()({className:"object"},this.props,{specPath:i,getConfigs:t,schema:a,name:l,deprecated:v,isRef:c,includeReadOnly:p,includeWriteOnly:d}));case"array":return m().createElement(g,r()({className:"array"},this.props,{getConfigs:t,schema:a,name:l,deprecated:v,required:o,includeReadOnly:p,includeWriteOnly:d}));default:return m().createElement(f,r()({},this.props,{getComponent:e,getConfigs:t,schema:a,name:l,deprecated:v,required:o}))}}}o()(E,"propTypes",{schema:u()(f()).isRequired,getComponent:S().func.isRequired,getConfigs:S().func.isRequired,specSelectors:S().object.isRequired,name:S().string,displayName:S().string,isRef:S().bool,required:S().bool,expandDepth:S().number,depth:S().number,specPath:f().list.isRequired,includeReadOnly:S().bool,includeWriteOnly:S().bool})},5623:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var s=n(1093),r=n.n(s),a=n(7252),o=n.n(a),l=n(6689),c=n.n(l),i=n(3883),u=n.n(i),p=(n(580),n(1669)),m=n(7504);class d extends c().Component{constructor(e,t){super(e,t),r()(this,"getDefinitionUrl",(()=>{let{specSelectors:e}=this.props;return new(u())(e.url(),m.Z.location).toString()}));let{getConfigs:n}=e,{validatorUrl:s}=n();this.state={url:this.getDefinitionUrl(),validatorUrl:void 0===s?"https://validator.swagger.io/validator":s}}UNSAFE_componentWillReceiveProps(e){let{getConfigs:t}=e,{validatorUrl:n}=t();this.setState({url:this.getDefinitionUrl(),validatorUrl:void 0===n?"https://validator.swagger.io/validator":n})}render(){let{getConfigs:e}=this.props,{spec:t}=e(),n=(0,p.Nm)(this.state.validatorUrl);return"object"==typeof t&&o()(t).length?null:this.state.url&&(0,p.hW)(this.state.validatorUrl)&&(0,p.hW)(this.state.url)?c().createElement("span",{className:"float-right"},c().createElement("a",{target:"_blank",rel:"noopener noreferrer",href:`${n}/debug?url=${encodeURIComponent(this.state.url)}`},c().createElement(h,{src:`${n}?url=${encodeURIComponent(this.state.url)}`,alt:"Online validator badge"}))):null}}class h extends c().Component{constructor(e){super(e),this.state={loaded:!1,error:!1}}componentDidMount(){const e=new Image;e.onload=()=>{this.setState({loaded:!0})},e.onerror=()=>{this.setState({error:!0})},e.src=this.props.src}UNSAFE_componentWillReceiveProps(e){if(e.src!==this.props.src){const t=new Image;t.onload=()=>{this.setState({loaded:!0})},t.onerror=()=>{this.setState({error:!0})},t.src=e.src}}render(){return this.state.error?c().createElement("img",{alt:"Error"}):this.state.loaded?c().createElement("img",{src:this.props.src,alt:this.props.alt}):null}}},2552:(e,t,n)=>{"use strict";n.d(t,{Z:()=>m,s:()=>d});var s=n(6689),r=n.n(s),a=(n(580),n(963));const o=require("remarkable/linkify"),l=require("dompurify");var c=n.n(l),i=n(9003),u=n.n(i);function p(e){let{source:t,className:n="",getConfigs:s}=e;if("string"!=typeof t)return null;const l=new a.Remarkable({html:!0,typographer:!0,breaks:!0,linkTarget:"_blank"}).use(o.linkify);l.core.ruler.disable(["replacements","smartquotes"]);const{useUnsafeMarkdown:c}=s(),i=l.render(t),p=d(i,{useUnsafeMarkdown:c});return t&&i&&p?r().createElement("div",{className:u()(n,"markdown"),dangerouslySetInnerHTML:{__html:p}}):null}c().addHook&&c().addHook("beforeSanitizeElements",(function(e){return e.href&&e.setAttribute("rel","noopener noreferrer"),e})),p.defaultProps={getConfigs:()=>({useUnsafeMarkdown:!1})};const m=p;function d(e){let{useUnsafeMarkdown:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguLine truncated
|
||||||
//# sourceMappingURL=swagger-ui.js.map
|
//# sourceMappingURL=swagger-ui.js.map
|
||||||
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"swagger-ui.js","mappings":"CAAA,SAAUA,iCAAiCC,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,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HCxEtC,MAAMK,EAAUrH,EAAAA,MAEVsH,EAAa,CAAC,EAEpB,IAEAC,IAAAC,EAAAC,IAAAJ,GAAOxG,KAAPwG,IAAcxG,KAAA2G,GAAU,SAAUE,GAChC,GAAY,eAARA,EACF,OAQF,IAAIC,EAAMN,EAAQK,GAClBJ,GAAWM,EAAAA,EAAAA,IAAmBF,IAAQC,EAAIE,QAAUF,EAAIE,QAAUF,CACpE,IAEAL,EAAWQ,WAAaA,EAAAA,O,mvBCnBjB,MAAMC,EAAkB,aAClBC,EAAY,YACZC,EAAS,SACTC,EAAuB,uBACvBC,EAAmB,mBACnBC,EAAW,WACXC,EAAiB,iBACjBC,EAAwB,wBAI9B,SAASCLine truncated
|
||||||
@@ -8,7 +8,7 @@ if(file_exists('inc/vars.local.inc.php')) {
|
|||||||
$autodiscover_config = array_merge($default_autodiscover_config, $autodiscover_config);
|
$autodiscover_config = array_merge($default_autodiscover_config, $autodiscover_config);
|
||||||
|
|
||||||
header('Content-type: application/json');
|
header('Content-type: application/json');
|
||||||
if (strtolower($_GET['Protocol']) == 'activesync' && $autodiscover_config['autodiscoverType'] == 'activesync' && getenv('SKIP_SOGO') != "y") {
|
if (strtolower($_GET['Protocol']) == 'activesync' && getenv('SKIP_SOGO') != "y") {
|
||||||
echo '{"Protocol":"ActiveSync","Url":"' . $autodiscover_config['activesync']['url'] . '"}';
|
echo '{"Protocol":"ActiveSync","Url":"' . $autodiscover_config['activesync']['url'] . '"}';
|
||||||
}
|
}
|
||||||
elseif (strtolower($_GET['Protocol']) == 'autodiscoverv1') {
|
elseif (strtolower($_GET['Protocol']) == 'autodiscoverv1') {
|
||||||
|
|||||||
+44
-43
@@ -31,7 +31,7 @@ error_reporting(0);
|
|||||||
|
|
||||||
$data = trim(file_get_contents("php://input"));
|
$data = trim(file_get_contents("php://input"));
|
||||||
|
|
||||||
if (strpos($data, 'autodiscover/outlook/responseschema') !== false && $autodiscover_config['autodiscoverType'] == 'activesync') {
|
if (strpos($data, 'autodiscover/outlook/responseschema') !== false) {
|
||||||
$autodiscover_config['autodiscoverType'] = 'imap';
|
$autodiscover_config['autodiscoverType'] = 'imap';
|
||||||
if ($autodiscover_config['useEASforOutlook'] == 'yes' &&
|
if ($autodiscover_config['useEASforOutlook'] == 'yes' &&
|
||||||
// Office for macOS does not support EAS
|
// Office for macOS does not support EAS
|
||||||
@@ -144,15 +144,41 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$username = trim((string)$email);
|
$username = trim((string)$email);
|
||||||
if (!filter_var($username, FILTER_VALIDATE_EMAIL)) {
|
try {
|
||||||
|
$stmt = $pdo->prepare("SELECT `mailbox`.`name`, `mailbox`.`active` FROM `mailbox`
|
||||||
|
INNER JOIN `domain` ON `mailbox`.`domain` = `domain`.`domain`
|
||||||
|
WHERE `mailbox`.`username` = :username
|
||||||
|
AND `mailbox`.`active` = '1'
|
||||||
|
AND `domain`.`active` = '1'");
|
||||||
|
$stmt->execute(array(':username' => $username));
|
||||||
|
$MailboxData = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
}
|
||||||
|
catch(PDOException $e) {
|
||||||
|
// Database error - return error response with complete XML
|
||||||
|
list($usec, $sec) = explode(' ', microtime());
|
||||||
|
?>
|
||||||
|
<Response>
|
||||||
|
<Error Time="<?=date('H:i:s', $sec) . substr($usec, 0, strlen($usec) - 2);?>" Id="<?=rand(1000000000, 9999999999);?>">
|
||||||
|
<ErrorCode>500</ErrorCode>
|
||||||
|
<Message>Database Error</Message>
|
||||||
|
<DebugData />
|
||||||
|
</Error>
|
||||||
|
</Response>
|
||||||
|
</Autodiscover>
|
||||||
|
<?php
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mailbox not found or not active - return generic error to prevent user enumeration
|
||||||
|
if (empty($MailboxData)) {
|
||||||
try {
|
try {
|
||||||
$json = json_encode(
|
$json = json_encode(
|
||||||
array(
|
array(
|
||||||
"time" => time(),
|
"time" => time(),
|
||||||
"ua" => $_SERVER['HTTP_USER_AGENT'],
|
"ua" => $_SERVER['HTTP_USER_AGENT'],
|
||||||
"user" => "none",
|
"user" => $email,
|
||||||
"ip" => $_SERVER['REMOTE_ADDR'],
|
"ip" => $_SERVER['REMOTE_ADDR'],
|
||||||
"service" => "Error: invalid email address in request"
|
"service" => "Error: mailbox not found or inactive"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$redis->lPush('AUTODISCOVER_LOG', $json);
|
$redis->lPush('AUTODISCOVER_LOG', $json);
|
||||||
@@ -176,33 +202,13 @@ if (!filter_var($username, FILTER_VALIDATE_EMAIL)) {
|
|||||||
<?php
|
<?php
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
try {
|
|
||||||
$stmt = $pdo->prepare("SELECT `mailbox`.`name`, `mailbox`.`active` FROM `mailbox`
|
|
||||||
INNER JOIN `domain` ON `mailbox`.`domain` = `domain`.`domain`
|
|
||||||
WHERE `mailbox`.`username` = :username
|
|
||||||
AND `mailbox`.`active` = '1'
|
|
||||||
AND `domain`.`active` = '1'");
|
|
||||||
$stmt->execute(array(':username' => $username));
|
|
||||||
$MailboxData = $stmt->fetch(PDO::FETCH_ASSOC);
|
|
||||||
}
|
|
||||||
catch(PDOException $e) {
|
|
||||||
// Database error - return error response with complete XML
|
|
||||||
list($usec, $sec) = explode(' ', microtime());
|
|
||||||
?>
|
|
||||||
<Response>
|
|
||||||
<Error Time="<?=date('H:i:s', $sec) . substr($usec, 0, strlen($usec) - 2);?>" Id="<?=rand(1000000000, 9999999999);?>">
|
|
||||||
<ErrorCode>500</ErrorCode>
|
|
||||||
<Message>Database Error</Message>
|
|
||||||
<DebugData />
|
|
||||||
</Error>
|
|
||||||
</Response>
|
|
||||||
</Autodiscover>
|
|
||||||
<?php
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
$email = $username;
|
if (!empty($MailboxData['name'])) {
|
||||||
$displayname = $email;
|
$displayname = $MailboxData['name'];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$displayname = $email;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
$json = json_encode(
|
$json = json_encode(
|
||||||
array(
|
array(
|
||||||
@@ -210,16 +216,11 @@ try {
|
|||||||
"ua" => $_SERVER['HTTP_USER_AGENT'],
|
"ua" => $_SERVER['HTTP_USER_AGENT'],
|
||||||
"user" => $email,
|
"user" => $email,
|
||||||
"ip" => $_SERVER['REMOTE_ADDR'],
|
"ip" => $_SERVER['REMOTE_ADDR'],
|
||||||
// The answer is the same, only the log tells unknown or inactive mailboxes apart
|
"service" => $autodiscover_config['autodiscoverType']
|
||||||
"service" => (empty($MailboxData)) ? "Error: mailbox not found or inactive" : $autodiscover_config['autodiscoverType']
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$redis->lPush('AUTODISCOVER_LOG', $json);
|
$redis->lPush('AUTODISCOVER_LOG', $json);
|
||||||
$redis->lTrim('AUTODISCOVER_LOG', 0, 100);
|
$redis->lTrim('AUTODISCOVER_LOG', 0, 100);
|
||||||
if (empty($MailboxData)) {
|
|
||||||
$redis->publish("F2B_CHANNEL", "Autodiscover: Invalid mailbox attempt by " . $_SERVER['REMOTE_ADDR']);
|
|
||||||
error_log("Autodiscover: Invalid mailbox attempt by " . $_SERVER['REMOTE_ADDR']);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (RedisException $e) {
|
catch (RedisException $e) {
|
||||||
$_SESSION['return'][] = array(
|
$_SESSION['return'][] = array(
|
||||||
@@ -242,7 +243,7 @@ if ($autodiscover_config['autodiscoverType'] == 'imap') {
|
|||||||
<Server><?=$autodiscover_config['imap']['server'];?></Server>
|
<Server><?=$autodiscover_config['imap']['server'];?></Server>
|
||||||
<Port><?=$autodiscover_config['imap']['port'];?></Port>
|
<Port><?=$autodiscover_config['imap']['port'];?></Port>
|
||||||
<DomainRequired>off</DomainRequired>
|
<DomainRequired>off</DomainRequired>
|
||||||
<LoginName><?=htmlspecialchars($email, ENT_XML1 | ENT_QUOTES, 'UTF-8');?></LoginName>
|
<LoginName><?=$email;?></LoginName>
|
||||||
<SPA>off</SPA>
|
<SPA>off</SPA>
|
||||||
<SSL>on</SSL>
|
<SSL>on</SSL>
|
||||||
<AuthRequired>on</AuthRequired>
|
<AuthRequired>on</AuthRequired>
|
||||||
@@ -252,7 +253,7 @@ if ($autodiscover_config['autodiscoverType'] == 'imap') {
|
|||||||
<Server><?=$autodiscover_config['smtp']['server'];?></Server>
|
<Server><?=$autodiscover_config['smtp']['server'];?></Server>
|
||||||
<Port><?=$autodiscover_config['smtp']['port'];?></Port>
|
<Port><?=$autodiscover_config['smtp']['port'];?></Port>
|
||||||
<DomainRequired>off</DomainRequired>
|
<DomainRequired>off</DomainRequired>
|
||||||
<LoginName><?=htmlspecialchars($email, ENT_XML1 | ENT_QUOTES, 'UTF-8');?></LoginName>
|
<LoginName><?=$email;?></LoginName>
|
||||||
<SPA>off</SPA>
|
<SPA>off</SPA>
|
||||||
<SSL>on</SSL>
|
<SSL>on</SSL>
|
||||||
<AuthRequired>on</AuthRequired>
|
<AuthRequired>on</AuthRequired>
|
||||||
@@ -264,15 +265,15 @@ if ($autodiscover_config['autodiscoverType'] == 'imap') {
|
|||||||
?>
|
?>
|
||||||
<Protocol>
|
<Protocol>
|
||||||
<Type>CalDAV</Type>
|
<Type>CalDAV</Type>
|
||||||
<Server>https://<?=$autodiscover_config['caldav']['server'];?><?php if ($autodiscover_config['caldav']['port'] != 443) echo ':'.$autodiscover_config['caldav']['port']; ?>/SOGo/dav/<?=htmlspecialchars($email, ENT_XML1 | ENT_QUOTES, 'UTF-8');?>/</Server>
|
<Server>https://<?=$autodiscover_config['caldav']['server'];?><?php if ($autodiscover_config['caldav']['port'] != 443) echo ':'.$autodiscover_config['caldav']['port']; ?>/SOGo/dav/<?=$email;?>/</Server>
|
||||||
<DomainRequired>off</DomainRequired>
|
<DomainRequired>off</DomainRequired>
|
||||||
<LoginName><?=htmlspecialchars($email, ENT_XML1 | ENT_QUOTES, 'UTF-8');?></LoginName>
|
<LoginName><?=$email;?></LoginName>
|
||||||
</Protocol>
|
</Protocol>
|
||||||
<Protocol>
|
<Protocol>
|
||||||
<Type>CardDAV</Type>
|
<Type>CardDAV</Type>
|
||||||
<Server>https://<?=$autodiscover_config['carddav']['server'];?><?php if ($autodiscover_config['caldav']['port'] != 443) echo ':'.$autodiscover_config['carddav']['port']; ?>/SOGo/dav/<?=htmlspecialchars($email, ENT_XML1 | ENT_QUOTES, 'UTF-8');?>/</Server>
|
<Server>https://<?=$autodiscover_config['carddav']['server'];?><?php if ($autodiscover_config['caldav']['port'] != 443) echo ':'.$autodiscover_config['carddav']['port']; ?>/SOGo/dav/<?=$email;?>/</Server>
|
||||||
<DomainRequired>off</DomainRequired>
|
<DomainRequired>off</DomainRequired>
|
||||||
<LoginName><?=htmlspecialchars($email, ENT_XML1 | ENT_QUOTES, 'UTF-8');?></LoginName>
|
<LoginName><?=$email;?></LoginName>
|
||||||
</Protocol>
|
</Protocol>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
@@ -287,7 +288,7 @@ if ($autodiscover_config['autodiscoverType'] == 'imap') {
|
|||||||
<Culture>en:en</Culture>
|
<Culture>en:en</Culture>
|
||||||
<User>
|
<User>
|
||||||
<DisplayName><?=htmlspecialchars($displayname, ENT_XML1 | ENT_QUOTES, 'UTF-8');?></DisplayName>
|
<DisplayName><?=htmlspecialchars($displayname, ENT_XML1 | ENT_QUOTES, 'UTF-8');?></DisplayName>
|
||||||
<EMailAddress><?=htmlspecialchars($email, ENT_XML1 | ENT_QUOTES, 'UTF-8');?></EMailAddress>
|
<EMailAddress><?=$email;?></EMailAddress>
|
||||||
</User>
|
</User>
|
||||||
<Action>
|
<Action>
|
||||||
<Settings>
|
<Settings>
|
||||||
|
|||||||
@@ -15,10 +15,6 @@ table.dataTable>tbody>tr.child ul.dtr-details>li {
|
|||||||
border-bottom: 1px solid rgba(0, 0, 0, 0.129);
|
border-bottom: 1px solid rgba(0, 0, 0, 0.129);
|
||||||
padding: 0.5em 0;
|
padding: 0.5em 0;
|
||||||
}
|
}
|
||||||
/* like the first entry has no top padding, the last one needs no bottom padding */
|
|
||||||
table.dataTable>tbody>tr.child ul.dtr-details>li:last-child {
|
|
||||||
padding-bottom: 0;
|
|
||||||
}
|
|
||||||
table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control:before:hover,
|
table.dataTable.dtr-inline.collapsed>tbody>tr>td.dtr-control:before:hover,
|
||||||
table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control:before:hover {
|
table.dataTable.dtr-inline.collapsed>tbody>tr>th.dtr-control:before:hover {
|
||||||
background-color: var(--mc-dtr-hover-bg);
|
background-color: var(--mc-dtr-hover-bg);
|
||||||
@@ -32,8 +28,7 @@ table.dataTable td.dt-control:before {
|
|||||||
color: var(--mc-dtr-color);
|
color: var(--mc-dtr-color);
|
||||||
height: 1em;
|
height: 1em;
|
||||||
width: 1em;
|
width: 1em;
|
||||||
line-height: 1em;
|
line-height: 1.25em;
|
||||||
margin-top: calc(-0.5em - 1.5px);
|
|
||||||
border-radius: 0px;
|
border-radius: 0px;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@@ -44,29 +39,11 @@ table.dataTable.dtr-inline.collapsed>tbody>tr.parent>th.dtr-control:before,
|
|||||||
table.dataTable td.dt-control:before {
|
table.dataTable td.dt-control:before {
|
||||||
background-color: var(--mc-dtr-active-bg) !important;
|
background-color: var(--mc-dtr-active-bg) !important;
|
||||||
}
|
}
|
||||||
/* The default initial order targets column 0, which is usually the non-orderable expand column */
|
|
||||||
table.dataTable thead > tr > th.sorting_disabled.sorting_asc,
|
|
||||||
table.dataTable thead > tr > th.sorting_disabled.sorting_desc {
|
|
||||||
padding-right: 0.5rem;
|
|
||||||
cursor: auto;
|
|
||||||
}
|
|
||||||
table.dataTable thead > tr > th.sorting_disabled.sorting_asc:before,
|
|
||||||
table.dataTable thead > tr > th.sorting_disabled.sorting_asc:after,
|
|
||||||
table.dataTable thead > tr > th.sorting_disabled.sorting_desc:before,
|
|
||||||
table.dataTable thead > tr > th.sorting_disabled.sorting_desc:after {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
table.dataTable.table-striped>tbody>tr>td {
|
table.dataTable.table-striped>tbody>tr>td {
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
table.dataTable.table-striped>tbody>tr>td>input[type="checkbox"] {
|
table.dataTable.table-striped>tbody>tr>td>input[type="checkbox"] {
|
||||||
/* centers the 1em checkbox in the 1.5em line, level with the expand control */
|
margin-top: 7px;
|
||||||
margin-top: 0.25em;
|
|
||||||
}
|
|
||||||
/* the vertical margin is meant for the tag editor in edit forms, in tables it only adds height */
|
|
||||||
table.dataTable .tag-badge {
|
|
||||||
margin-top: 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
}
|
||||||
td.dtr-col-lg {
|
td.dtr-col-lg {
|
||||||
min-width: 350px;
|
min-width: 350px;
|
||||||
|
|||||||
@@ -139,13 +139,6 @@ body {
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
font-size: inherit;
|
font-size: inherit;
|
||||||
}
|
}
|
||||||
.badge .bi {
|
|
||||||
font-size: inherit;
|
|
||||||
}
|
|
||||||
/* keeps icons from making a badge taller than one with text only */
|
|
||||||
.badge .bi::before {
|
|
||||||
line-height: 0;
|
|
||||||
}
|
|
||||||
.btn-group-xs > .btn, .btn-xs {
|
.btn-group-xs > .btn, .btn-xs {
|
||||||
padding: .25rem .4rem;
|
padding: .25rem .4rem;
|
||||||
font-size: .875rem;
|
font-size: .875rem;
|
||||||
@@ -350,7 +343,6 @@ code {
|
|||||||
}
|
}
|
||||||
.tag-badge .bi {
|
.tag-badge .bi {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 0;
|
|
||||||
}
|
}
|
||||||
.tag-badge.btn-badge:hover {
|
.tag-badge.btn-badge:hover {
|
||||||
filter: brightness(0.9);
|
filter: brightness(0.9);
|
||||||
|
|||||||
@@ -191,7 +191,7 @@
|
|||||||
height: 2rem;
|
height: 2rem;
|
||||||
width: 2rem;
|
width: 2rem;
|
||||||
line-height: 2rem;
|
line-height: 2rem;
|
||||||
margin-top: calc(-1rem - 1.5px);
|
margin-top: -15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
li .dtr-data {
|
li .dtr-data {
|
||||||
|
|||||||
+83
-133
@@ -1,133 +1,83 @@
|
|||||||
.pagination a {
|
.pagination a {
|
||||||
text-decoration: none !important;
|
text-decoration: none !important;
|
||||||
}
|
}
|
||||||
.panel.panel-default {
|
.panel.panel-default {
|
||||||
overflow: visible !important;
|
overflow: visible !important;
|
||||||
}
|
}
|
||||||
.table-responsive {
|
.table-responsive {
|
||||||
overflow: visible !important;
|
overflow: visible !important;
|
||||||
}
|
}
|
||||||
.table-responsive {
|
.table-responsive {
|
||||||
overflow-x: scroll !important;
|
overflow-x: scroll !important;
|
||||||
}
|
}
|
||||||
body {
|
body {
|
||||||
overflow-y:scroll;
|
overflow-y:scroll;
|
||||||
}
|
}
|
||||||
/* Fix modal moving content left */
|
/* Fix modal moving content left */
|
||||||
body.modal-open {
|
body.modal-open {
|
||||||
overflow-y:scroll;
|
overflow-y:scroll;
|
||||||
padding-right: inherit !important;
|
padding-right: inherit !important;
|
||||||
}
|
}
|
||||||
@media (min-width: 992px) {
|
@media (min-width: 992px) {
|
||||||
.container {
|
.container {
|
||||||
width: 80%;
|
width: 80%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.mass-actions-admin {
|
.mass-actions-admin {
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
.inputMissingAttr {
|
.inputMissingAttr {
|
||||||
border-color: #FF4136;
|
border-color: #FF4136;
|
||||||
}
|
}
|
||||||
.rotate {
|
.rotate {
|
||||||
-moz-transition: all 0.3s linear;
|
-moz-transition: all 0.3s linear;
|
||||||
-webkit-transition: all 0.3s linear;
|
-webkit-transition: all 0.3s linear;
|
||||||
transition: all 0.3s linear;
|
transition: all 0.3s linear;
|
||||||
}
|
}
|
||||||
.rotate.animation {
|
.rotate.animation {
|
||||||
-ms-transform:rotateX(180deg);
|
-ms-transform:rotateX(180deg);
|
||||||
-moz-transform:rotateX(180deg);
|
-moz-transform:rotateX(180deg);
|
||||||
-webkit-transform:rotateX(180deg);
|
-webkit-transform:rotateX(180deg);
|
||||||
transform:rotateX(180deg);
|
transform:rotateX(180deg);
|
||||||
}
|
}
|
||||||
.anchor {
|
.anchor {
|
||||||
display: block;
|
display: block;
|
||||||
height: 65px;
|
height: 65px;
|
||||||
margin-top: -65px;
|
margin-top: -65px;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
.thumbnail img {
|
.thumbnail img {
|
||||||
min-height:100px;
|
min-height:100px;
|
||||||
height:100px;
|
height:100px;
|
||||||
}
|
}
|
||||||
.nav-tabs>li>a {
|
.nav-tabs>li>a {
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
.table-condensed .input-sm {
|
.table-condensed .input-sm {
|
||||||
width: 100%!important;
|
width: 100%!important;
|
||||||
}
|
}
|
||||||
.table-condensed > thead > tr > th, .table-condensed > tbody > tr > th, .table-condensed > tfoot > tr > th, .table-condensed > thead > tr > td, .table-condensed > tbody > tr > td, .table-condensed > tfoot > tr > td {
|
.table-condensed > thead > tr > th, .table-condensed > tbody > tr > th, .table-condensed > tfoot > tr > th, .table-condensed > thead > tr > td, .table-condensed > tbody > tr > td, .table-condensed > tfoot > tr > td {
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
}
|
}
|
||||||
table tbody tr td input[type="checkbox"] {
|
table tbody tr td input[type="checkbox"] {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
#quarantine_template {
|
#quarantine_template {
|
||||||
margin:20px;
|
margin:20px;
|
||||||
}
|
}
|
||||||
.regex-input {
|
.regex-input {
|
||||||
font-family: Consolas,monaco,monospace;
|
font-family: Consolas,monaco,monospace;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
}
|
}
|
||||||
.label-keys {
|
.label-keys {
|
||||||
font-size:100%;
|
font-size:100%;
|
||||||
margin: 0px !important;
|
margin: 0px !important;
|
||||||
white-space: normal !important;
|
white-space: normal !important;
|
||||||
}
|
}
|
||||||
.key-action {
|
.key-action {
|
||||||
font-weight:bold;
|
font-weight:bold;
|
||||||
color:white !important;
|
color:white !important;
|
||||||
}
|
}
|
||||||
.dkim-label {
|
.dkim-label {
|
||||||
margin: 0 0 8px !important;
|
margin: 0 0 8px !important;
|
||||||
}
|
}
|
||||||
/* backup schedule: the weekday toggles and the remove buttons of the entries react to the mouse, in every theme */
|
|
||||||
.backup-schedule-days .btn:hover {
|
|
||||||
background-image: linear-gradient(rgba(128, 128, 128, .3), rgba(128, 128, 128, .3));
|
|
||||||
}
|
|
||||||
.backup-schedule-remove {
|
|
||||||
opacity: .6;
|
|
||||||
}
|
|
||||||
.backup-schedule-remove:hover, .backup-schedule-remove:focus-visible {
|
|
||||||
opacity: 1;
|
|
||||||
color: var(--bs-danger) !important;
|
|
||||||
}
|
|
||||||
/* result and log of a backup job: the border of the theme in light and dark mode (Bootstrap's .border stays light) */
|
|
||||||
.backup-pre {
|
|
||||||
border: 1px solid var(--mc-border);
|
|
||||||
}
|
|
||||||
/* result of a restore job: an entry to open per mailbox, numbers in columns */
|
|
||||||
.backup-result {
|
|
||||||
border: 1px solid var(--mc-border);
|
|
||||||
}
|
|
||||||
.backup-result > details + details {
|
|
||||||
border-top: 1px solid var(--mc-border);
|
|
||||||
}
|
|
||||||
.backup-result summary {
|
|
||||||
list-style: none;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.backup-result summary::-webkit-details-marker {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
.backup-result summary:hover {
|
|
||||||
background-image: linear-gradient(rgba(128, 128, 128, .12), rgba(128, 128, 128, .12));
|
|
||||||
}
|
|
||||||
.backup-result summary .bi-chevron-right {
|
|
||||||
transition: transform .15s;
|
|
||||||
}
|
|
||||||
.backup-result details[open] > summary .bi-chevron-right {
|
|
||||||
transform: rotate(90deg);
|
|
||||||
}
|
|
||||||
.backup-result-body {
|
|
||||||
padding-left: 2.6rem !important;
|
|
||||||
}
|
|
||||||
.backup-result-body .table {
|
|
||||||
--bs-table-bg: transparent;
|
|
||||||
}
|
|
||||||
.backup-result-body .num {
|
|
||||||
width: 8.5rem;
|
|
||||||
text-align: right;
|
|
||||||
font-variant-numeric: tabular-nums;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
@@ -495,16 +495,4 @@ input::placeholder {
|
|||||||
}
|
}
|
||||||
.btn-light, .btn-light:hover {
|
.btn-light, .btn-light:hover {
|
||||||
background-image: none;
|
background-image: none;
|
||||||
}
|
}
|
||||||
/* native time picker icon and popup in dark mode */
|
|
||||||
input[type="time"] {
|
|
||||||
color-scheme: dark;
|
|
||||||
}
|
|
||||||
/* switches while off: a light knob and a visible border (Bootstrap's dark knob is for light pages, the dark mode
|
|
||||||
does not set data-bs-theme) */
|
|
||||||
.form-switch .form-check-input:not(:checked):not(:focus) {
|
|
||||||
--bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%28255, 255, 255, 0.6%29'/%3e%3c/svg%3e");
|
|
||||||
}
|
|
||||||
.form-switch .form-check-input:not(:checked) {
|
|
||||||
border-color: var(--mc-btn-outline-border);
|
|
||||||
}
|
|
||||||
@@ -11,8 +11,6 @@ $_SESSION['return_to'] = $_SERVER['REQUEST_URI'];
|
|||||||
|
|
||||||
$js_minifier->add('/web/js/site/imapsync.js');
|
$js_minifier->add('/web/js/site/imapsync.js');
|
||||||
$js_minifier->add('/web/js/site/groups.js');
|
$js_minifier->add('/web/js/site/groups.js');
|
||||||
$js_minifier->add('/web/js/site/mail-policy.js');
|
|
||||||
$js_minifier->add('/web/js/site/retention.js');
|
|
||||||
$js_minifier->add('/web/js/site/mailbox.js');
|
$js_minifier->add('/web/js/site/mailbox.js');
|
||||||
$js_minifier->add('/web/js/presets/sieveMailbox.js');
|
$js_minifier->add('/web/js/presets/sieveMailbox.js');
|
||||||
$js_minifier->add('/web/js/site/pwgen.js');
|
$js_minifier->add('/web/js/site/pwgen.js');
|
||||||
@@ -47,9 +45,6 @@ $template_data = [
|
|||||||
'lang_edit' => json_encode($lang['edit']),
|
'lang_edit' => json_encode($lang['edit']),
|
||||||
'lang_datatables' => json_encode($lang['datatables']),
|
'lang_datatables' => json_encode($lang['datatables']),
|
||||||
'imapsync_redirect_uri' => \Mailcow\Imapsync\ImapsyncModule::fromGlobals()->oauth->redirectUri(),
|
'imapsync_redirect_uri' => \Mailcow\Imapsync\ImapsyncModule::fromGlobals()->oauth->redirectUri(),
|
||||||
'archive_enabled' => \Mailcow\Archive\ArchiveModule::fromGlobals()->settings->enabled(),
|
|
||||||
'mail_policy_groups' => \Mailcow\MailPolicy\MailPolicyModule::fromGlobals()->policies->groupChoices($domains),
|
|
||||||
'retention_groups' => \Mailcow\Retention\RetentionModule::fromGlobals()->rules->groupChoices($domains),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/footer.inc.php';
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/footer.inc.php';
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
<?php
|
|
||||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/prerequisites.inc.php';
|
|
||||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/triggers.domainadmin.inc.php';
|
|
||||||
|
|
||||||
protect_route(['domainadmin']);
|
|
||||||
|
|
||||||
$role = "domainadmin";
|
|
||||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/inc/restore.inc.php';
|
|
||||||
+2
-29
@@ -65,8 +65,7 @@ if (isset($_SESSION['mailcow_cc_role'])) {
|
|||||||
'mta_sts' => $mta_sts,
|
'mta_sts' => $mta_sts,
|
||||||
'mailboxes' => mailbox('get', 'mailboxes', $_GET["domain"]),
|
'mailboxes' => mailbox('get', 'mailboxes', $_GET["domain"]),
|
||||||
'aliases' => mailbox('get', 'aliases', $_GET["domain"], 'address'),
|
'aliases' => mailbox('get', 'aliases', $_GET["domain"], 'address'),
|
||||||
'alias_domains' => mailbox('get', 'alias_domains', $_GET["domain"]),
|
'alias_domains' => mailbox('get', 'alias_domains', $_GET["domain"])
|
||||||
'archive_enabled' => \Mailcow\Archive\ArchiveModule::fromGlobals()->settings->enabled()
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -76,7 +75,6 @@ if (isset($_SESSION['mailcow_cc_role'])) {
|
|||||||
$template_data = [
|
$template_data = [
|
||||||
'template' => $domain_template,
|
'template' => $domain_template,
|
||||||
'rl' => ['frame' => $domain_template['attributes']['rl_frame']],
|
'rl' => ['frame' => $domain_template['attributes']['rl_frame']],
|
||||||
'archive_enabled' => \Mailcow\Archive\ArchiveModule::fromGlobals()->settings->enabled(),
|
|
||||||
];
|
];
|
||||||
$template = 'edit/domain-templates.twig';
|
$template = 'edit/domain-templates.twig';
|
||||||
$result = true;
|
$result = true;
|
||||||
@@ -87,7 +85,6 @@ if (isset($_SESSION['mailcow_cc_role'])) {
|
|||||||
$template_data = [
|
$template_data = [
|
||||||
'template' => $mailbox_template,
|
'template' => $mailbox_template,
|
||||||
'rl' => ['frame' => $mailbox_template['attributes']['rl_frame']],
|
'rl' => ['frame' => $mailbox_template['attributes']['rl_frame']],
|
||||||
'archive_enabled' => \Mailcow\Archive\ArchiveModule::fromGlobals()->settings->enabled(),
|
|
||||||
];
|
];
|
||||||
$template = 'edit/mailbox-templates.twig';
|
$template = 'edit/mailbox-templates.twig';
|
||||||
$result = true;
|
$result = true;
|
||||||
@@ -118,28 +115,6 @@ if (isset($_SESSION['mailcow_cc_role'])) {
|
|||||||
'mbox_templates' => ($_SESSION['mailcow_cc_role'] == 'admin') ? mailbox('get', 'mailbox_templates') : [],
|
'mbox_templates' => ($_SESSION['mailcow_cc_role'] == 'admin') ? mailbox('get', 'mailbox_templates') : [],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
elseif (isset($_GET['mail-policy']) &&
|
|
||||||
is_numeric($_GET['mail-policy'])) {
|
|
||||||
$mail_policy = \Mailcow\MailPolicy\MailPolicyModule::fromGlobals();
|
|
||||||
$result = $mail_policy->api->getPolicy($_GET['mail-policy']);
|
|
||||||
$template = 'edit/mail-policy.twig';
|
|
||||||
// Choices: mailboxes and groups of the domain of the policy
|
|
||||||
$template_data = [
|
|
||||||
'mailboxes' => !empty($result) ? mailbox('get', 'mailboxes', $result['domain']) : [],
|
|
||||||
'mail_policy_groups' => !empty($result) ? $mail_policy->policies->groupChoices([$result['domain']]) : [],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
elseif (isset($_GET['retention-rule']) &&
|
|
||||||
is_numeric($_GET['retention-rule'])) {
|
|
||||||
$retention = \Mailcow\Retention\RetentionModule::fromGlobals();
|
|
||||||
$result = $retention->api->getRule($_GET['retention-rule']);
|
|
||||||
$template = 'edit/retention-rule.twig';
|
|
||||||
// Choices: mailboxes and groups of the domain of the rule
|
|
||||||
$template_data = [
|
|
||||||
'mailboxes' => !empty($result) ? mailbox('get', 'mailboxes', $result['domain']) : [],
|
|
||||||
'retention_groups' => !empty($result) ? $retention->rules->groupChoices([$result['domain']]) : [],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
elseif (isset($_GET['api-key']) &&
|
elseif (isset($_GET['api-key']) &&
|
||||||
is_numeric($_GET['api-key'])) {
|
is_numeric($_GET['api-key'])) {
|
||||||
$result = \Mailcow\ApiKey\ApiKeyModule::fromGlobals()->api->getKey($_GET['api-key']);
|
$result = \Mailcow\ApiKey\ApiKeyModule::fromGlobals()->api->getKey($_GET['api-key']);
|
||||||
@@ -187,7 +162,6 @@ if (isset($_SESSION['mailcow_cc_role'])) {
|
|||||||
'user_acls' => acl('get', 'user', $mailbox),
|
'user_acls' => acl('get', 'user', $mailbox),
|
||||||
'mailbox_details' => $result,
|
'mailbox_details' => $result,
|
||||||
'iam_settings' => $iam_settings,
|
'iam_settings' => $iam_settings,
|
||||||
'archive_enabled' => \Mailcow\Archive\ArchiveModule::fromGlobals()->settings->enabled(),
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -253,8 +227,7 @@ if (isset($_SESSION['mailcow_cc_role'])) {
|
|||||||
if (isset($_GET['syncjob']) &&
|
if (isset($_GET['syncjob']) &&
|
||||||
is_numeric($_GET['syncjob'])) {
|
is_numeric($_GET['syncjob'])) {
|
||||||
$id = $_GET["syncjob"];
|
$id = $_GET["syncjob"];
|
||||||
// Without the syncjobs ACL a job cannot be saved, so do not show the form
|
$result = \Mailcow\Imapsync\ImapsyncModule::fromGlobals()->api->getJob($id);
|
||||||
$result = (($_SESSION['acl']['syncjobs'] ?? '0') == '1') ? \Mailcow\Imapsync\ImapsyncModule::fromGlobals()->api->getJob($id) : [];
|
|
||||||
$template = 'edit/syncjob.twig';
|
$template = 'edit/syncjob.twig';
|
||||||
}
|
}
|
||||||
elseif (isset($_GET['syncjob_source']) &&
|
elseif (isset($_GET['syncjob_source']) &&
|
||||||
|
|||||||
@@ -74,9 +74,6 @@ $globalVariables = [
|
|||||||
'lang_danger' => json_encode($lang['danger']),
|
'lang_danger' => json_encode($lang['danger']),
|
||||||
'lang_syncjobs' => json_encode($lang['syncjobs']),
|
'lang_syncjobs' => json_encode($lang['syncjobs']),
|
||||||
'lang_groups' => json_encode($lang['groups']),
|
'lang_groups' => json_encode($lang['groups']),
|
||||||
'lang_mail_policy' => json_encode($lang['mail_policy'] ?? []),
|
|
||||||
'lang_retention' => json_encode($lang['retention'] ?? []),
|
|
||||||
'lang_backup' => json_encode($lang['backup'] ?? []),
|
|
||||||
'docker_timeout' => $DOCKER_TIMEOUT,
|
'docker_timeout' => $DOCKER_TIMEOUT,
|
||||||
'session_lifetime' => (int)$SESSION_LIFETIME,
|
'session_lifetime' => (int)$SESSION_LIFETIME,
|
||||||
'csrf_token' => $_SESSION['CSRF']['TOKEN'],
|
'csrf_token' => $_SESSION['CSRF']['TOKEN'],
|
||||||
|
|||||||
@@ -74,15 +74,6 @@ function admin($_action, $_data = null) {
|
|||||||
$usernames = $_data['username'];
|
$usernames = $_data['username'];
|
||||||
}
|
}
|
||||||
foreach ($usernames as $username) {
|
foreach ($usernames as $username) {
|
||||||
// A pending password update only allows changing the own password
|
|
||||||
if (!empty($_SESSION['pending_pw_update']) && $username != $_SESSION['mailcow_cc_username']) {
|
|
||||||
$_SESSION['return'][] = array(
|
|
||||||
'type' => 'danger',
|
|
||||||
'log' => array(__FUNCTION__, $_action, $_data_log),
|
|
||||||
'msg' => 'access_denied'
|
|
||||||
);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$is_now = admin('details', $username);
|
$is_now = admin('details', $username);
|
||||||
if (!empty($is_now)) {
|
if (!empty($is_now)) {
|
||||||
$active = (isset($_data['active'])) ? intval($_data['active']) : $is_now['active'];
|
$active = (isset($_data['active'])) ? intval($_data['active']) : $is_now['active'];
|
||||||
|
|||||||
@@ -5,15 +5,6 @@ function app_passwd($_action, $_data = null) {
|
|||||||
$_data_log = $_data;
|
$_data_log = $_data;
|
||||||
!isset($_data_log['app_passwd']) ?: $_data_log['app_passwd'] = '*';
|
!isset($_data_log['app_passwd']) ?: $_data_log['app_passwd'] = '*';
|
||||||
!isset($_data_log['app_passwd2']) ?: $_data_log['app_passwd2'] = '*';
|
!isset($_data_log['app_passwd2']) ?: $_data_log['app_passwd2'] = '*';
|
||||||
if (in_array($_action, array('add', 'edit', 'delete')) &&
|
|
||||||
(!isset($_SESSION['acl']['app_passwds']) || $_SESSION['acl']['app_passwds'] != "1")) {
|
|
||||||
$_SESSION['return'][] = array(
|
|
||||||
'type' => 'danger',
|
|
||||||
'log' => array(__FUNCTION__, $_action, $_data_log),
|
|
||||||
'msg' => 'access_denied'
|
|
||||||
);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (isset($_data['username']) && filter_var($_data['username'], FILTER_VALIDATE_EMAIL)) {
|
if (isset($_data['username']) && filter_var($_data['username'], FILTER_VALIDATE_EMAIL)) {
|
||||||
if (!hasMailboxObjectAccess($_SESSION['mailcow_cc_username'], $_SESSION['mailcow_cc_role'], $_data['username'])) {
|
if (!hasMailboxObjectAccess($_SESSION['mailcow_cc_username'], $_SESSION['mailcow_cc_role'], $_data['username'])) {
|
||||||
$_SESSION['return'][] = array(
|
$_SESSION['return'][] = array(
|
||||||
|
|||||||
@@ -6,8 +6,6 @@ function check_login($user, $pass, $extra = null) {
|
|||||||
$is_internal = $extra['is_internal'];
|
$is_internal = $extra['is_internal'];
|
||||||
$role = $extra['role'];
|
$role = $extra['role'];
|
||||||
$extra['service'] = !isset($extra['service']) ? 'NONE' : $extra['service'];
|
$extra['service'] = !isset($extra['service']) ? 'NONE' : $extra['service'];
|
||||||
// set when the password is right, but the account does not allow this login
|
|
||||||
$denied = false;
|
|
||||||
|
|
||||||
// Try validate admin
|
// Try validate admin
|
||||||
if (!isset($role) || $role == "admin") {
|
if (!isset($role) || $role == "admin") {
|
||||||
@@ -28,7 +26,7 @@ function check_login($user, $pass, $extra = null) {
|
|||||||
|
|
||||||
// Try validate app password
|
// Try validate app password
|
||||||
if (!isset($role) || $role == "app") {
|
if (!isset($role) || $role == "app") {
|
||||||
$result = apppass_login($user, $pass, $extra, $denied);
|
$result = apppass_login($user, $pass, $extra);
|
||||||
if ($result !== false) {
|
if ($result !== false) {
|
||||||
$real_rip = ($_SERVER['HTTP_X_REAL_IP'] ?? $_SERVER['REMOTE_ADDR']);
|
$real_rip = ($_SERVER['HTTP_X_REAL_IP'] ?? $_SERVER['REMOTE_ADDR']);
|
||||||
set_sasl_log($user, $real_rip, $extra['service'], $pass);
|
set_sasl_log($user, $real_rip, $extra['service'], $pass);
|
||||||
@@ -39,7 +37,7 @@ function check_login($user, $pass, $extra = null) {
|
|||||||
// Try validate user
|
// Try validate user
|
||||||
if (!isset($role) || $role == "user") {
|
if (!isset($role) || $role == "user") {
|
||||||
try {
|
try {
|
||||||
$result = user_login($user, $pass, $extra, $denied);
|
$result = user_login($user, $pass, $extra);
|
||||||
} catch (\Mailcow\Auth\IdpUnavailable $e) {
|
} catch (\Mailcow\Auth\IdpUnavailable $e) {
|
||||||
// no failed login, netfilter must not count it
|
// no failed login, netfilter must not count it
|
||||||
error_log("mailcow UI: Identity provider unavailable for " . $user . " by " . $_SERVER['REMOTE_ADDR'] . ": " . $e->getMessage());
|
error_log("mailcow UI: Identity provider unavailable for " . $user . " by " . $_SERVER['REMOTE_ADDR'] . ": " . $e->getMessage());
|
||||||
@@ -56,20 +54,19 @@ function check_login($user, $pass, $extra = null) {
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// skip log and only return false if it's an internal request
|
// skip log and only return false if it's an internal request
|
||||||
if ($is_internal == true) return false;
|
if ($is_internal == true) return false;
|
||||||
|
|
||||||
// A denied login is logged, but not counted by netfilter (e.g. EAS/DAV clients of accounts without access)
|
|
||||||
$msg = ($denied ? "mailcow UI: Login denied for " : "mailcow UI: Invalid password for ") . $user . " by " . $_SERVER['REMOTE_ADDR'];
|
|
||||||
if (!isset($_SESSION['ldelay'])) {
|
if (!isset($_SESSION['ldelay'])) {
|
||||||
$_SESSION['ldelay'] = "0";
|
$_SESSION['ldelay'] = "0";
|
||||||
if (!$denied) $redis->publish("F2B_CHANNEL", $msg);
|
$redis->publish("F2B_CHANNEL", "mailcow UI: Invalid password for " . $user . " by " . $_SERVER['REMOTE_ADDR']);
|
||||||
error_log($msg);
|
error_log("mailcow UI: Invalid password for " . $user . " by " . $_SERVER['REMOTE_ADDR']);
|
||||||
}
|
}
|
||||||
elseif (!isset($_SESSION['mailcow_cc_username'])) {
|
elseif (!isset($_SESSION['mailcow_cc_username'])) {
|
||||||
$_SESSION['ldelay'] = $_SESSION['ldelay']+0.5;
|
$_SESSION['ldelay'] = $_SESSION['ldelay']+0.5;
|
||||||
if (!$denied) $redis->publish("F2B_CHANNEL", $msg);
|
$redis->publish("F2B_CHANNEL", "mailcow UI: Invalid password for " . $user . " by " . $_SERVER['REMOTE_ADDR']);
|
||||||
error_log($msg);
|
error_log("mailcow UI: Invalid password for " . $user . " by " . $_SERVER['REMOTE_ADDR']);
|
||||||
}
|
}
|
||||||
$_SESSION['return'][] = array(
|
$_SESSION['return'][] = array(
|
||||||
'type' => 'danger',
|
'type' => 'danger',
|
||||||
@@ -210,7 +207,7 @@ function domainadmin_login($user, $pass){
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
function user_login($user, $pass, $extra = null, &$denied = false){
|
function user_login($user, $pass, $extra = null){
|
||||||
global $pdo;
|
global $pdo;
|
||||||
global $iam_provider;
|
global $iam_provider;
|
||||||
global $iam_settings;
|
global $iam_settings;
|
||||||
@@ -264,14 +261,11 @@ function user_login($user, $pass, $extra = null, &$denied = false){
|
|||||||
if ($extra['service'] != 'NONE') {
|
if ($extra['service'] != 'NONE') {
|
||||||
$key = strtolower($extra['service']) . "_access";
|
$key = strtolower($extra['service']) . "_access";
|
||||||
if (isset($row['attributes'][$key]) && $row['attributes'][$key] != '1') {
|
if (isset($row['attributes'][$key]) && $row['attributes'][$key] != '1') {
|
||||||
$denied = true;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// the IdP accepted the password, the mailbox is inactive
|
|
||||||
$denied = true;
|
|
||||||
}
|
}
|
||||||
clear_session();
|
clear_session();
|
||||||
return false;
|
return false;
|
||||||
@@ -279,16 +273,18 @@ function user_login($user, $pass, $extra = null, &$denied = false){
|
|||||||
|
|
||||||
// check if user has access to service (imap, smtp, pop3, sieve) if service is set
|
// check if user has access to service (imap, smtp, pop3, sieve) if service is set
|
||||||
$row['attributes'] = json_decode($row['attributes'], true);
|
$row['attributes'] = json_decode($row['attributes'], true);
|
||||||
$key = strtolower($extra['service']) . "_access";
|
// Shared mailboxes have no login of their own, members open them through group shares
|
||||||
// Shared mailboxes have no login of their own, members open them through group shares.
|
if (($row['attributes']['shared'] ?? '0') == '1') {
|
||||||
// Checked before asking an IdP (no template side effects).
|
return false;
|
||||||
if (($row['attributes']['shared'] ?? '0') == '1'
|
}
|
||||||
|| ($extra['service'] != 'NONE' && isset($row['attributes'][$key]) && $row['attributes'][$key] != '1')
|
if ($extra['service'] != 'NONE') {
|
||||||
|| $row['active'] != '1' || $row['d_active'] != '1') {
|
$key = strtolower($extra['service']) . "_access";
|
||||||
// Denied, not failed, unless the password is wrong; IdP passwords are not checked for that
|
if (isset($row['attributes'][$key]) && $row['attributes'][$key] != '1') {
|
||||||
if ($row['authsource'] != 'mailcow' || verify_hash($row['password'], $pass) !== false) {
|
return false;
|
||||||
$denied = true;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// IdP accounts: refuse inactive mailboxes and domains before asking the IdP (no template side effects)
|
||||||
|
if ($row['authsource'] != 'mailcow' && ($row['active'] != '1' || $row['d_active'] != '1')) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
switch ($row['authsource']) {
|
switch ($row['authsource']) {
|
||||||
@@ -307,7 +303,6 @@ function user_login($user, $pass, $extra = null, &$denied = false){
|
|||||||
$stmt->execute(array(':user' => $user));
|
$stmt->execute(array(':user' => $user));
|
||||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
if (empty($row)) {
|
if (empty($row)) {
|
||||||
$denied = true;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,7 +361,6 @@ function user_login($user, $pass, $extra = null, &$denied = false){
|
|||||||
$stmt->execute(array(':user' => $user));
|
$stmt->execute(array(':user' => $user));
|
||||||
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
$row = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
if (empty($row)) {
|
if (empty($row)) {
|
||||||
$denied = true;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -409,6 +403,9 @@ function user_login($user, $pass, $extra = null, &$denied = false){
|
|||||||
return $result;
|
return $result;
|
||||||
break;
|
break;
|
||||||
case 'mailcow':
|
case 'mailcow':
|
||||||
|
if ($row['active'] != 1 || $row['d_active'] != 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// verify password
|
// verify password
|
||||||
if (verify_hash($row['password'], $pass) !== false) {
|
if (verify_hash($row['password'], $pass) !== false) {
|
||||||
|
|
||||||
@@ -449,15 +446,13 @@ function user_login($user, $pass, $extra = null, &$denied = false){
|
|||||||
}
|
}
|
||||||
return "user";
|
return "user";
|
||||||
}
|
}
|
||||||
// TFA accounts use app passwords in mail clients
|
|
||||||
$denied = true;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
function apppass_login($user, $pass, $extra = null, &$denied = false){
|
function apppass_login($user, $pass, $extra = null){
|
||||||
global $pdo;
|
global $pdo;
|
||||||
|
|
||||||
$is_internal = $extra['is_internal'];
|
$is_internal = $extra['is_internal'];
|
||||||
@@ -478,12 +473,15 @@ function apppass_login($user, $pass, $extra = null, &$denied = false){
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// fetch app password data, inactive ones too: their right password is denied, not failed
|
// fetch app password data
|
||||||
$stmt = $pdo->prepare("SELECT `app_passwd`.*, `app_passwd`.`password` as `password`, `app_passwd`.`id` as `app_passwd_id`,
|
$stmt = $pdo->prepare("SELECT `app_passwd`.*, `app_passwd`.`password` as `password`, `app_passwd`.`id` as `app_passwd_id` FROM `app_passwd`
|
||||||
`mailbox`.`active` as `mailbox_active`, `domain`.`active` as `domain_active`, `mailbox`.`attributes` as `mailbox_attributes` FROM `app_passwd`
|
|
||||||
INNER JOIN `mailbox` ON `mailbox`.`username` = `app_passwd`.`mailbox`
|
INNER JOIN `mailbox` ON `mailbox`.`username` = `app_passwd`.`mailbox`
|
||||||
INNER JOIN `domain` ON `mailbox`.`domain` = `domain`.`domain`
|
INNER JOIN `domain` ON `mailbox`.`domain` = `domain`.`domain`
|
||||||
WHERE `mailbox`.`kind` NOT REGEXP 'location|thing|group'
|
WHERE `mailbox`.`kind` NOT REGEXP 'location|thing|group'
|
||||||
|
AND `mailbox`.`active` = '1'
|
||||||
|
AND `domain`.`active` = '1'
|
||||||
|
AND `app_passwd`.`active` = '1'
|
||||||
|
AND COALESCE(JSON_UNQUOTE(JSON_VALUE(`mailbox`.`attributes`, '$.shared')), '0') != '1'
|
||||||
AND `app_passwd`.`mailbox` = :user"
|
AND `app_passwd`.`mailbox` = :user"
|
||||||
);
|
);
|
||||||
// fetch password data
|
// fetch password data
|
||||||
@@ -493,25 +491,16 @@ function apppass_login($user, $pass, $extra = null, &$denied = false){
|
|||||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
|
if ($extra['service'] != 'NONE' && $row[strtolower($extra['service']) . '_access'] != '1'){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// verify password
|
// verify password
|
||||||
if (verify_hash($row['password'], $pass) === false) {
|
if (verify_hash($row['password'], $pass) !== false) {
|
||||||
continue;
|
$_SESSION['app_passwd_id'] = $row['app_passwd_id'];
|
||||||
|
unset($_SESSION['ldelay']);
|
||||||
|
return "user";
|
||||||
}
|
}
|
||||||
|
|
||||||
$key = strtolower($extra['service']) . '_access';
|
|
||||||
$mailbox_attributes = json_decode($row['mailbox_attributes'], true);
|
|
||||||
// the protocols of the mailbox only limit direct user access, app passwords have their own
|
|
||||||
if ($row['active'] != '1' || $row['mailbox_active'] != '1' || $row['domain_active'] != '1'
|
|
||||||
|| ($mailbox_attributes['shared'] ?? '0') == '1'
|
|
||||||
|| ($extra['service'] != 'NONE' && $row[$key] != '1')) {
|
|
||||||
// right password, but the app password does not allow this login
|
|
||||||
$denied = true;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$_SESSION['app_passwd_id'] = $row['app_passwd_id'];
|
|
||||||
unset($_SESSION['ldelay']);
|
|
||||||
return "user";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -549,8 +538,7 @@ function keycloak_mbox_login_rest($user, $pass, $extra = null){
|
|||||||
|
|
||||||
// get the mailcow_password attribute from keycloak user
|
// get the mailcow_password attribute from keycloak user
|
||||||
$url = "{$iam_settings['server_url']}/admin/realms/{$iam_settings['realm']}/users";
|
$url = "{$iam_settings['server_url']}/admin/realms/{$iam_settings['realm']}/users";
|
||||||
// as string, http_build_query() would send exact=1 and Keycloak would search for substrings
|
$queryParams = array('email' => $user, 'exact' => true);
|
||||||
$queryParams = array('email' => $user, 'exact' => 'true');
|
|
||||||
$queryString = http_build_query($queryParams);
|
$queryString = http_build_query($queryParams);
|
||||||
$curl = curl_init();
|
$curl = curl_init();
|
||||||
curl_setopt($curl, CURLOPT_TIMEOUT, 7);
|
curl_setopt($curl, CURLOPT_TIMEOUT, 7);
|
||||||
@@ -571,10 +559,7 @@ function keycloak_mbox_login_rest($user, $pass, $extra = null){
|
|||||||
if ($code != 200) {
|
if ($code != 200) {
|
||||||
throw new \Mailcow\Auth\IdpUnavailable('Keycloak returned HTTP ' . $code);
|
throw new \Mailcow\Auth\IdpUnavailable('Keycloak returned HTTP ' . $code);
|
||||||
}
|
}
|
||||||
// exact=true can still return several users with that email, only the exact address counts
|
// exact=true can still return several users with that email
|
||||||
if (is_array($users)) {
|
|
||||||
$users = array_values(array_filter($users, fn($u) => is_array($u) && strcasecmp((string)($u['email'] ?? ''), $user) === 0));
|
|
||||||
}
|
|
||||||
if (!is_array($users) || count($users) != 1) {
|
if (!is_array($users) || count($users) != 1) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -601,13 +586,6 @@ function keycloak_mbox_login_rest($user, $pass, $extra = null){
|
|||||||
|
|
||||||
// validate mailcow_password
|
// validate mailcow_password
|
||||||
$mailcow_password = $user_res['attributes']['mailcow_password'][0];
|
$mailcow_password = $user_res['attributes']['mailcow_password'][0];
|
||||||
// Keycloak returns binary LDAP attributes like userPassword Base64 encoded
|
|
||||||
if (substr($mailcow_password, 0, 1) != '{') {
|
|
||||||
$decoded_password = base64_decode($mailcow_password, true);
|
|
||||||
if ($decoded_password !== false && substr($decoded_password, 0, 1) == '{') {
|
|
||||||
$mailcow_password = $decoded_password;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!verify_hash($mailcow_password, $pass)) {
|
if (!verify_hash($mailcow_password, $pass)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -732,15 +710,12 @@ function ldap_mbox_login($user, $pass, $extra = null){
|
|||||||
->select(array_values(array_filter(array_merge([$iam_settings['username_field'], $iam_settings['attribute_field'], 'displayname', 'distinguishedname', 'dn'],
|
->select(array_values(array_filter(array_merge([$iam_settings['username_field'], $iam_settings['attribute_field'], 'displayname', 'distinguishedname', 'dn'],
|
||||||
\Mailcow\Identity\Directory\LdapDirectory::idAttributes($iam_settings['id_attribute'] ?? '')))));
|
\Mailcow\Identity\Directory\LdapDirectory::idAttributes($iam_settings['id_attribute'] ?? '')))));
|
||||||
|
|
||||||
$entries = $ldap_query->get();
|
$user_res = $ldap_query->firstOrFail();
|
||||||
|
} catch (\LdapRecord\Query\ObjectNotFoundException $e) {
|
||||||
|
return false;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new \Mailcow\Auth\IdpUnavailable('LDAP search failed: ' . $e->getMessage(), 0, $e);
|
throw new \Mailcow\Auth\IdpUnavailable('LDAP search failed: ' . $e->getMessage(), 0, $e);
|
||||||
}
|
}
|
||||||
// the login name must identify exactly one entry, several matches are ambiguous
|
|
||||||
if (!is_array($entries) || count($entries) != 1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$user_res = reset($entries);
|
|
||||||
$idp_login = \Mailcow\Auth\AuthModule::fromGlobals()->idp;
|
$idp_login = \Mailcow\Auth\AuthModule::fromGlobals()->idp;
|
||||||
if (!$idp_login->verifyLdapPassword($iam_provider, (string)$user_res['dn'], (string)$pass)) {
|
if (!$idp_login->verifyLdapPassword($iam_provider, (string)$user_res['dn'], (string)$pass)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -145,28 +145,6 @@ function fail2ban($_action, $_data = null, $_extra = null) {
|
|||||||
);
|
);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Queue all automatic bans for unbanning, the denylist stays
|
|
||||||
elseif ($_data['action'] == "unban-all") {
|
|
||||||
try {
|
|
||||||
foreach ($redis->hKeys('F2B_ACTIVE_BANS') as $network) {
|
|
||||||
$redis->hSet('F2B_QUEUE_UNBAN', $network, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (RedisException $e) {
|
|
||||||
$_SESSION['return'][] = array(
|
|
||||||
'type' => 'danger',
|
|
||||||
'log' => array(__FUNCTION__, $_action, $_data_log),
|
|
||||||
'msg' => array('redis_error', $e)
|
|
||||||
);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$_SESSION['return'][] = array(
|
|
||||||
'type' => 'success',
|
|
||||||
'log' => array(__FUNCTION__, $_action, $_data_log),
|
|
||||||
'msg' => 'f2b_modified'
|
|
||||||
);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start actions in dependency of network
|
// Start actions in dependency of network
|
||||||
if (!empty($_data['network'])) {
|
if (!empty($_data['network'])) {
|
||||||
|
|||||||
@@ -35,13 +35,6 @@ function fwdhost($_action, $_data = null) {
|
|||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$hosts = array_unique(array_map(function ($host) {
|
|
||||||
$net = explode('/', $host, 2);
|
|
||||||
if (filter_var($net[0], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
|
|
||||||
$net[0] = inet_ntop(inet_pton($net[0]));
|
|
||||||
}
|
|
||||||
return implode('/', $net);
|
|
||||||
}, $hosts));
|
|
||||||
foreach ($hosts as $host) {
|
foreach ($hosts as $host) {
|
||||||
try {
|
try {
|
||||||
$redis->hSet('WHITELISTED_FWD_HOST', $host, $source);
|
$redis->hSet('WHITELISTED_FWD_HOST', $host, $source);
|
||||||
|
|||||||
@@ -539,7 +539,6 @@ function sys_mail($_data) {
|
|||||||
$mail->Body = $mass_text;
|
$mail->Body = $mass_text;
|
||||||
}
|
}
|
||||||
$mail->XMailer = 'MooMassMail';
|
$mail->XMailer = 'MooMassMail';
|
||||||
$archive = \Mailcow\Archive\ArchiveModule::fromGlobals();
|
|
||||||
foreach ($rcpts as $rcpt) {
|
foreach ($rcpts as $rcpt) {
|
||||||
$mail->AddAddress($rcpt);
|
$mail->AddAddress($rcpt);
|
||||||
if (!$mail->send()) {
|
if (!$mail->send()) {
|
||||||
@@ -549,10 +548,6 @@ function sys_mail($_data) {
|
|||||||
'msg' => 'Mailer error (RCPT "' . htmlspecialchars($rcpt) . '"): ' . str_replace('https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting', '', $mail->ErrorInfo)
|
'msg' => 'Mailer error (RCPT "' . htmlspecialchars($rcpt) . '"): ' . str_replace('https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting', '', $mail->ErrorInfo)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
// Delivered by LMTP without rspamd, so the archive gets it here
|
|
||||||
$archive->journal->submitDelivered($mail->getSentMIMEMessage(), $mass_from, array($rcpt), 'massmail');
|
|
||||||
}
|
|
||||||
$mail->ClearAllRecipients();
|
$mail->ClearAllRecipients();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1399,18 +1394,6 @@ function set_tfa($_data) {
|
|||||||
case "webauthn":
|
case "webauthn":
|
||||||
$key_id = (!isset($_data["key_id"])) ? 'unidentified' : $_data["key_id"];
|
$key_id = (!isset($_data["key_id"])) ? 'unidentified' : $_data["key_id"];
|
||||||
|
|
||||||
// Refuse incomplete WebAuthn registrations. Without this guard a request
|
|
||||||
// that does not contain the parsed credential data (e.g. a plain form
|
|
||||||
// POST) would silently insert an empty keyHandle while reporting success.
|
|
||||||
if (empty($_data['registration']) || empty($_data['registration']->credentialId)) {
|
|
||||||
$_SESSION['return'][] = array(
|
|
||||||
'type' => 'danger',
|
|
||||||
'log' => array(__FUNCTION__, $_data_log),
|
|
||||||
'msg' => 'webauthn_registration_failed'
|
|
||||||
);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$stmt = $pdo->prepare("INSERT INTO `tfa` (`username`, `key_id`, `authmech`, `keyHandle`, `publicKey`, `certificate`, `counter`, `active`)
|
$stmt = $pdo->prepare("INSERT INTO `tfa` (`username`, `key_id`, `authmech`, `keyHandle`, `publicKey`, `certificate`, `counter`, `active`)
|
||||||
VALUES (?, ?, 'webauthn', ?, ?, ?, ?, '1')");
|
VALUES (?, ?, 'webauthn', ?, ?, ?, ?, '1')");
|
||||||
$stmt->execute(array(
|
$stmt->execute(array(
|
||||||
@@ -1433,11 +1416,11 @@ function set_tfa($_data) {
|
|||||||
// Block TFA removal if force_tfa policy is active
|
// Block TFA removal if force_tfa policy is active
|
||||||
$is_forced_tfa = false;
|
$is_forced_tfa = false;
|
||||||
if ($_SESSION['mailcow_cc_role'] === 'user') {
|
if ($_SESSION['mailcow_cc_role'] === 'user') {
|
||||||
$stmt_check = $pdo->prepare("SELECT JSON_VALUE(`attributes`, '$.force_tfa') FROM `mailbox` WHERE `username` = ?");
|
$stmt_check = $pdo->prepare("SELECT JSON_EXTRACT(`attributes`, '$.force_tfa') FROM `mailbox` WHERE `username` = ?");
|
||||||
$stmt_check->execute(array($username));
|
$stmt_check->execute(array($username));
|
||||||
$is_forced_tfa = ($stmt_check->fetchColumn() == '1');
|
$is_forced_tfa = ($stmt_check->fetchColumn() == '1');
|
||||||
} else {
|
} else {
|
||||||
$stmt_check = $pdo->prepare("SELECT JSON_VALUE(`attributes`, '$.force_tfa') FROM `admin` WHERE `username` = ?");
|
$stmt_check = $pdo->prepare("SELECT JSON_EXTRACT(`attributes`, '$.force_tfa') FROM `admin` WHERE `username` = ?");
|
||||||
$stmt_check->execute(array($username));
|
$stmt_check->execute(array($username));
|
||||||
$is_forced_tfa = ($stmt_check->fetchColumn() == '1');
|
$is_forced_tfa = ($stmt_check->fetchColumn() == '1');
|
||||||
}
|
}
|
||||||
@@ -1704,11 +1687,11 @@ function unset_tfa_key($_data) {
|
|||||||
// Block key removal if force_tfa policy is active
|
// Block key removal if force_tfa policy is active
|
||||||
$is_forced_tfa = false;
|
$is_forced_tfa = false;
|
||||||
if ($_SESSION['mailcow_cc_role'] === 'user') {
|
if ($_SESSION['mailcow_cc_role'] === 'user') {
|
||||||
$stmt_check = $pdo->prepare("SELECT JSON_VALUE(`attributes`, '$.force_tfa') FROM `mailbox` WHERE `username` = ?");
|
$stmt_check = $pdo->prepare("SELECT JSON_EXTRACT(`attributes`, '$.force_tfa') FROM `mailbox` WHERE `username` = ?");
|
||||||
$stmt_check->execute(array($username));
|
$stmt_check->execute(array($username));
|
||||||
$is_forced_tfa = ($stmt_check->fetchColumn() == '1');
|
$is_forced_tfa = ($stmt_check->fetchColumn() == '1');
|
||||||
} else {
|
} else {
|
||||||
$stmt_check = $pdo->prepare("SELECT JSON_VALUE(`attributes`, '$.force_tfa') FROM `admin` WHERE `username` = ?");
|
$stmt_check = $pdo->prepare("SELECT JSON_EXTRACT(`attributes`, '$.force_tfa') FROM `admin` WHERE `username` = ?");
|
||||||
$stmt_check->execute(array($username));
|
$stmt_check->execute(array($username));
|
||||||
$is_forced_tfa = ($stmt_check->fetchColumn() == '1');
|
$is_forced_tfa = ($stmt_check->fetchColumn() == '1');
|
||||||
}
|
}
|
||||||
@@ -1874,40 +1857,6 @@ function get_tfa($username = null, $id = null) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function verify_tfa_login($username, $_data) {
|
function verify_tfa_login($username, $_data) {
|
||||||
global $redis;
|
|
||||||
global $TFA_MAX_FAILS;
|
|
||||||
global $TFA_FAIL_WINDOW;
|
|
||||||
|
|
||||||
if (empty($username)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Count failed second factors per account, so codes cannot be guessed from many addresses
|
|
||||||
$fails_key = 'TFA_FAILS_' . $username;
|
|
||||||
if (intval($redis->get($fails_key)) >= $TFA_MAX_FAILS) {
|
|
||||||
$_SESSION['return'][] = array(
|
|
||||||
'type' => 'danger',
|
|
||||||
'log' => array(__FUNCTION__, $username, '*'),
|
|
||||||
'msg' => 'tfa_login_locked'
|
|
||||||
);
|
|
||||||
$verified = false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$verified = verify_tfa_token($username, $_data);
|
|
||||||
}
|
|
||||||
if ($verified !== true) {
|
|
||||||
// The window starts with the first failure and is not extended by further attempts
|
|
||||||
if ($redis->incr($fails_key) == 1) {
|
|
||||||
$redis->expire($fails_key, $TFA_FAIL_WINDOW);
|
|
||||||
}
|
|
||||||
// Same message format as failed passwords, so the default fail2ban rule counts it
|
|
||||||
error_log("mailcow UI: Invalid password for " . $username . " (second factor) by " . $_SERVER['REMOTE_ADDR']);
|
|
||||||
$redis->publish("F2B_CHANNEL", "mailcow UI: Invalid password for " . $username . " (second factor) by " . $_SERVER['REMOTE_ADDR']);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$redis->del($fails_key);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
function verify_tfa_token($username, $_data) {
|
|
||||||
global $pdo;
|
global $pdo;
|
||||||
global $yubi;
|
global $yubi;
|
||||||
global $u2f;
|
global $u2f;
|
||||||
@@ -2437,7 +2386,7 @@ function identity_provider($_action = null, $_data = null, $_extra = null) {
|
|||||||
case "use_ssl":
|
case "use_ssl":
|
||||||
case "use_tls":
|
case "use_tls":
|
||||||
case "login_provisioning":
|
case "login_provisioning":
|
||||||
case "ignore_ssl_error":
|
case "ignore_ssl_errors":
|
||||||
$settings[$row["key"]] = boolval($row["value"]);
|
$settings[$row["key"]] = boolval($row["value"]);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -2461,7 +2410,7 @@ function identity_provider($_action = null, $_data = null, $_extra = null) {
|
|||||||
if ($settings["authsource"] == "ldap"){
|
if ($settings["authsource"] == "ldap"){
|
||||||
$settings['use_ssl'] = !isset($settings['use_ssl']) ? false : $settings['use_ssl'];
|
$settings['use_ssl'] = !isset($settings['use_ssl']) ? false : $settings['use_ssl'];
|
||||||
$settings['use_tls'] = !isset($settings['use_tls']) ? false : $settings['use_tls'];
|
$settings['use_tls'] = !isset($settings['use_tls']) ? false : $settings['use_tls'];
|
||||||
$settings['ignore_ssl_error'] = !isset($settings['ignore_ssl_error']) ? false : $settings['ignore_ssl_error'];
|
$settings['ignore_ssl_errors'] = !isset($settings['ignore_ssl_errors']) ? false : $settings['ignore_ssl_errors'];
|
||||||
}
|
}
|
||||||
return $settings;
|
return $settings;
|
||||||
break;
|
break;
|
||||||
@@ -3064,18 +3013,6 @@ function identity_provider($_action = null, $_data = null, $_extra = null) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// A refresh keeps the logged-in mailbox: a changed IdP email or another IdP user ends the session
|
|
||||||
if (strtolower($info['email']) !== strtolower($_SESSION['mailcow_cc_username'] ?? '') ||
|
|
||||||
!\Mailcow\Auth\AuthModule::fromGlobals()->idp->verifyLink($iam_settings['authsource'], $info['email'], (string)($info['sub'] ?? ''))) {
|
|
||||||
clear_session();
|
|
||||||
$_SESSION['return'][] = array(
|
|
||||||
'type' => 'danger',
|
|
||||||
'log' => array(__FUNCTION__, $info['email'], 'The IdP user does not match the logged-in mailbox'),
|
|
||||||
'msg' => 'refresh_login_failed'
|
|
||||||
);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The mailbox may have been deleted or deactivated since the login
|
// The mailbox may have been deleted or deactivated since the login
|
||||||
$stmt = $pdo->prepare("SELECT `mailbox`.`authsource` FROM `mailbox`
|
$stmt = $pdo->prepare("SELECT `mailbox`.`authsource` FROM `mailbox`
|
||||||
INNER JOIN `domain` ON `mailbox`.`domain` = `domain`.`domain`
|
INNER JOIN `domain` ON `mailbox`.`domain` = `domain`.`domain`
|
||||||
@@ -3123,17 +3060,7 @@ function identity_provider($_action = null, $_data = null, $_extra = null) {
|
|||||||
case "get-keycloak-admin-token":
|
case "get-keycloak-admin-token":
|
||||||
// get access_token for service account of mailcow client
|
// get access_token for service account of mailcow client
|
||||||
if ($iam_settings['authsource'] !== 'keycloak') return false;
|
if ($iam_settings['authsource'] !== 'keycloak') return false;
|
||||||
// only introspect a cached access_token that is not (about to be) expired,
|
if (isset($iam_settings['access_token'])) {
|
||||||
// introspecting an expired token makes Keycloak log INTROSPECT_TOKEN_ERROR
|
|
||||||
$token_not_expired = false;
|
|
||||||
if (!empty($iam_settings['access_token'])) {
|
|
||||||
$token_parts = explode('.', $iam_settings['access_token']);
|
|
||||||
if (count($token_parts) === 3) {
|
|
||||||
$token_payload = json_decode(base64_decode(strtr($token_parts[1], '-_', '+/')), true);
|
|
||||||
$token_not_expired = is_array($token_payload) && isset($token_payload['exp']) && intval($token_payload['exp']) > time() + 30;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($token_not_expired) {
|
|
||||||
// check if access_token is valid
|
// check if access_token is valid
|
||||||
$url = "{$iam_settings['server_url']}/realms/{$iam_settings['realm']}/protocol/openid-connect/token/introspect";
|
$url = "{$iam_settings['server_url']}/realms/{$iam_settings['realm']}/protocol/openid-connect/token/introspect";
|
||||||
$req = http_build_query(array(
|
$req = http_build_query(array(
|
||||||
@@ -3184,8 +3111,6 @@ function identity_provider($_action = null, $_data = null, $_extra = null) {
|
|||||||
':key' => 'access_token',
|
':key' => 'access_token',
|
||||||
':value' => $res['access_token']
|
':value' => $res['access_token']
|
||||||
));
|
));
|
||||||
// keep the cached token in sync, so subsequent calls in the same run reuse it
|
|
||||||
$iam_settings['access_token'] = $res['access_token'];
|
|
||||||
return $res['access_token'];
|
return $res['access_token'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -366,7 +366,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
$relay_unknown_only = (isset($_data['relay_unknown_only'])) ? intval($_data['relay_unknown_only']) : $DOMAIN_DEFAULT_ATTRIBUTES['relay_unknown_only'];
|
$relay_unknown_only = (isset($_data['relay_unknown_only'])) ? intval($_data['relay_unknown_only']) : $DOMAIN_DEFAULT_ATTRIBUTES['relay_unknown_only'];
|
||||||
$backupmx = (isset($_data['backupmx'])) ? intval($_data['backupmx']) : $DOMAIN_DEFAULT_ATTRIBUTES['backupmx'];
|
$backupmx = (isset($_data['backupmx'])) ? intval($_data['backupmx']) : $DOMAIN_DEFAULT_ATTRIBUTES['backupmx'];
|
||||||
$gal = (isset($_data['gal'])) ? intval($_data['gal']) : $DOMAIN_DEFAULT_ATTRIBUTES['gal'];
|
$gal = (isset($_data['gal'])) ? intval($_data['gal']) : $DOMAIN_DEFAULT_ATTRIBUTES['gal'];
|
||||||
$archive = (intval((isset($_data['archive'])) ? $_data['archive'] : ($DOMAIN_DEFAULT_ATTRIBUTES['archive'] ?? 0)) == 1) ? 1 : 0;
|
|
||||||
if ($relay_all_recipients == 1) {
|
if ($relay_all_recipients == 1) {
|
||||||
$backupmx = '1';
|
$backupmx = '1';
|
||||||
}
|
}
|
||||||
@@ -422,8 +421,8 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
':domain' => '%@' . $domain
|
':domain' => '%@' . $domain
|
||||||
));
|
));
|
||||||
// save domain
|
// save domain
|
||||||
$stmt = $pdo->prepare("INSERT INTO `domain` (`domain`, `description`, `aliases`, `mailboxes`, `defquota`, `maxquota`, `quota`, `backupmx`, `gal`, `active`, `relay_unknown_only`, `relay_all_recipients`, `archive`)
|
$stmt = $pdo->prepare("INSERT INTO `domain` (`domain`, `description`, `aliases`, `mailboxes`, `defquota`, `maxquota`, `quota`, `backupmx`, `gal`, `active`, `relay_unknown_only`, `relay_all_recipients`)
|
||||||
VALUES (:domain, :description, :aliases, :mailboxes, :defquota, :maxquota, :quota, :backupmx, :gal, :active, :relay_unknown_only, :relay_all_recipients, :archive)");
|
VALUES (:domain, :description, :aliases, :mailboxes, :defquota, :maxquota, :quota, :backupmx, :gal, :active, :relay_unknown_only, :relay_all_recipients)");
|
||||||
$stmt->execute(array(
|
$stmt->execute(array(
|
||||||
':domain' => $domain,
|
':domain' => $domain,
|
||||||
':description' => $description,
|
':description' => $description,
|
||||||
@@ -436,8 +435,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
':gal' => $gal,
|
':gal' => $gal,
|
||||||
':active' => $active,
|
':active' => $active,
|
||||||
':relay_unknown_only' => $relay_unknown_only,
|
':relay_unknown_only' => $relay_unknown_only,
|
||||||
':relay_all_recipients' => $relay_all_recipients,
|
':relay_all_recipients' => $relay_all_recipients
|
||||||
':archive' => $archive
|
|
||||||
));
|
));
|
||||||
// save tags
|
// save tags
|
||||||
foreach($tags as $index => $tag){
|
foreach($tags as $index => $tag){
|
||||||
@@ -942,8 +940,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
$relayhost = (isset($_data['relayhost'])) ? intval($_data['relayhost']) : 0;
|
$relayhost = (isset($_data['relayhost'])) ? intval($_data['relayhost']) : 0;
|
||||||
// Shared mailbox: no login of its own, members open it through group shares
|
// Shared mailbox: no login of its own, members open it through group shares
|
||||||
$shared = (isset($_data['shared'])) ? intval($_data['shared']) : 0;
|
$shared = (isset($_data['shared'])) ? intval($_data['shared']) : 0;
|
||||||
// Archiving comes from the template unless the caller may set it
|
|
||||||
$archive = \Mailcow\Archive\Model\Mailbox::setting((isset($_data['archive']) && hasACLAccess("archive")) ? $_data['archive'] : ($MAILBOX_DEFAULT_ATTRIBUTES['archive'] ?? 'inherit'));
|
|
||||||
$quarantine_notification = (isset($_data['quarantine_notification'])) ? strval($_data['quarantine_notification']) : strval($MAILBOX_DEFAULT_ATTRIBUTES['quarantine_notification']);
|
$quarantine_notification = (isset($_data['quarantine_notification'])) ? strval($_data['quarantine_notification']) : strval($MAILBOX_DEFAULT_ATTRIBUTES['quarantine_notification']);
|
||||||
$quarantine_category = (isset($_data['quarantine_category'])) ? strval($_data['quarantine_category']) : strval($MAILBOX_DEFAULT_ATTRIBUTES['quarantine_category']);
|
$quarantine_category = (isset($_data['quarantine_category'])) ? strval($_data['quarantine_category']) : strval($MAILBOX_DEFAULT_ATTRIBUTES['quarantine_category']);
|
||||||
// Validate quarantine_category
|
// Validate quarantine_category
|
||||||
@@ -978,7 +974,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
'dav_access' => strval($dav_access),
|
'dav_access' => strval($dav_access),
|
||||||
'relayhost' => strval($relayhost),
|
'relayhost' => strval($relayhost),
|
||||||
'shared' => strval($shared),
|
'shared' => strval($shared),
|
||||||
'archive' => $archive,
|
|
||||||
'passwd_update' => time(),
|
'passwd_update' => time(),
|
||||||
'mailbox_format' => strval($MAILBOX_DEFAULT_ATTRIBUTES['mailbox_format']),
|
'mailbox_format' => strval($MAILBOX_DEFAULT_ATTRIBUTES['mailbox_format']),
|
||||||
'quarantine_notification' => strval($quarantine_notification),
|
'quarantine_notification' => strval($quarantine_notification),
|
||||||
@@ -1530,7 +1525,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
$attr['backupmx'] = (isset($_data['backupmx'])) ? intval($_data['backupmx']) : 0;
|
$attr['backupmx'] = (isset($_data['backupmx'])) ? intval($_data['backupmx']) : 0;
|
||||||
$attr['relay_all_recipients'] = (isset($_data['relay_all_recipients'])) ? intval($_data['relay_all_recipients']) : 0;
|
$attr['relay_all_recipients'] = (isset($_data['relay_all_recipients'])) ? intval($_data['relay_all_recipients']) : 0;
|
||||||
$attr['relay_unknown_only'] = (isset($_data['relay_unknown_only'])) ? intval($_data['relay_unknown_only']) : 0;
|
$attr['relay_unknown_only'] = (isset($_data['relay_unknown_only'])) ? intval($_data['relay_unknown_only']) : 0;
|
||||||
$attr['archive'] = (isset($_data['archive']) && intval($_data['archive']) == 1) ? 1 : 0;
|
|
||||||
$attr['dkim_selector'] = (isset($_data['dkim_selector'])) ? $_data['dkim_selector'] : "dkim";
|
$attr['dkim_selector'] = (isset($_data['dkim_selector'])) ? $_data['dkim_selector'] : "dkim";
|
||||||
$attr['key_size'] = isset($_data['key_size']) ? intval($_data['key_size']) : 2048;
|
$attr['key_size'] = isset($_data['key_size']) ? intval($_data['key_size']) : 2048;
|
||||||
|
|
||||||
@@ -1606,7 +1600,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
$attr["rl_value"] = (!empty($_data['rl_value'])) ? $_data['rl_value'] : "";
|
$attr["rl_value"] = (!empty($_data['rl_value'])) ? $_data['rl_value'] : "";
|
||||||
$attr["force_pw_update"] = isset($_data['force_pw_update']) ? intval($_data['force_pw_update']) : intval($MAILBOX_DEFAULT_ATTRIBUTES['force_pw_update']);
|
$attr["force_pw_update"] = isset($_data['force_pw_update']) ? intval($_data['force_pw_update']) : intval($MAILBOX_DEFAULT_ATTRIBUTES['force_pw_update']);
|
||||||
$attr["force_tfa"] = isset($_data['force_tfa']) ? intval($_data['force_tfa']) : intval($MAILBOX_DEFAULT_ATTRIBUTES['force_tfa']);
|
$attr["force_tfa"] = isset($_data['force_tfa']) ? intval($_data['force_tfa']) : intval($MAILBOX_DEFAULT_ATTRIBUTES['force_tfa']);
|
||||||
$attr["archive"] = \Mailcow\Archive\Model\Mailbox::setting($_data['archive'] ?? $MAILBOX_DEFAULT_ATTRIBUTES['archive']);
|
|
||||||
$attr["sogo_access"] = isset($_data['sogo_access']) ? intval($_data['sogo_access']) : intval($MAILBOX_DEFAULT_ATTRIBUTES['sogo_access']);
|
$attr["sogo_access"] = isset($_data['sogo_access']) ? intval($_data['sogo_access']) : intval($MAILBOX_DEFAULT_ATTRIBUTES['sogo_access']);
|
||||||
$attr["active"] = isset($_data['active']) ? intval($_data['active']) : 1;
|
$attr["active"] = isset($_data['active']) ? intval($_data['active']) : 1;
|
||||||
$attr["tls_enforce_in"] = isset($_data['tls_enforce_in']) ? intval($_data['tls_enforce_in']) : intval($MAILBOX_DEFAULT_ATTRIBUTES['tls_enforce_in']);
|
$attr["tls_enforce_in"] = isset($_data['tls_enforce_in']) ? intval($_data['tls_enforce_in']) : intval($MAILBOX_DEFAULT_ATTRIBUTES['tls_enforce_in']);
|
||||||
@@ -2439,7 +2432,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
if ($address != $is_now['address']) {
|
if ($address != $is_now['address']) {
|
||||||
// Send-as grants of groups follow the address
|
// Send-as grants of groups follow the address
|
||||||
\Mailcow\MailboxGroup\MailboxGroupModule::fromGlobals()->api->addressRenamed($is_now['address'], $address);
|
\Mailcow\MailboxGroup\MailboxGroupModule::fromGlobals()->api->addressRenamed($is_now['address'], $address);
|
||||||
\Mailcow\MailPolicy\MailPolicyModule::fromGlobals()->api->addressRenamed($is_now['address'], $address);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$_SESSION['return'][] = array(
|
$_SESSION['return'][] = array(
|
||||||
@@ -2496,7 +2488,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
$gal = (isset($_data['gal'])) ? intval($_data['gal']) : $is_now['gal'];
|
$gal = (isset($_data['gal'])) ? intval($_data['gal']) : $is_now['gal'];
|
||||||
$description = (!empty($_data['description']) && isset($_SESSION['acl']['domain_desc']) && $_SESSION['acl']['domain_desc'] == "1") ? $_data['description'] : $is_now['description'];
|
$description = (!empty($_data['description']) && isset($_SESSION['acl']['domain_desc']) && $_SESSION['acl']['domain_desc'] == "1") ? $_data['description'] : $is_now['description'];
|
||||||
(int)$relayhost = (isset($_data['relayhost']) && isset($_SESSION['acl']['domain_relayhost']) && $_SESSION['acl']['domain_relayhost'] == "1") ? intval($_data['relayhost']) : intval($is_now['relayhost']);
|
(int)$relayhost = (isset($_data['relayhost']) && isset($_SESSION['acl']['domain_relayhost']) && $_SESSION['acl']['domain_relayhost'] == "1") ? intval($_data['relayhost']) : intval($is_now['relayhost']);
|
||||||
$archive = (isset($_data['archive']) && hasACLAccess("archive")) ? ((intval($_data['archive']) == 1) ? 1 : 0) : intval($is_now['archive']);
|
|
||||||
$tags = (is_array($_data['tags']) ? $_data['tags'] : array());
|
$tags = (is_array($_data['tags']) ? $_data['tags'] : array());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -2510,13 +2501,11 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
|
|
||||||
$stmt = $pdo->prepare("UPDATE `domain` SET
|
$stmt = $pdo->prepare("UPDATE `domain` SET
|
||||||
`description` = :description,
|
`description` = :description,
|
||||||
`gal` = :gal,
|
`gal` = :gal
|
||||||
`archive` = :archive
|
|
||||||
WHERE `domain` = :domain");
|
WHERE `domain` = :domain");
|
||||||
$stmt->execute(array(
|
$stmt->execute(array(
|
||||||
':description' => $description,
|
':description' => $description,
|
||||||
':gal' => $gal,
|
':gal' => $gal,
|
||||||
':archive' => $archive,
|
|
||||||
':domain' => $domain
|
':domain' => $domain
|
||||||
));
|
));
|
||||||
// save tags
|
// save tags
|
||||||
@@ -2535,10 +2524,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
':domain' => $domain,
|
':domain' => $domain,
|
||||||
':tag_name' => $tag,
|
':tag_name' => $tag,
|
||||||
));
|
));
|
||||||
$stmt = $pdo->prepare("UPDATE `domain` SET `modified` = NOW() WHERE `domain` = :domain");
|
|
||||||
$stmt->execute(array(
|
|
||||||
':domain' => $domain,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_SESSION['return'][] = array(
|
$_SESSION['return'][] = array(
|
||||||
@@ -2553,7 +2538,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
$active = (isset($_data['active'])) ? intval($_data['active']) : $is_now['active'];
|
$active = (isset($_data['active'])) ? intval($_data['active']) : $is_now['active'];
|
||||||
$backupmx = (isset($_data['backupmx'])) ? intval($_data['backupmx']) : $is_now['backupmx'];
|
$backupmx = (isset($_data['backupmx'])) ? intval($_data['backupmx']) : $is_now['backupmx'];
|
||||||
$gal = (isset($_data['gal'])) ? intval($_data['gal']) : $is_now['gal'];
|
$gal = (isset($_data['gal'])) ? intval($_data['gal']) : $is_now['gal'];
|
||||||
$archive = (isset($_data['archive'])) ? ((intval($_data['archive']) == 1) ? 1 : 0) : intval($is_now['archive']);
|
|
||||||
$relay_all_recipients = (isset($_data['relay_all_recipients'])) ? intval($_data['relay_all_recipients']) : $is_now['relay_all_recipients'];
|
$relay_all_recipients = (isset($_data['relay_all_recipients'])) ? intval($_data['relay_all_recipients']) : $is_now['relay_all_recipients'];
|
||||||
$relay_unknown_only = (isset($_data['relay_unknown_only'])) ? intval($_data['relay_unknown_only']) : $is_now['relay_unknown_only'];
|
$relay_unknown_only = (isset($_data['relay_unknown_only'])) ? intval($_data['relay_unknown_only']) : $is_now['relay_unknown_only'];
|
||||||
$relayhost = (isset($_data['relayhost'])) ? intval($_data['relayhost']) : $is_now['relayhost'];
|
$relayhost = (isset($_data['relayhost'])) ? intval($_data['relayhost']) : $is_now['relayhost'];
|
||||||
@@ -2668,7 +2652,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
`relay_unknown_only` = :relay_unknown_only,
|
`relay_unknown_only` = :relay_unknown_only,
|
||||||
`backupmx` = :backupmx,
|
`backupmx` = :backupmx,
|
||||||
`gal` = :gal,
|
`gal` = :gal,
|
||||||
`archive` = :archive,
|
|
||||||
`active` = :active,
|
`active` = :active,
|
||||||
`quota` = :quota,
|
`quota` = :quota,
|
||||||
`defquota` = :defquota,
|
`defquota` = :defquota,
|
||||||
@@ -2683,7 +2666,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
':relay_unknown_only' => $relay_unknown_only,
|
':relay_unknown_only' => $relay_unknown_only,
|
||||||
':backupmx' => $backupmx,
|
':backupmx' => $backupmx,
|
||||||
':gal' => $gal,
|
':gal' => $gal,
|
||||||
':archive' => $archive,
|
|
||||||
':active' => $active,
|
':active' => $active,
|
||||||
':quota' => $quota,
|
':quota' => $quota,
|
||||||
':defquota' => $defquota,
|
':defquota' => $defquota,
|
||||||
@@ -2710,10 +2692,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
':domain' => $domain,
|
':domain' => $domain,
|
||||||
':tag_name' => $tag,
|
':tag_name' => $tag,
|
||||||
));
|
));
|
||||||
$stmt = $pdo->prepare("UPDATE `domain` SET `modified` = NOW() WHERE `domain` = :domain");
|
|
||||||
$stmt->execute(array(
|
|
||||||
':domain' => $domain,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_SESSION['return'][] = array(
|
$_SESSION['return'][] = array(
|
||||||
@@ -2775,7 +2753,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
$attr['backupmx'] = (isset($_data['backupmx'])) ? intval($_data['backupmx']) : 0;
|
$attr['backupmx'] = (isset($_data['backupmx'])) ? intval($_data['backupmx']) : 0;
|
||||||
$attr['relay_all_recipients'] = (isset($_data['relay_all_recipients'])) ? intval($_data['relay_all_recipients']) : 0;
|
$attr['relay_all_recipients'] = (isset($_data['relay_all_recipients'])) ? intval($_data['relay_all_recipients']) : 0;
|
||||||
$attr['relay_unknown_only'] = (isset($_data['relay_unknown_only'])) ? intval($_data['relay_unknown_only']) : 0;
|
$attr['relay_unknown_only'] = (isset($_data['relay_unknown_only'])) ? intval($_data['relay_unknown_only']) : 0;
|
||||||
$attr['archive'] = (isset($_data['archive'])) ? ((intval($_data['archive']) == 1) ? 1 : 0) : intval($is_now['attributes']['archive'] ?? 0);
|
|
||||||
$attr['dkim_selector'] = (isset($_data['dkim_selector'])) ? $_data['dkim_selector'] : "dkim";
|
$attr['dkim_selector'] = (isset($_data['dkim_selector'])) ? $_data['dkim_selector'] : "dkim";
|
||||||
$attr['key_size'] = isset($_data['key_size']) ? intval($_data['key_size']) : 2048;
|
$attr['key_size'] = isset($_data['key_size']) ? intval($_data['key_size']) : 2048;
|
||||||
|
|
||||||
@@ -2837,7 +2814,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
(int)$eas_access = (isset($_data['eas_access']) && hasACLAccess("protocol_access")) ? intval($_data['eas_access']) : intval($is_now['attributes']['eas_access']);
|
(int)$eas_access = (isset($_data['eas_access']) && hasACLAccess("protocol_access")) ? intval($_data['eas_access']) : intval($is_now['attributes']['eas_access']);
|
||||||
(int)$dav_access = (isset($_data['dav_access']) && hasACLAccess("protocol_access")) ? intval($_data['dav_access']) : intval($is_now['attributes']['dav_access']);
|
(int)$dav_access = (isset($_data['dav_access']) && hasACLAccess("protocol_access")) ? intval($_data['dav_access']) : intval($is_now['attributes']['dav_access']);
|
||||||
(int)$relayhost = (isset($_data['relayhost']) && hasACLAccess("mailbox_relayhost")) ? intval($_data['relayhost']) : intval($is_now['attributes']['relayhost']);
|
(int)$relayhost = (isset($_data['relayhost']) && hasACLAccess("mailbox_relayhost")) ? intval($_data['relayhost']) : intval($is_now['attributes']['relayhost']);
|
||||||
$archive = \Mailcow\Archive\Model\Mailbox::setting((isset($_data['archive']) && hasACLAccess("archive")) ? $_data['archive'] : ($is_now['attributes']['archive'] ?? null));
|
|
||||||
(int)$shared = (isset($_data['shared'])) ? intval($_data['shared']) : intval($is_now['attributes']['shared'] ?? 0);
|
(int)$shared = (isset($_data['shared'])) ? intval($_data['shared']) : intval($is_now['attributes']['shared'] ?? 0);
|
||||||
(int)$quota_m = (isset_has_content($_data['quota'])) ? intval($_data['quota']) : ($is_now['quota'] / 1048576);
|
(int)$quota_m = (isset_has_content($_data['quota'])) ? intval($_data['quota']) : ($is_now['quota'] / 1048576);
|
||||||
$name = (!empty($_data['name'])) ? ltrim(rtrim($_data['name'], '>'), '<') : $is_now['name'];
|
$name = (!empty($_data['name'])) ? ltrim(rtrim($_data['name'], '>'), '<') : $is_now['name'];
|
||||||
@@ -3138,7 +3114,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
`attributes` = JSON_SET(`attributes`, '$.smtp_access', :smtp_access),
|
`attributes` = JSON_SET(`attributes`, '$.smtp_access', :smtp_access),
|
||||||
`attributes` = JSON_SET(`attributes`, '$.eas_access', :eas_access),
|
`attributes` = JSON_SET(`attributes`, '$.eas_access', :eas_access),
|
||||||
`attributes` = JSON_SET(`attributes`, '$.dav_access', :dav_access),
|
`attributes` = JSON_SET(`attributes`, '$.dav_access', :dav_access),
|
||||||
`attributes` = JSON_SET(`attributes`, '$.archive', :archive),
|
|
||||||
`attributes` = JSON_SET(`attributes`, '$.recovery_email', :recovery_email),
|
`attributes` = JSON_SET(`attributes`, '$.recovery_email', :recovery_email),
|
||||||
`attributes` = JSON_SET(`attributes`, '$.attribute_hash', :attribute_hash)
|
`attributes` = JSON_SET(`attributes`, '$.attribute_hash', :attribute_hash)
|
||||||
WHERE `username` = :username");
|
WHERE `username` = :username");
|
||||||
@@ -3156,7 +3131,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
':smtp_access' => $smtp_access,
|
':smtp_access' => $smtp_access,
|
||||||
':eas_access' => $eas_access,
|
':eas_access' => $eas_access,
|
||||||
':dav_access' => $dav_access,
|
':dav_access' => $dav_access,
|
||||||
':archive' => $archive,
|
|
||||||
':recovery_email' => $pw_recovery_email,
|
':recovery_email' => $pw_recovery_email,
|
||||||
':relayhost' => $relayhost,
|
':relayhost' => $relayhost,
|
||||||
':shared' => strval($shared),
|
':shared' => strval($shared),
|
||||||
@@ -3196,10 +3170,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
':username' => $username,
|
':username' => $username,
|
||||||
':tag_name' => $tag,
|
':tag_name' => $tag,
|
||||||
));
|
));
|
||||||
$stmt = $pdo->prepare("UPDATE `mailbox` SET `modified` = NOW() WHERE `username` = :username");
|
|
||||||
$stmt->execute(array(
|
|
||||||
':username' => $username,
|
|
||||||
));
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3325,9 +3295,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
'mailbox_group_imap_grant' => ['owner'],
|
'mailbox_group_imap_grant' => ['owner'],
|
||||||
'mailbox_group_sogo_grant' => ['owner'],
|
'mailbox_group_sogo_grant' => ['owner'],
|
||||||
'mailbox_group_sogo_acl' => ['c_uid'],
|
'mailbox_group_sogo_acl' => ['c_uid'],
|
||||||
'mailbox_group_subscription' => ['username', 'owner'],
|
'mailbox_group_subscription' => ['username', 'owner']
|
||||||
'mail_policy_member' => ['username'],
|
|
||||||
'retention_rule_member' => ['username']
|
|
||||||
];
|
];
|
||||||
foreach ($tables as $table => $columns) {
|
foreach ($tables as $table => $columns) {
|
||||||
foreach ($columns as $column) {
|
foreach ($columns as $column) {
|
||||||
@@ -3343,8 +3311,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
\Mailcow\Imapsync\ImapsyncModule::fromGlobals()->sources->onAccountRenamed($old_username, $new_username);
|
\Mailcow\Imapsync\ImapsyncModule::fromGlobals()->sources->onAccountRenamed($old_username, $new_username);
|
||||||
// Group memberships and send-as grants follow, group aliases are rebuilt
|
// Group memberships and send-as grants follow, group aliases are rebuilt
|
||||||
\Mailcow\MailboxGroup\MailboxGroupModule::fromGlobals()->hooks->onMailboxRenamed($old_username, $new_username);
|
\Mailcow\MailboxGroup\MailboxGroupModule::fromGlobals()->hooks->onMailboxRenamed($old_username, $new_username);
|
||||||
// Address entries of mail policies follow
|
|
||||||
\Mailcow\MailPolicy\MailPolicyModule::fromGlobals()->api->addressRenamed($old_username, $new_username);
|
|
||||||
|
|
||||||
// Update c_uid, c_name and mail in _sogo_static_view table
|
// Update c_uid, c_name and mail in _sogo_static_view table
|
||||||
$pdo->prepare("UPDATE _sogo_static_view SET c_uid = :new_username, c_name = :new_username2, mail = :new_username3 WHERE c_uid = :old_username")
|
$pdo->prepare("UPDATE _sogo_static_view SET c_uid = :new_username, c_name = :new_username2, mail = :new_username3 WHERE c_uid = :old_username")
|
||||||
@@ -3568,7 +3534,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
$attr["rl_value"] = (!empty($_data['rl_value'])) ? $_data['rl_value'] : $is_now['rl_value'];
|
$attr["rl_value"] = (!empty($_data['rl_value'])) ? $_data['rl_value'] : $is_now['rl_value'];
|
||||||
$attr["force_pw_update"] = isset($_data['force_pw_update']) ? intval($_data['force_pw_update']) : $is_now['force_pw_update'];
|
$attr["force_pw_update"] = isset($_data['force_pw_update']) ? intval($_data['force_pw_update']) : $is_now['force_pw_update'];
|
||||||
$attr["force_tfa"] = isset($_data['force_tfa']) ? intval($_data['force_tfa']) : $is_now['force_tfa'];
|
$attr["force_tfa"] = isset($_data['force_tfa']) ? intval($_data['force_tfa']) : $is_now['force_tfa'];
|
||||||
$attr["archive"] = \Mailcow\Archive\Model\Mailbox::setting($_data['archive'] ?? ($is_now['attributes']['archive'] ?? null));
|
|
||||||
$attr["sogo_access"] = isset($_data['sogo_access']) ? intval($_data['sogo_access']) : $is_now['sogo_access'];
|
$attr["sogo_access"] = isset($_data['sogo_access']) ? intval($_data['sogo_access']) : $is_now['sogo_access'];
|
||||||
$attr["active"] = isset($_data['active']) ? intval($_data['active']) : $is_now['active'];
|
$attr["active"] = isset($_data['active']) ? intval($_data['active']) : $is_now['active'];
|
||||||
$attr["tls_enforce_in"] = isset($_data['tls_enforce_in']) ? intval($_data['tls_enforce_in']) : $is_now['tls_enforce_in'];
|
$attr["tls_enforce_in"] = isset($_data['tls_enforce_in']) ? intval($_data['tls_enforce_in']) : $is_now['tls_enforce_in'];
|
||||||
@@ -4023,9 +3988,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
$stmt->execute(array(':goto' => '(^|,)'.preg_quote($_data, '/').'($|,)'));
|
$stmt->execute(array(':goto' => '(^|,)'.preg_quote($_data, '/').'($|,)'));
|
||||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
while ($row = array_shift($rows)) {
|
while ($row = array_shift($rows)) {
|
||||||
if (!hasAliasObjectAccess($_SESSION['mailcow_cc_username'], $_SESSION['mailcow_cc_role'], $row['address'])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
// Keep old array for backward compatibility
|
// Keep old array for backward compatibility
|
||||||
$data['fixed_sender_aliases'][] = $row['address'];
|
$data['fixed_sender_aliases'][] = $row['address'];
|
||||||
// Split into allowed/blocked for proper display
|
// Split into allowed/blocked for proper display
|
||||||
@@ -4720,7 +4682,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
`relay_unknown_only`,
|
`relay_unknown_only`,
|
||||||
`backupmx`,
|
`backupmx`,
|
||||||
`gal`,
|
`gal`,
|
||||||
`archive`,
|
|
||||||
`active`
|
`active`
|
||||||
FROM `domain` WHERE `domain`= :domain");
|
FROM `domain` WHERE `domain`= :domain");
|
||||||
$stmt->execute(array(
|
$stmt->execute(array(
|
||||||
@@ -4781,7 +4742,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
$domaindata['backupmx_int'] = $row['backupmx'];
|
$domaindata['backupmx_int'] = $row['backupmx'];
|
||||||
$domaindata['gal'] = $row['gal'];
|
$domaindata['gal'] = $row['gal'];
|
||||||
$domaindata['gal_int'] = $row['gal'];
|
$domaindata['gal_int'] = $row['gal'];
|
||||||
$domaindata['archive'] = $row['archive'];
|
|
||||||
$domaindata['rl'] = $rl;
|
$domaindata['rl'] = $rl;
|
||||||
$domaindata['active'] = $row['active'];
|
$domaindata['active'] = $row['active'];
|
||||||
$domaindata['active_int'] = $row['active'];
|
$domaindata['active_int'] = $row['active'];
|
||||||
@@ -4869,8 +4829,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
if (preg_match('/y|yes/i', getenv('MASTER'))) {
|
if (preg_match('/y|yes/i', getenv('MASTER'))) {
|
||||||
$stmt = $pdo->prepare("SELECT
|
$stmt = $pdo->prepare("SELECT
|
||||||
`domain`.`backupmx`,
|
`domain`.`backupmx`,
|
||||||
`domain`.`active` AS `domain_active`,
|
|
||||||
`domain`.`archive` AS `domain_archive`,
|
|
||||||
`mailbox`.`username`,
|
`mailbox`.`username`,
|
||||||
`mailbox`.`name`,
|
`mailbox`.`name`,
|
||||||
`mailbox`.`active`,
|
`mailbox`.`active`,
|
||||||
@@ -4893,8 +4851,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
else {
|
else {
|
||||||
$stmt = $pdo->prepare("SELECT
|
$stmt = $pdo->prepare("SELECT
|
||||||
`domain`.`backupmx`,
|
`domain`.`backupmx`,
|
||||||
`domain`.`active` AS `domain_active`,
|
|
||||||
`domain`.`archive` AS `domain_archive`,
|
|
||||||
`mailbox`.`username`,
|
`mailbox`.`username`,
|
||||||
`mailbox`.`name`,
|
`mailbox`.`name`,
|
||||||
`mailbox`.`active`,
|
`mailbox`.`active`,
|
||||||
@@ -4934,18 +4890,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
$mailboxdata['created'] = $row['created'];
|
$mailboxdata['created'] = $row['created'];
|
||||||
$mailboxdata['modified'] = $row['modified'];
|
$mailboxdata['modified'] = $row['modified'];
|
||||||
$mailboxdata['authsource'] = ($row['authsource']) ? $row['authsource'] : 'mailcow';
|
$mailboxdata['authsource'] = ($row['authsource']) ? $row['authsource'] : 'mailcow';
|
||||||
// Mails of the mailbox go to the archive: global switch, mailbox setting ("inherit" follows the domain), receives mail
|
|
||||||
static $archive_enabled = null;
|
|
||||||
if ($archive_enabled === null) {
|
|
||||||
try {
|
|
||||||
$archive_enabled = \Mailcow\Archive\ArchiveModule::fromGlobals()->settings->enabled();
|
|
||||||
}
|
|
||||||
catch (PDOException $e) {
|
|
||||||
$archive_enabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$mailboxdata['archive'] = ($archive_enabled && $row['active'] != 0 && $row['domain_active'] == 1 && $row['backupmx'] == 0
|
|
||||||
&& \Mailcow\Archive\Model\Mailbox::effective($mailboxdata['attributes']['archive'] ?? null, $row['domain_archive'])) ? 1 : 0;
|
|
||||||
|
|
||||||
if ($mailboxdata['percent_in_use'] === '- ') {
|
if ($mailboxdata['percent_in_use'] === '- ') {
|
||||||
$mailboxdata['percent_class'] = "info";
|
$mailboxdata['percent_class'] = "info";
|
||||||
@@ -4979,9 +4923,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
else if ($SaslLogs['service'] == 'SSO') {
|
else if ($SaslLogs['service'] == 'SSO') {
|
||||||
$last_sso_login = strtotime($SaslLogs['datetime']);
|
$last_sso_login = strtotime($SaslLogs['datetime']);
|
||||||
}
|
}
|
||||||
else if ($SaslLogs['service'] == 'SOGO') {
|
|
||||||
$last_sogo_login = strtotime($SaslLogs['datetime']);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!isset($last_imap_login) || $GLOBALS['SHOW_LAST_LOGIN'] === false) {
|
if (!isset($last_imap_login) || $GLOBALS['SHOW_LAST_LOGIN'] === false) {
|
||||||
$last_imap_login = 0;
|
$last_imap_login = 0;
|
||||||
@@ -4995,14 +4936,10 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
if (!isset($last_sso_login) || $GLOBALS['SHOW_LAST_LOGIN'] === false) {
|
if (!isset($last_sso_login) || $GLOBALS['SHOW_LAST_LOGIN'] === false) {
|
||||||
$last_sso_login = 0;
|
$last_sso_login = 0;
|
||||||
}
|
}
|
||||||
if (!isset($last_sogo_login) || $GLOBALS['SHOW_LAST_LOGIN'] === false) {
|
|
||||||
$last_sogo_login = 0;
|
|
||||||
}
|
|
||||||
$mailboxdata['last_imap_login'] = $last_imap_login;
|
$mailboxdata['last_imap_login'] = $last_imap_login;
|
||||||
$mailboxdata['last_smtp_login'] = $last_smtp_login;
|
$mailboxdata['last_smtp_login'] = $last_smtp_login;
|
||||||
$mailboxdata['last_pop3_login'] = $last_pop3_login;
|
$mailboxdata['last_pop3_login'] = $last_pop3_login;
|
||||||
$mailboxdata['last_sso_login'] = $last_sso_login;
|
$mailboxdata['last_sso_login'] = $last_sso_login;
|
||||||
$mailboxdata['last_sogo_login'] = $last_sogo_login;
|
|
||||||
|
|
||||||
if (!isset($_extra) || $_extra != 'reduced') {
|
if (!isset($_extra) || $_extra != 'reduced') {
|
||||||
$rl = ratelimit('get', 'mailbox', $_data);
|
$rl = ratelimit('get', 'mailbox', $_data);
|
||||||
@@ -5040,16 +4977,7 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
$stmt->execute(array(':username' => $_data));
|
$stmt->execute(array(':username' => $_data));
|
||||||
$sender_acl_rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$sender_acl_rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
foreach ($sender_acl_rows as $sender_acl_row) {
|
foreach ($sender_acl_rows as $sender_acl_row) {
|
||||||
$send_as = $sender_acl_row['send_as'];
|
$mailboxdata['sender_acl'][] = $sender_acl_row['send_as'];
|
||||||
if ($_SESSION['mailcow_cc_role'] == 'domainadmin' && $send_as != '*') {
|
|
||||||
$in_scope = (substr($send_as, 0, 1) == '@')
|
|
||||||
? hasDomainAccess($_SESSION['mailcow_cc_username'], $_SESSION['mailcow_cc_role'], substr($send_as, 1))
|
|
||||||
: hasAliasObjectAccess($_SESSION['mailcow_cc_username'], $_SESSION['mailcow_cc_role'], $send_as);
|
|
||||||
if (!$in_scope) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$mailboxdata['sender_acl'][] = $send_as;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$stmt = $pdo->prepare("SELECT `tag_name`
|
$stmt = $pdo->prepare("SELECT `tag_name`
|
||||||
@@ -5420,7 +5348,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
':domain' => $domain,
|
':domain' => $domain,
|
||||||
));
|
));
|
||||||
\Mailcow\MailboxGroup\MailboxGroupModule::fromGlobals()->api->domainDeleted($domain);
|
\Mailcow\MailboxGroup\MailboxGroupModule::fromGlobals()->api->domainDeleted($domain);
|
||||||
\Mailcow\Retention\RetentionModule::fromGlobals()->api->domainDeleted($domain);
|
|
||||||
$stmt = $pdo->prepare("DELETE FROM `imapsync_source_domain` WHERE `domain` = :domain");
|
$stmt = $pdo->prepare("DELETE FROM `imapsync_source_domain` WHERE `domain` = :domain");
|
||||||
$stmt->execute(array(
|
$stmt->execute(array(
|
||||||
':domain' => $domain,
|
':domain' => $domain,
|
||||||
@@ -5989,12 +5916,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
':domain' => $domain,
|
':domain' => $domain,
|
||||||
':tag_name' => $tag,
|
':tag_name' => $tag,
|
||||||
));
|
));
|
||||||
if ($stmt->rowCount() > 0) {
|
|
||||||
$stmt = $pdo->prepare("UPDATE `domain` SET `modified` = NOW() WHERE `domain` = :domain");
|
|
||||||
$stmt->execute(array(
|
|
||||||
':domain' => $domain,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6047,12 +5968,6 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
|
|||||||
':username' => $username,
|
':username' => $username,
|
||||||
':tag_name' => $tag,
|
':tag_name' => $tag,
|
||||||
));
|
));
|
||||||
if ($stmt->rowCount() > 0) {
|
|
||||||
$stmt = $pdo->prepare("UPDATE `mailbox` SET `modified` = NOW() WHERE `username` = :username");
|
|
||||||
$stmt->execute(array(
|
|
||||||
':username' => $username,
|
|
||||||
));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,6 @@ function quarantine($_action, $_data = null) {
|
|||||||
$mail->addAttachment($msg_tmpf, $detail_row['qid'] . '.eml');
|
$mail->addAttachment($msg_tmpf, $detail_row['qid'] . '.eml');
|
||||||
$mail->Body = sprintf($lang['quarantine']['release_body']);
|
$mail->Body = sprintf($lang['quarantine']['release_body']);
|
||||||
$mail->send();
|
$mail->send();
|
||||||
$released_msg = $mail->getSentMIMEMessage();
|
|
||||||
unlink($msg_tmpf);
|
unlink($msg_tmpf);
|
||||||
}
|
}
|
||||||
catch (phpmailerException $e) {
|
catch (phpmailerException $e) {
|
||||||
@@ -171,7 +170,6 @@ function quarantine($_action, $_data = null) {
|
|||||||
}
|
}
|
||||||
elseif ($release_format == 'raw') {
|
elseif ($release_format == 'raw') {
|
||||||
$detail_row['msg'] = preg_replace('/^X-Spam-Flag: (.*)/m', 'X-Pre-Release-Spam-Flag: $1', $detail_row['msg']);
|
$detail_row['msg'] = preg_replace('/^X-Spam-Flag: (.*)/m', 'X-Pre-Release-Spam-Flag: $1', $detail_row['msg']);
|
||||||
$released_msg = $detail_row['msg'];
|
|
||||||
// dot-stuffing per RFC5321 4.5.2: escape leading dots
|
// dot-stuffing per RFC5321 4.5.2: escape leading dots
|
||||||
$detail_row['msg'] = preg_replace('~^\.~m', '..', $detail_row['msg']);
|
$detail_row['msg'] = preg_replace('~^\.~m', '..', $detail_row['msg']);
|
||||||
$postfix_talk = array(
|
$postfix_talk = array(
|
||||||
@@ -215,10 +213,6 @@ function quarantine($_action, $_data = null) {
|
|||||||
}
|
}
|
||||||
fclose($smtp_connection);
|
fclose($smtp_connection);
|
||||||
}
|
}
|
||||||
// Port 590 bypasses rspamd, so the archive gets released mails here
|
|
||||||
if (isset($released_msg)) {
|
|
||||||
\Mailcow\Archive\ArchiveModule::fromGlobals()->journal->submitDelivered($released_msg, $sender, array($detail_row['rcpt']), 'quarantine');
|
|
||||||
}
|
|
||||||
$stmt = $pdo->prepare("DELETE FROM `quarantine` WHERE id = :id");
|
$stmt = $pdo->prepare("DELETE FROM `quarantine` WHERE id = :id");
|
||||||
$stmt->execute(array(
|
$stmt->execute(array(
|
||||||
':id' => $row['id']
|
':id' => $row['id']
|
||||||
@@ -459,7 +453,6 @@ function quarantine($_action, $_data = null) {
|
|||||||
$mail->addAttachment($msg_tmpf, $row['qid'] . '.eml');
|
$mail->addAttachment($msg_tmpf, $row['qid'] . '.eml');
|
||||||
$mail->Body = sprintf($lang['quarantine']['release_body']);
|
$mail->Body = sprintf($lang['quarantine']['release_body']);
|
||||||
$mail->send();
|
$mail->send();
|
||||||
$released_msg = $mail->getSentMIMEMessage();
|
|
||||||
unlink($msg_tmpf);
|
unlink($msg_tmpf);
|
||||||
}
|
}
|
||||||
catch (phpmailerException $e) {
|
catch (phpmailerException $e) {
|
||||||
@@ -474,7 +467,6 @@ function quarantine($_action, $_data = null) {
|
|||||||
}
|
}
|
||||||
elseif ($release_format == 'raw') {
|
elseif ($release_format == 'raw') {
|
||||||
$row['msg'] = preg_replace('/^X-Spam-Flag: (.*)/m', 'X-Pre-Release-Spam-Flag: $1', $row['msg']);
|
$row['msg'] = preg_replace('/^X-Spam-Flag: (.*)/m', 'X-Pre-Release-Spam-Flag: $1', $row['msg']);
|
||||||
$released_msg = $row['msg'];
|
|
||||||
// dot-stuffing per RFC5321 4.5.2: escape leading dots
|
// dot-stuffing per RFC5321 4.5.2: escape leading dots
|
||||||
$row['msg'] = preg_replace('~^\.~m', '..', $row['msg']);
|
$row['msg'] = preg_replace('~^\.~m', '..', $row['msg']);
|
||||||
$postfix_talk = array(
|
$postfix_talk = array(
|
||||||
@@ -514,11 +506,6 @@ function quarantine($_action, $_data = null) {
|
|||||||
}
|
}
|
||||||
fclose($smtp_connection);
|
fclose($smtp_connection);
|
||||||
}
|
}
|
||||||
// Port 590 bypasses rspamd, so the archive gets released mails here
|
|
||||||
if (isset($released_msg)) {
|
|
||||||
\Mailcow\Archive\ArchiveModule::fromGlobals()->journal->submitDelivered($released_msg, $sender, array($row['rcpt']), 'quarantine');
|
|
||||||
unset($released_msg);
|
|
||||||
}
|
|
||||||
$stmt = $pdo->prepare("DELETE FROM `quarantine` WHERE `id` = :id");
|
$stmt = $pdo->prepare("DELETE FROM `quarantine` WHERE `id` = :id");
|
||||||
$stmt->execute(array(
|
$stmt->execute(array(
|
||||||
':id' => $id
|
':id' => $id
|
||||||
@@ -780,9 +767,8 @@ function quarantine($_action, $_data = null) {
|
|||||||
else {
|
else {
|
||||||
$domains = array_merge(mailbox('get', 'domains'), mailbox('get', 'alias_domains'));
|
$domains = array_merge(mailbox('get', 'domains'), mailbox('get', 'alias_domains'));
|
||||||
foreach ($domains as $domain) {
|
foreach ($domains as $domain) {
|
||||||
// Compare the domain part exactly, a regex would treat dots in the domain as wildcards
|
$stmt = $pdo->prepare('SELECT `id`, `qid`, `subject`, LOCATE("VIRUS_FOUND", `symbols`) AS `virus_flag`, `score`, `rcpt`, `sender`, `action`, UNIX_TIMESTAMP(`created`) AS `created`, `notified` FROM `quarantine` WHERE `rcpt` REGEXP :domain');
|
||||||
$stmt = $pdo->prepare('SELECT `id`, `qid`, `subject`, LOCATE("VIRUS_FOUND", `symbols`) AS `virus_flag`, `score`, `rcpt`, `sender`, `action`, UNIX_TIMESTAMP(`created`) AS `created`, `notified` FROM `quarantine` WHERE SUBSTRING_INDEX(`rcpt`, "@", -1) = :domain');
|
$stmt->execute(array(':domain' => '@' . $domain . '$'));
|
||||||
$stmt->execute(array(':domain' => $domain));
|
|
||||||
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
while($row = array_shift($rows)) {
|
while($row = array_shift($rows)) {
|
||||||
$q_meta[] = $row;
|
$q_meta[] = $row;
|
||||||
|
|||||||
+14
-320
@@ -242,7 +242,6 @@ function init_db_schema()
|
|||||||
"gal" => "TINYINT(1) NOT NULL DEFAULT '1'",
|
"gal" => "TINYINT(1) NOT NULL DEFAULT '1'",
|
||||||
"relay_all_recipients" => "TINYINT(1) NOT NULL DEFAULT '0'",
|
"relay_all_recipients" => "TINYINT(1) NOT NULL DEFAULT '0'",
|
||||||
"relay_unknown_only" => "TINYINT(1) NOT NULL DEFAULT '0'",
|
"relay_unknown_only" => "TINYINT(1) NOT NULL DEFAULT '0'",
|
||||||
"archive" => "TINYINT(1) NOT NULL DEFAULT '0'",
|
|
||||||
"created" => "DATETIME(0) NOT NULL DEFAULT NOW(0)",
|
"created" => "DATETIME(0) NOT NULL DEFAULT NOW(0)",
|
||||||
"modified" => "DATETIME ON UPDATE CURRENT_TIMESTAMP",
|
"modified" => "DATETIME ON UPDATE CURRENT_TIMESTAMP",
|
||||||
"active" => "TINYINT(1) NOT NULL DEFAULT '1'"
|
"active" => "TINYINT(1) NOT NULL DEFAULT '1'"
|
||||||
@@ -492,257 +491,6 @@ function init_db_schema()
|
|||||||
),
|
),
|
||||||
"attr" => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"
|
"attr" => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"
|
||||||
),
|
),
|
||||||
// Mail policies: whom the assigned mailboxes and groups may send to and receive from (Mailcow\MailPolicy)
|
|
||||||
"mail_policy" => array(
|
|
||||||
"cols" => array(
|
|
||||||
"id" => "INT NOT NULL AUTO_INCREMENT",
|
|
||||||
"domain" => "VARCHAR(255) NOT NULL",
|
|
||||||
"name" => "VARCHAR(100) NOT NULL",
|
|
||||||
"description" => "VARCHAR(255) NOT NULL DEFAULT ''",
|
|
||||||
// all, internal or list; the entries are JSON lists of addresses, domains and group:<id>
|
|
||||||
"send_mode" => "VARCHAR(16) NOT NULL DEFAULT 'all'",
|
|
||||||
"send_allow" => "MEDIUMTEXT NOT NULL",
|
|
||||||
"send_block" => "MEDIUMTEXT NOT NULL",
|
|
||||||
"receive_mode" => "VARCHAR(16) NOT NULL DEFAULT 'all'",
|
|
||||||
"receive_allow" => "MEDIUMTEXT NOT NULL",
|
|
||||||
"receive_block" => "MEDIUMTEXT NOT NULL",
|
|
||||||
"reject_text" => "VARCHAR(255) NOT NULL DEFAULT ''",
|
|
||||||
"created" => "DATETIME(0) NOT NULL DEFAULT NOW(0)",
|
|
||||||
"modified" => "DATETIME ON UPDATE CURRENT_TIMESTAMP",
|
|
||||||
"active" => "TINYINT(1) NOT NULL DEFAULT '1'"
|
|
||||||
),
|
|
||||||
"keys" => array(
|
|
||||||
"primary" => array(
|
|
||||||
"" => array("id")
|
|
||||||
),
|
|
||||||
"unique" => array(
|
|
||||||
"domain_name" => array("domain", "name")
|
|
||||||
),
|
|
||||||
"fkey" => array(
|
|
||||||
"fk_mail_policy_domain" => array(
|
|
||||||
"col" => "domain",
|
|
||||||
"ref" => "domain.domain",
|
|
||||||
"delete" => "CASCADE",
|
|
||||||
"update" => "NO ACTION"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
"attr" => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"
|
|
||||||
),
|
|
||||||
// a mailbox or a group (its members and its address) a policy is assigned to
|
|
||||||
"mail_policy_member" => array(
|
|
||||||
"cols" => array(
|
|
||||||
"id" => "INT NOT NULL AUTO_INCREMENT",
|
|
||||||
"policy_id" => "INT NOT NULL",
|
|
||||||
"username" => "VARCHAR(255) NULL DEFAULT NULL",
|
|
||||||
"group_id" => "INT NULL DEFAULT NULL"
|
|
||||||
),
|
|
||||||
"keys" => array(
|
|
||||||
"primary" => array(
|
|
||||||
"" => array("id")
|
|
||||||
),
|
|
||||||
"unique" => array(
|
|
||||||
"policy_mailbox" => array("policy_id", "username"),
|
|
||||||
"policy_group" => array("policy_id", "group_id")
|
|
||||||
),
|
|
||||||
"key" => array(
|
|
||||||
"username" => array("username"),
|
|
||||||
"group_id" => array("group_id")
|
|
||||||
),
|
|
||||||
"fkey" => array(
|
|
||||||
"fk_mail_policy_member_policy" => array(
|
|
||||||
"col" => "policy_id",
|
|
||||||
"ref" => "mail_policy.id",
|
|
||||||
"delete" => "CASCADE",
|
|
||||||
"update" => "NO ACTION"
|
|
||||||
),
|
|
||||||
"fk_mail_policy_member_mailbox" => array(
|
|
||||||
"col" => "username",
|
|
||||||
"ref" => "mailbox.username",
|
|
||||||
"delete" => "CASCADE",
|
|
||||||
"update" => "NO ACTION"
|
|
||||||
),
|
|
||||||
"fk_mail_policy_member_group" => array(
|
|
||||||
"col" => "group_id",
|
|
||||||
"ref" => "mailbox_group.id",
|
|
||||||
"delete" => "CASCADE",
|
|
||||||
"update" => "NO ACTION"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
"attr" => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"
|
|
||||||
),
|
|
||||||
"retention_rule" => array(
|
|
||||||
"cols" => array(
|
|
||||||
"id" => "INT NOT NULL AUTO_INCREMENT",
|
|
||||||
"domain" => "VARCHAR(255) NOT NULL",
|
|
||||||
"name" => "VARCHAR(100) NOT NULL",
|
|
||||||
"description" => "VARCHAR(255) NOT NULL DEFAULT ''",
|
|
||||||
// JSON list: trash, junk, sent, drafts, archive, inbox, all, folder:<name>
|
|
||||||
"folders" => "TEXT NOT NULL",
|
|
||||||
"days" => "INT NOT NULL DEFAULT '30'",
|
|
||||||
"keep_flagged" => "TINYINT(1) NOT NULL DEFAULT '0'",
|
|
||||||
// simulate (count only) or delete
|
|
||||||
"mode" => "VARCHAR(16) NOT NULL DEFAULT 'simulate'",
|
|
||||||
"all_mailboxes" => "TINYINT(1) NOT NULL DEFAULT '0'",
|
|
||||||
"created" => "DATETIME(0) NOT NULL DEFAULT NOW(0)",
|
|
||||||
"modified" => "DATETIME ON UPDATE CURRENT_TIMESTAMP",
|
|
||||||
"active" => "TINYINT(1) NOT NULL DEFAULT '1'"
|
|
||||||
),
|
|
||||||
"keys" => array(
|
|
||||||
"primary" => array(
|
|
||||||
"" => array("id")
|
|
||||||
),
|
|
||||||
"unique" => array(
|
|
||||||
"domain_name" => array("domain", "name")
|
|
||||||
),
|
|
||||||
"fkey" => array(
|
|
||||||
"fk_retention_rule_domain" => array(
|
|
||||||
"col" => "domain",
|
|
||||||
"ref" => "domain.domain",
|
|
||||||
"delete" => "CASCADE",
|
|
||||||
"update" => "NO ACTION"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
"attr" => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"
|
|
||||||
),
|
|
||||||
// a mailbox or a group (its members of the rule's domain) a retention rule is assigned to
|
|
||||||
"retention_rule_member" => array(
|
|
||||||
"cols" => array(
|
|
||||||
"id" => "INT NOT NULL AUTO_INCREMENT",
|
|
||||||
"rule_id" => "INT NOT NULL",
|
|
||||||
"username" => "VARCHAR(255) NULL DEFAULT NULL",
|
|
||||||
"group_id" => "INT NULL DEFAULT NULL"
|
|
||||||
),
|
|
||||||
"keys" => array(
|
|
||||||
"primary" => array(
|
|
||||||
"" => array("id")
|
|
||||||
),
|
|
||||||
"unique" => array(
|
|
||||||
"rule_mailbox" => array("rule_id", "username"),
|
|
||||||
"rule_group" => array("rule_id", "group_id")
|
|
||||||
),
|
|
||||||
"key" => array(
|
|
||||||
"username" => array("username"),
|
|
||||||
"group_id" => array("group_id")
|
|
||||||
),
|
|
||||||
"fkey" => array(
|
|
||||||
"fk_retention_rule_member_rule" => array(
|
|
||||||
"col" => "rule_id",
|
|
||||||
"ref" => "retention_rule.id",
|
|
||||||
"delete" => "CASCADE",
|
|
||||||
"update" => "NO ACTION"
|
|
||||||
),
|
|
||||||
"fk_retention_rule_member_mailbox" => array(
|
|
||||||
"col" => "username",
|
|
||||||
"ref" => "mailbox.username",
|
|
||||||
"delete" => "CASCADE",
|
|
||||||
"update" => "NO ACTION"
|
|
||||||
),
|
|
||||||
"fk_retention_rule_member_group" => array(
|
|
||||||
"col" => "group_id",
|
|
||||||
"ref" => "mailbox_group.id",
|
|
||||||
"delete" => "CASCADE",
|
|
||||||
"update" => "NO ACTION"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
"attr" => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"
|
|
||||||
),
|
|
||||||
// results of the nightly run: per mailbox and rule with found mail or an error (folder: the folder names), per
|
|
||||||
// rule a summary (username '') and the whole run (username '', rule_id NULL); kept 90 days, of simulating
|
|
||||||
// rules only the last run
|
|
||||||
"retention_log" => array(
|
|
||||||
"cols" => array(
|
|
||||||
"id" => "INT NOT NULL AUTO_INCREMENT",
|
|
||||||
"domain" => "VARCHAR(255) NOT NULL",
|
|
||||||
"username" => "VARCHAR(255) NOT NULL DEFAULT ''",
|
|
||||||
"rule_id" => "INT NULL DEFAULT NULL",
|
|
||||||
"rule_name" => "VARCHAR(100) NOT NULL DEFAULT ''",
|
|
||||||
"folder" => "TEXT NULL DEFAULT NULL",
|
|
||||||
"days" => "INT NOT NULL DEFAULT '0'",
|
|
||||||
"mailboxes" => "INT NOT NULL DEFAULT '0'",
|
|
||||||
"matched" => "INT NOT NULL DEFAULT '0'",
|
|
||||||
"deleted" => "INT NOT NULL DEFAULT '0'",
|
|
||||||
"errors" => "INT NOT NULL DEFAULT '0'",
|
|
||||||
"simulated" => "TINYINT(1) NOT NULL DEFAULT '0'",
|
|
||||||
"error" => "TEXT NULL DEFAULT NULL",
|
|
||||||
"created" => "DATETIME(0) NOT NULL DEFAULT NOW(0)"
|
|
||||||
),
|
|
||||||
"keys" => array(
|
|
||||||
"primary" => array(
|
|
||||||
"" => array("id")
|
|
||||||
),
|
|
||||||
"key" => array(
|
|
||||||
"domain_created" => array("domain", "created"),
|
|
||||||
"rule_created" => array("rule_id", "username", "created"),
|
|
||||||
"created" => array("created")
|
|
||||||
)
|
|
||||||
),
|
|
||||||
"attr" => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"
|
|
||||||
),
|
|
||||||
"backup_setting" => array(
|
|
||||||
"cols" => array(
|
|
||||||
"name" => "VARCHAR(64) NOT NULL",
|
|
||||||
"value" => "TEXT NOT NULL",
|
|
||||||
"modified" => "DATETIME ON UPDATE CURRENT_TIMESTAMP"
|
|
||||||
),
|
|
||||||
"keys" => array(
|
|
||||||
"primary" => array(
|
|
||||||
"" => array("name")
|
|
||||||
)
|
|
||||||
),
|
|
||||||
"attr" => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"
|
|
||||||
),
|
|
||||||
"backup_job" => array(
|
|
||||||
"cols" => array(
|
|
||||||
"id" => "INT NOT NULL AUTO_INCREMENT",
|
|
||||||
"type" => "ENUM('backup', 'check', 'prune', 'init', 'restore') NOT NULL",
|
|
||||||
"state" => "ENUM('queued', 'running', 'done', 'failed', 'cancelled') NOT NULL DEFAULT 'queued'",
|
|
||||||
"step" => "VARCHAR(32) NULL DEFAULT NULL",
|
|
||||||
"params" => "MEDIUMTEXT NULL DEFAULT NULL",
|
|
||||||
"result" => "MEDIUMTEXT NULL DEFAULT NULL",
|
|
||||||
"log" => "MEDIUMTEXT NULL DEFAULT NULL",
|
|
||||||
"error" => "TEXT NULL DEFAULT NULL",
|
|
||||||
"domain" => "VARCHAR(255) NOT NULL DEFAULT ''",
|
|
||||||
"requested_by" => "VARCHAR(255) NOT NULL DEFAULT ''",
|
|
||||||
"created" => "DATETIME(0) NOT NULL DEFAULT NOW(0)",
|
|
||||||
"started" => "DATETIME NULL DEFAULT NULL",
|
|
||||||
"finished" => "DATETIME NULL DEFAULT NULL"
|
|
||||||
),
|
|
||||||
"keys" => array(
|
|
||||||
"primary" => array(
|
|
||||||
"" => array("id")
|
|
||||||
),
|
|
||||||
"key" => array(
|
|
||||||
"state_type" => array("state", "type"),
|
|
||||||
"domain_created" => array("domain", "created")
|
|
||||||
)
|
|
||||||
),
|
|
||||||
"attr" => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"
|
|
||||||
),
|
|
||||||
"backup_snapshot" => array(
|
|
||||||
"cols" => array(
|
|
||||||
"id" => "VARCHAR(64) NOT NULL",
|
|
||||||
"short_id" => "VARCHAR(16) NOT NULL",
|
|
||||||
"time" => "DATETIME NOT NULL",
|
|
||||||
"hostname" => "VARCHAR(255) NOT NULL DEFAULT ''",
|
|
||||||
"tags" => "VARCHAR(255) NOT NULL DEFAULT ''",
|
|
||||||
"summary" => "TEXT NULL DEFAULT NULL",
|
|
||||||
"domains" => "MEDIUMTEXT NULL DEFAULT NULL",
|
|
||||||
"content" => "MEDIUMBLOB NULL DEFAULT NULL"
|
|
||||||
),
|
|
||||||
"keys" => array(
|
|
||||||
"primary" => array(
|
|
||||||
"" => array("id")
|
|
||||||
),
|
|
||||||
"key" => array(
|
|
||||||
"time" => array("time")
|
|
||||||
)
|
|
||||||
),
|
|
||||||
"attr" => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"
|
|
||||||
),
|
|
||||||
"mailbox_group_imap_grant" => array(
|
"mailbox_group_imap_grant" => array(
|
||||||
"cols" => array(
|
"cols" => array(
|
||||||
"id" => "INT NOT NULL AUTO_INCREMENT",
|
"id" => "INT NOT NULL AUTO_INCREMENT",
|
||||||
@@ -955,8 +703,7 @@ function init_db_schema()
|
|||||||
"group_id" => array("group_id")
|
"group_id" => array("group_id")
|
||||||
),
|
),
|
||||||
"key" => array(
|
"key" => array(
|
||||||
"domain" => array("domain"),
|
"domain" => array("domain")
|
||||||
"internal" => array("internal", "active")
|
|
||||||
),
|
),
|
||||||
"fkey" => array(
|
"fkey" => array(
|
||||||
"fk_alias_mailbox_group" => array(
|
"fk_alias_mailbox_group" => array(
|
||||||
@@ -1306,10 +1053,7 @@ function init_db_schema()
|
|||||||
"domain_relayhost" => "TINYINT(1) NOT NULL DEFAULT '1'",
|
"domain_relayhost" => "TINYINT(1) NOT NULL DEFAULT '1'",
|
||||||
"domain_desc" => "TINYINT(1) NOT NULL DEFAULT '0'",
|
"domain_desc" => "TINYINT(1) NOT NULL DEFAULT '0'",
|
||||||
"alias_external_goto" => "TINYINT(1) NOT NULL DEFAULT '1'",
|
"alias_external_goto" => "TINYINT(1) NOT NULL DEFAULT '1'",
|
||||||
"mailbox_groups" => "TINYINT(1) NOT NULL DEFAULT '1'",
|
"mailbox_groups" => "TINYINT(1) NOT NULL DEFAULT '1'"
|
||||||
"archive" => "TINYINT(1) NOT NULL DEFAULT '0'",
|
|
||||||
"mail_policies" => "TINYINT(1) NOT NULL DEFAULT '0'",
|
|
||||||
"retention" => "TINYINT(1) NOT NULL DEFAULT '0'"
|
|
||||||
),
|
),
|
||||||
"keys" => array(
|
"keys" => array(
|
||||||
"primary" => array(
|
"primary" => array(
|
||||||
@@ -1354,7 +1098,6 @@ function init_db_schema()
|
|||||||
"host1" => "VARCHAR(255) NOT NULL",
|
"host1" => "VARCHAR(255) NOT NULL",
|
||||||
"port1" => "SMALLINT UNSIGNED NOT NULL",
|
"port1" => "SMALLINT UNSIGNED NOT NULL",
|
||||||
"enc1" => "ENUM('TLS','SSL','PLAIN') DEFAULT 'TLS'",
|
"enc1" => "ENUM('TLS','SSL','PLAIN') DEFAULT 'TLS'",
|
||||||
"verify_cert" => "TINYINT(1) NOT NULL DEFAULT '1'",
|
|
||||||
"auth_type" => "ENUM('PLAIN','LOGIN','CRAM-MD5','XOAUTH2') DEFAULT 'PLAIN'",
|
"auth_type" => "ENUM('PLAIN','LOGIN','CRAM-MD5','XOAUTH2') DEFAULT 'PLAIN'",
|
||||||
"oauth_flow" => "ENUM('client_credentials','authorization_code') NOT NULL DEFAULT 'client_credentials'",
|
"oauth_flow" => "ENUM('client_credentials','authorization_code') NOT NULL DEFAULT 'client_credentials'",
|
||||||
"oauth_token_endpoint" => "VARCHAR(500) DEFAULT NULL",
|
"oauth_token_endpoint" => "VARCHAR(500) DEFAULT NULL",
|
||||||
@@ -1533,42 +1276,6 @@ function init_db_schema()
|
|||||||
),
|
),
|
||||||
"attr" => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"
|
"attr" => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"
|
||||||
),
|
),
|
||||||
"archive_settings" => array(
|
|
||||||
"cols" => array(
|
|
||||||
"name" => "VARCHAR(64) NOT NULL",
|
|
||||||
"value" => "TEXT NOT NULL",
|
|
||||||
"created" => "DATETIME(0) NOT NULL DEFAULT NOW(0)",
|
|
||||||
"modified" => "DATETIME ON UPDATE CURRENT_TIMESTAMP"
|
|
||||||
),
|
|
||||||
"keys" => array(
|
|
||||||
"primary" => array(
|
|
||||||
"" => array("name")
|
|
||||||
)
|
|
||||||
),
|
|
||||||
"attr" => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"
|
|
||||||
),
|
|
||||||
// Archive target the Postfix maps read (FILTER of the copies on port 591, SASL, TLS policy), one row kept in line with archive_settings
|
|
||||||
"archive_transport" => array(
|
|
||||||
"cols" => array(
|
|
||||||
"id" => "INT NOT NULL AUTO_INCREMENT",
|
|
||||||
"address" => "VARCHAR(255) NOT NULL",
|
|
||||||
"nexthop" => "VARCHAR(255) NOT NULL",
|
|
||||||
"username" => "VARCHAR(255) NOT NULL DEFAULT ''",
|
|
||||||
"password" => "VARCHAR(255) NOT NULL DEFAULT ''",
|
|
||||||
"tls_policy" => "VARCHAR(64) NOT NULL DEFAULT 'encrypt'",
|
|
||||||
"active" => "TINYINT(1) NOT NULL DEFAULT '1'"
|
|
||||||
),
|
|
||||||
"keys" => array(
|
|
||||||
"primary" => array(
|
|
||||||
"" => array("id")
|
|
||||||
),
|
|
||||||
"key" => array(
|
|
||||||
"address" => array("address"),
|
|
||||||
"nexthop" => array("nexthop")
|
|
||||||
)
|
|
||||||
),
|
|
||||||
"attr" => "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC"
|
|
||||||
),
|
|
||||||
"bcc_maps" => array(
|
"bcc_maps" => array(
|
||||||
"cols" => array(
|
"cols" => array(
|
||||||
"id" => "INT NOT NULL AUTO_INCREMENT",
|
"id" => "INT NOT NULL AUTO_INCREMENT",
|
||||||
@@ -1972,15 +1679,9 @@ function init_db_schema()
|
|||||||
// Converted JSON may not fit into the old VARCHAR(512)
|
// Converted JSON may not fit into the old VARCHAR(512)
|
||||||
$pdo->exec("ALTER TABLE `imapsync` MODIFY COLUMN `custom_params` TEXT");
|
$pdo->exec("ALTER TABLE `imapsync` MODIFY COLUMN `custom_params` TEXT");
|
||||||
$imapsync_allow = \Mailcow\Imapsync\Model\CustomParams::allowlist($GLOBALS['IMAPSYNC_OPTIONS'] ?? [], $GLOBALS['IMAPSYNC_OPTIONS_DEFAULT'] ?? []);
|
$imapsync_allow = \Mailcow\Imapsync\Model\CustomParams::allowlist($GLOBALS['IMAPSYNC_OPTIONS'] ?? [], $GLOBALS['IMAPSYNC_OPTIONS_DEFAULT'] ?? []);
|
||||||
// A legacy source is found by its connection and its only target domain (none for jobs without domain)
|
$source_sel = $pdo->prepare("SELECT `id` FROM `imapsync_source` WHERE `created_by` = '' AND `name` = :name");
|
||||||
$source_sel = $pdo->prepare("SELECT `id` FROM `imapsync_source` s WHERE `created_by` = '' AND `host1` = :host AND `port1` = :port
|
$source_ins = $pdo->prepare("INSERT IGNORE INTO `imapsync_source` (`name`, `description`, `created_by`, `scope`, `host1`, `port1`, `enc1`, `auth_type`, `active`)
|
||||||
AND `enc1` = :enc AND `auth_type` = :auth
|
VALUES (:name, '', '', 'domain', :host, :port, :enc, :auth, 1)");
|
||||||
AND (SELECT GROUP_CONCAT(`domain`) FROM `imapsync_source_domain` d WHERE d.`source_id` = s.`id`) <=> NULLIF(:domain, '')
|
|
||||||
ORDER BY `id` LIMIT 1");
|
|
||||||
$source_name_sel = $pdo->prepare("SELECT COUNT(*) FROM `imapsync_source` WHERE `created_by` = '' AND `name` = :name");
|
|
||||||
// The old runner never checked certificates, legacy sources keep that
|
|
||||||
$source_ins = $pdo->prepare("INSERT IGNORE INTO `imapsync_source` (`name`, `description`, `created_by`, `scope`, `host1`, `port1`, `enc1`, `verify_cert`, `auth_type`, `active`)
|
|
||||||
VALUES (:name, 'Migrated sync jobs', '', 'domain', :host, :port, :enc, 0, :auth, 1)");
|
|
||||||
$source_domain_ins = $pdo->prepare("INSERT IGNORE INTO `imapsync_source_domain` (`source_id`, `domain`) VALUES (:id, :domain)");
|
$source_domain_ins = $pdo->prepare("INSERT IGNORE INTO `imapsync_source_domain` (`source_id`, `domain`) VALUES (:id, :domain)");
|
||||||
$job_upd = $pdo->prepare("UPDATE `imapsync` SET `source_id` = :source_id, `custom_params` = :cp, `custom_params_legacy` = :cp_legacy,
|
$job_upd = $pdo->prepare("UPDATE `imapsync` SET `source_id` = :source_id, `custom_params` = :cp, `custom_params_legacy` = :cp_legacy,
|
||||||
`dry` = GREATEST(`dry`, :dry) WHERE `id` = :id AND `source_id` IS NULL");
|
`dry` = GREATEST(`dry`, :dry) WHERE `id` = :id AND `source_id` IS NULL");
|
||||||
@@ -2040,20 +1741,16 @@ function init_db_schema()
|
|||||||
$enc = in_array($row['enc1'], array('TLS', 'SSL', 'PLAIN'), true) ? $row['enc1'] : 'TLS';
|
$enc = in_array($row['enc1'], array('TLS', 'SSL', 'PLAIN'), true) ? $row['enc1'] : 'TLS';
|
||||||
$at = strrchr((string)$row['user2'], '@');
|
$at = strrchr((string)$row['user2'], '@');
|
||||||
$domain = ($at === false) ? '' : strtolower(substr($at, 1));
|
$domain = ($at === false) ? '' : strtolower(substr($at, 1));
|
||||||
// One source per (host, port, enc, auth, domain), named "host (domain)" plus " 2", " 3"... when taken (<= 100 chars)
|
// One source per (host, port, enc, auth, domain), name always unique and <= 100 chars
|
||||||
$conn = array(':host' => $host, ':port' => $port, ':enc' => $enc, ':auth' => $auth);
|
$name = 'legacy-' . mb_substr($host, 0, 60) . '-' . $port . '-' . substr(sha1($host . '|' . $port . '|' . $enc . '|' . $auth . '|' . $domain), 0, 8);
|
||||||
$source_sel->execute($conn + array(':domain' => $domain));
|
$source_sel->execute(array(':name' => $name));
|
||||||
if (($source_id = $source_sel->fetchColumn()) === false) {
|
if (($source_id = $source_sel->fetchColumn()) === false) {
|
||||||
$base = mb_substr($host . ($domain !== '' ? ' (' . $domain . ')' : ''), 0, 94);
|
$source_ins->execute(array(':name' => $name, ':host' => $host, ':port' => $port, ':enc' => $enc, ':auth' => $auth));
|
||||||
for ($i = 1, $name = $base; $i < 1000; $name = $base . ' ' . ++$i) {
|
$source_sel->execute(array(':name' => $name));
|
||||||
$source_name_sel->execute(array(':name' => $name));
|
if (($source_id = $source_sel->fetchColumn()) === false) continue;
|
||||||
if ($source_name_sel->fetchColumn() == 0) break;
|
}
|
||||||
}
|
if ($domain !== '') {
|
||||||
$source_ins->execute($conn + array(':name' => $name));
|
$source_domain_ins->execute(array(':id' => $source_id, ':domain' => $domain));
|
||||||
if (($source_id = $pdo->lastInsertId()) == 0) continue;
|
|
||||||
if ($domain !== '') {
|
|
||||||
$source_domain_ins->execute(array(':id' => $source_id, ':domain' => $domain));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$job_upd->execute(array(
|
$job_upd->execute(array(
|
||||||
':source_id' => $source_id,
|
':source_id' => $source_id,
|
||||||
@@ -2301,7 +1998,6 @@ function init_db_schema()
|
|||||||
$pdo->query("UPDATE `mailbox` SET `attributes` = JSON_SET(`attributes`, '$.relayhost', \"0\") WHERE JSON_VALUE(`attributes`, '$.relayhost') IS NULL;");
|
$pdo->query("UPDATE `mailbox` SET `attributes` = JSON_SET(`attributes`, '$.relayhost', \"0\") WHERE JSON_VALUE(`attributes`, '$.relayhost') IS NULL;");
|
||||||
$pdo->query("UPDATE `mailbox` SET `attributes` = JSON_SET(`attributes`, '$.force_pw_update', \"0\") WHERE JSON_VALUE(`attributes`, '$.force_pw_update') IS NULL;");
|
$pdo->query("UPDATE `mailbox` SET `attributes` = JSON_SET(`attributes`, '$.force_pw_update', \"0\") WHERE JSON_VALUE(`attributes`, '$.force_pw_update') IS NULL;");
|
||||||
$pdo->query("UPDATE `mailbox` SET `attributes` = JSON_SET(`attributes`, '$.force_tfa', \"0\") WHERE JSON_VALUE(`attributes`, '$.force_tfa') IS NULL;");
|
$pdo->query("UPDATE `mailbox` SET `attributes` = JSON_SET(`attributes`, '$.force_tfa', \"0\") WHERE JSON_VALUE(`attributes`, '$.force_tfa') IS NULL;");
|
||||||
$pdo->query("UPDATE `mailbox` SET `attributes` = JSON_SET(`attributes`, '$.archive', \"inherit\") WHERE JSON_VALUE(`attributes`, '$.archive') IS NULL;");
|
|
||||||
// admin attributes
|
// admin attributes
|
||||||
$pdo->query("UPDATE `admin` SET `attributes` = '{}' WHERE `attributes` = '' OR `attributes` IS NULL;");
|
$pdo->query("UPDATE `admin` SET `attributes` = '{}' WHERE `attributes` = '' OR `attributes` IS NULL;");
|
||||||
$pdo->query("UPDATE `admin` SET `attributes` = JSON_SET(`attributes`, '$.force_tfa', \"0\") WHERE JSON_VALUE(`attributes`, '$.force_tfa') IS NULL;");
|
$pdo->query("UPDATE `admin` SET `attributes` = JSON_SET(`attributes`, '$.force_tfa', \"0\") WHERE JSON_VALUE(`attributes`, '$.force_tfa') IS NULL;");
|
||||||
@@ -2349,7 +2045,6 @@ function init_db_schema()
|
|||||||
"backupmx" => 0,
|
"backupmx" => 0,
|
||||||
"relay_all_recipients" => 0,
|
"relay_all_recipients" => 0,
|
||||||
"relay_unknown_only" => 0,
|
"relay_unknown_only" => 0,
|
||||||
"archive" => 0,
|
|
||||||
"dkim_selector" => "dkim",
|
"dkim_selector" => "dkim",
|
||||||
"key_size" => 2048,
|
"key_size" => 2048,
|
||||||
"max_quota_for_domain" => 10240 * 1048576,
|
"max_quota_for_domain" => 10240 * 1048576,
|
||||||
@@ -2367,7 +2062,6 @@ function init_db_schema()
|
|||||||
"rl_value" => "",
|
"rl_value" => "",
|
||||||
"force_pw_update" => intval($GLOBALS['MAILBOX_DEFAULT_ATTRIBUTES']['force_pw_update']),
|
"force_pw_update" => intval($GLOBALS['MAILBOX_DEFAULT_ATTRIBUTES']['force_pw_update']),
|
||||||
"force_tfa" => intval($GLOBALS['MAILBOX_DEFAULT_ATTRIBUTES']['force_tfa']),
|
"force_tfa" => intval($GLOBALS['MAILBOX_DEFAULT_ATTRIBUTES']['force_tfa']),
|
||||||
"archive" => strval($GLOBALS['MAILBOX_DEFAULT_ATTRIBUTES']['archive']),
|
|
||||||
"sogo_access" => intval($GLOBALS['MAILBOX_DEFAULT_ATTRIBUTES']['sogo_access']),
|
"sogo_access" => intval($GLOBALS['MAILBOX_DEFAULT_ATTRIBUTES']['sogo_access']),
|
||||||
"active" => 1,
|
"active" => 1,
|
||||||
"tls_enforce_in" => intval($GLOBALS['MAILBOX_DEFAULT_ATTRIBUTES']['tls_enforce_in']),
|
"tls_enforce_in" => intval($GLOBALS['MAILBOX_DEFAULT_ATTRIBUTES']['tls_enforce_in']),
|
||||||
|
|||||||
@@ -1,65 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Mailcow\Archive;
|
|
||||||
|
|
||||||
use Mailcow\Archive\Controller\ArchiveApiController;
|
|
||||||
use Mailcow\Archive\Legacy\LegacyQueue;
|
|
||||||
use Mailcow\Archive\Redis\ArchiveState;
|
|
||||||
use Mailcow\Archive\Repository\LookupRepository;
|
|
||||||
use Mailcow\Archive\Repository\SettingsRepository;
|
|
||||||
use Mailcow\Archive\Service\HeaderBuilder;
|
|
||||||
use Mailcow\Archive\Service\JournalService;
|
|
||||||
use Mailcow\Archive\Service\MailboxListService;
|
|
||||||
use Mailcow\Archive\Service\OwnerResolver;
|
|
||||||
use Mailcow\Archive\Service\SettingsService;
|
|
||||||
use Mailcow\Archive\Service\StatusService;
|
|
||||||
use Mailcow\Archive\Smtp\SmtpClient;
|
|
||||||
use Mailcow\Core\ApiResponse;
|
|
||||||
use Mailcow\Core\Context;
|
|
||||||
use PDO;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Composition root of the archive module (archive copies by SMTP through Postfix).
|
|
||||||
*
|
|
||||||
* process_get_return(ArchiveModule::fromGlobals()->api->getMailboxes());
|
|
||||||
* ArchiveModule::create($pdo, Context::system(), $redis)->journal->prepare($request); // rspamd dynmap
|
|
||||||
* ArchiveModule::fromGlobals()->journal->submitDelivered($message, $from, $rcpts, 'quarantine');
|
|
||||||
*/
|
|
||||||
class ArchiveModule
|
|
||||||
{
|
|
||||||
/** Request keys whose values never reach a log */
|
|
||||||
private const SECRET_KEYS = ['password', 'signing_secret'];
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
public readonly SettingsService $settings,
|
|
||||||
public readonly JournalService $journal,
|
|
||||||
public readonly StatusService $status,
|
|
||||||
public readonly MailboxListService $mailboxes,
|
|
||||||
public readonly ArchiveApiController $api
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @param ?object $redis Redis connection; without it nothing is read from or written to Redis */
|
|
||||||
public static function create(PDO $pdo, Context $context, ?object $redis = null): self
|
|
||||||
{
|
|
||||||
$settingsRepo = new SettingsRepository($pdo);
|
|
||||||
$lookup = new LookupRepository($pdo);
|
|
||||||
$state = new ArchiveState($redis);
|
|
||||||
$smtp = new SmtpClient();
|
|
||||||
$settings = new SettingsService($settingsRepo, $lookup, $state, $smtp, $context);
|
|
||||||
$journal = new JournalService($settingsRepo, new OwnerResolver($lookup), new HeaderBuilder(), $smtp, $state, $context);
|
|
||||||
$status = new StatusService($settingsRepo, $state, new LegacyQueue(), $context);
|
|
||||||
$mailboxes = new MailboxListService($lookup, $state, $context);
|
|
||||||
$api = new ArchiveApiController($settings, $status, $journal, $mailboxes, new ApiResponse(self::SECRET_KEYS));
|
|
||||||
return new self($settings, $journal, $status, $mailboxes, $api);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Legacy entry point for procedural callers: reads $pdo, $redis and $_SESSION; $context overrides the session caller */
|
|
||||||
public static function fromGlobals(?Context $context = null): self
|
|
||||||
{
|
|
||||||
$redis = $GLOBALS['redis'] ?? null;
|
|
||||||
return self::create($GLOBALS['pdo'], $context ?? Context::fromSession($_SESSION ?? []), is_object($redis) ? $redis : null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,103 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Mailcow\Archive\Controller;
|
|
||||||
|
|
||||||
use Mailcow\Archive\Service\JournalService;
|
|
||||||
use Mailcow\Archive\Service\MailboxListService;
|
|
||||||
use Mailcow\Archive\Service\SettingsService;
|
|
||||||
use Mailcow\Archive\Service\StatusService;
|
|
||||||
use Mailcow\Core\ApiResponse;
|
|
||||||
use Mailcow\Core\UserError;
|
|
||||||
use PDOException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* HTTP API adapter for json_api.php (routes `archive/*`, `archive`).
|
|
||||||
*
|
|
||||||
* Write methods return what json_api passes to process_*_return() and write their messages via ApiResponse.
|
|
||||||
* Messages are logged as ['archive', action, object, data].
|
|
||||||
*/
|
|
||||||
class ArchiveApiController
|
|
||||||
{
|
|
||||||
public function __construct(private SettingsService $settings, private StatusService $status, private JournalService $journal,
|
|
||||||
private MailboxListService $mailboxes, private ApiResponse $response)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/** GET archive/settings */
|
|
||||||
public function getSettings(): array
|
|
||||||
{
|
|
||||||
return $this->read(fn(): array => $this->settings->get()->toArray());
|
|
||||||
}
|
|
||||||
|
|
||||||
/** GET archive/status */
|
|
||||||
public function getStatus(): array
|
|
||||||
{
|
|
||||||
return $this->read(fn(): array => $this->status->status());
|
|
||||||
}
|
|
||||||
|
|
||||||
/** GET logs/archive[/count] */
|
|
||||||
public function getLog(int $count = 0): array
|
|
||||||
{
|
|
||||||
return $this->read(fn(): array => $this->status->log($count));
|
|
||||||
}
|
|
||||||
|
|
||||||
/** GET archive/mailboxes */
|
|
||||||
public function getMailboxes(): array
|
|
||||||
{
|
|
||||||
return $this->read(fn(): array => $this->mailboxes->archived());
|
|
||||||
}
|
|
||||||
|
|
||||||
/** POST edit/archive: the settings; `action: test` tests the connection, `action: testmail` sends a test copy */
|
|
||||||
public function edit(array $attr): bool
|
|
||||||
{
|
|
||||||
return match ($attr['action'] ?? null) {
|
|
||||||
'test' => $this->handle('edit', 'test', [], fn(array $log): bool => $this->testResult($this->settings->test(), $log)),
|
|
||||||
'testmail' => $this->handle('edit', 'testmail', [],
|
|
||||||
fn(array $log): bool => $this->response->success(['archive_testmail_queued', htmlspecialchars($this->journal->testMail())], $log)),
|
|
||||||
default => $this->handle('edit', 'settings', $attr, function (array $log) use ($attr): bool {
|
|
||||||
$this->settings->save($attr);
|
|
||||||
return $this->response->success('archive_settings_saved', $log);
|
|
||||||
}),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/** A missing extension is a warning: the archive works, but may refuse some mails */
|
|
||||||
private function testResult(string|array $msg, array $log): bool
|
|
||||||
{
|
|
||||||
if (is_array($msg)) {
|
|
||||||
$this->response->warning($msg, $log);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return $this->response->success($msg, $log);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** A GET answer, empty when the caller may not read it */
|
|
||||||
private function read(callable $work): array
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
return $work();
|
|
||||||
} catch (UserError) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Runs one write call: $work gets the log entry and returns the result for process_*_return().
|
|
||||||
* A UserError becomes a danger message, a database error stops the call with one `mysql_error` message.
|
|
||||||
*/
|
|
||||||
private function handle(string $action, string $object, mixed $data, callable $work): bool
|
|
||||||
{
|
|
||||||
$log = ['archive', $action, $object, $data];
|
|
||||||
try {
|
|
||||||
$result = $work($log);
|
|
||||||
} catch (UserError $e) {
|
|
||||||
$result = $this->response->error($e, $log);
|
|
||||||
} catch (PDOException $e) {
|
|
||||||
$result = $this->response->danger(['mysql_error', $e->getMessage()], $log);
|
|
||||||
}
|
|
||||||
$this->response->flush();
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Mailcow\Archive\Legacy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bridge to the legacy mailq() (Postfix queue through dockerapi) until it is converted.
|
|
||||||
*/
|
|
||||||
class LegacyQueue
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @return array[] queue entries of $sender: queue_id, queue_name, arrival_time, message_size,
|
|
||||||
* recipients ("address (delay reason)")
|
|
||||||
*/
|
|
||||||
public function entries(string $sender): array
|
|
||||||
{
|
|
||||||
if (!function_exists('mailq')) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
$list = json_decode((string)mailq('get'), true);
|
|
||||||
if (!is_array($list)) {
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
return array_values(array_filter($list, fn(mixed $entry): bool => is_array($entry) && ($entry['sender'] ?? '') === $sender));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Mailcow\Archive\Model;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* What the archive learns about one mail besides its content: owners, SMTP envelope, origin and content hash.
|
|
||||||
*/
|
|
||||||
class Journal
|
|
||||||
{
|
|
||||||
public const DIRECTIONS = ['in', 'out', 'internal'];
|
|
||||||
public const SOURCES = ['smtp', 'quarantine', 'massmail', 'test'];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string[] $owners mailbox usernames the mail belongs to
|
|
||||||
* @param string[] $rcpts SMTP envelope recipients as received (incl. BCC)
|
|
||||||
* @param float $received time mailcow accepted the mail (unix time with milliseconds)
|
|
||||||
* @param string $sha256 hash of the content as sent to the archive (CRLF line ends)
|
|
||||||
*/
|
|
||||||
public function __construct(
|
|
||||||
public readonly array $owners,
|
|
||||||
public readonly array $rcpts,
|
|
||||||
public readonly string $from,
|
|
||||||
public readonly string $qid,
|
|
||||||
public readonly string $direction,
|
|
||||||
public readonly string $source,
|
|
||||||
public readonly float $received,
|
|
||||||
public readonly string $sha256
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Mailcow\Archive\Model;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A mailbox that receives mail (regular kind, active 1 or 2, in an active domain that is no backup MX)
|
|
||||||
* with its archive settings: the mailbox attribute `archive` ('1', '0' or 'inherit') and the domain default.
|
|
||||||
*/
|
|
||||||
class Mailbox
|
|
||||||
{
|
|
||||||
public const INHERIT = 'inherit';
|
|
||||||
|
|
||||||
public function __construct(
|
|
||||||
public readonly string $username,
|
|
||||||
public readonly string $domain,
|
|
||||||
public readonly string $archive,
|
|
||||||
public readonly bool $domainArchive,
|
|
||||||
public readonly string $name = '',
|
|
||||||
public readonly int $active = 1
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function fromRow(array $row): self
|
|
||||||
{
|
|
||||||
return new self(
|
|
||||||
strtolower((string)$row['username']),
|
|
||||||
strtolower((string)$row['domain']),
|
|
||||||
self::setting($row['archive'] ?? null),
|
|
||||||
(int)($row['domain_archive'] ?? 0) === 1,
|
|
||||||
(string)($row['name'] ?? ''),
|
|
||||||
(int)($row['active'] ?? 1)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Mailbox setting: '1', '0' (also as number or boolean), anything else (also a missing attribute) is 'inherit' */
|
|
||||||
public static function setting(mixed $value): string
|
|
||||||
{
|
|
||||||
$value = is_bool($value) ? (int)$value : $value;
|
|
||||||
$value = is_scalar($value) ? (string)$value : '';
|
|
||||||
return in_array($value, ['0', '1'], true) ? $value : self::INHERIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Archiving applies by the mailbox setting, 'inherit' follows the domain (without the global switch) */
|
|
||||||
public static function effective(mixed $archive, mixed $domainArchive): bool
|
|
||||||
{
|
|
||||||
$archive = self::setting($archive);
|
|
||||||
return ($archive === self::INHERIT) ? (int)$domainArchive === 1 : $archive === '1';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function archived(): bool
|
|
||||||
{
|
|
||||||
return self::effective($this->archive, $this->domainArchive);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Why the mailbox is archived: its own setting or the domain default */
|
|
||||||
public function source(): string
|
|
||||||
{
|
|
||||||
return ($this->archive === '1') ? 'mailbox' : 'domain';
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Entry of GET archive/mailboxes */
|
|
||||||
public function toArray(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'username' => $this->username,
|
|
||||||
'domain' => $this->domain,
|
|
||||||
'name' => $this->name,
|
|
||||||
'active' => $this->active,
|
|
||||||
'source' => $this->source(),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Mailcow\Archive\Model;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The archive target (table `archive_settings`): archive copies of accepted mails go by SMTP to `address`,
|
|
||||||
* through the Postfix queue (table `archive_transport`, service archive_smtp in master.cf).
|
|
||||||
*/
|
|
||||||
class Settings
|
|
||||||
{
|
|
||||||
public const TLS_MODES = ['encrypt', 'verify', 'may'];
|
|
||||||
/** Metadata headers of a copy: archivecow (X-Archive-*, signed), envelope (sender/recipients), none */
|
|
||||||
public const PROFILES = ['archivecow', 'envelope', 'none'];
|
|
||||||
/** Envelope sender of copies; Postfix drops every notice to it (archive_discard), nothing reaches a real sender */
|
|
||||||
public const SENDER = 'archive-bounce@localhost';
|
|
||||||
|
|
||||||
/** rspamd hands accepted mails to the archive */
|
|
||||||
public bool $enabled = false;
|
|
||||||
/** Address the archive receives copies at */
|
|
||||||
public string $address = '';
|
|
||||||
/** SMTP server of the archive; empty: MX of the address domain */
|
|
||||||
public string $host = '';
|
|
||||||
public int $port = 25;
|
|
||||||
public string $tls = 'encrypt';
|
|
||||||
/** SMTP AUTH at the archive, optional */
|
|
||||||
public string $username = '';
|
|
||||||
/** Never part of toArray() */
|
|
||||||
public string $password = '';
|
|
||||||
public string $profile = 'archivecow';
|
|
||||||
/** Key of X-Archive-Signature (profile archivecow), never part of toArray() */
|
|
||||||
public string $signingKey = '';
|
|
||||||
/** Header names of the envelope profile */
|
|
||||||
public string $headerFrom = 'X-Envelope-From';
|
|
||||||
public string $headerRcpt = 'X-Envelope-To';
|
|
||||||
|
|
||||||
/** Copies can be sent: an address, and a signing key for archivecow */
|
|
||||||
public function canDeliver(): bool
|
|
||||||
{
|
|
||||||
return $this->address !== '' && ($this->profile !== 'archivecow' || $this->signingKey !== '');
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Next hop for Postfix: [host]:port, else the domain of the address (MX lookup), with the port when not 25 */
|
|
||||||
public function nexthop(): string
|
|
||||||
{
|
|
||||||
if ($this->host !== '') {
|
|
||||||
$host = filter_var($this->host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) ? 'ipv6:' . $this->host : $this->host;
|
|
||||||
return '[' . $host . ']:' . $this->port;
|
|
||||||
}
|
|
||||||
$domain = substr($this->address, (int)strrpos($this->address, '@') + 1);
|
|
||||||
return ($this->port === 25) ? $domain : $domain . ':' . $this->port;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** API representation (GET archive/settings), without secrets */
|
|
||||||
public function toArray(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'enabled' => (int)$this->enabled,
|
|
||||||
'address' => $this->address,
|
|
||||||
'host' => $this->host,
|
|
||||||
'port' => $this->port,
|
|
||||||
'tls' => $this->tls,
|
|
||||||
'username' => $this->username,
|
|
||||||
'has_password' => (int)($this->password !== ''),
|
|
||||||
'profile' => $this->profile,
|
|
||||||
'has_signing_secret' => (int)($this->signingKey !== ''),
|
|
||||||
'header_from' => $this->headerFrom,
|
|
||||||
'header_rcpt' => $this->headerRcpt,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loaded 100 of 291 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user