Skip to content

Commit 2d1ef41

Browse files
Merge pull request #6335 from mailcow/staging
Update 2025-02
2 parents 120366f + 3c9d0c9 commit 2d1ef41

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+259
-99
lines changed

.github/workflows/check_prs_if_on_staging.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: Send message
1313
uses: thollander/[email protected]
1414
with:
15-
GITHUB_TOKEN: ${{ secrets.CHECKIFPRISSTAGING_ACTION_PAT }}
15+
github-token: ${{ secrets.CHECKIFPRISSTAGING_ACTION_PAT }}
1616
message: |
1717
Thanks for contributing!
1818

.github/workflows/pr_to_nightly.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
with:
1313
fetch-depth: 0
1414
- name: Run the Action
15-
uses: devops-infra/action-pull-request@v0.5.5
15+
uses: devops-infra/action-pull-request@v0.6.0
1616
with:
1717
github_token: ${{ secrets.PRTONIGHTLY_ACTION_PAT }}
1818
title: Automatic PR to nightly from ${{ github.event.repository.updated_at}}

.github/workflows/rebuild_backup_image.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
jobs:
1010
docker_image_build:
1111
runs-on: ubuntu-latest
12+
permissions:
13+
packages: write
1214
steps:
1315
- name: Checkout
1416
uses: actions/checkout@v4
@@ -19,17 +21,19 @@ jobs:
1921
- name: Set up Docker Buildx
2022
uses: docker/setup-buildx-action@v3
2123

22-
- name: Login to Docker Hub
24+
- name: Login to GHCR
25+
if: github.event_name != 'pull_request'
2326
uses: docker/login-action@v3
2427
with:
25-
username: ${{ secrets.BACKUPIMAGEBUILD_ACTION_DOCKERHUB_USERNAME }}
26-
password: ${{ secrets.BACKUPIMAGEBUILD_ACTION_DOCKERHUB_TOKEN }}
28+
registry: ghcr.io
29+
username: ${{ github.repository_owner }}
30+
password: ${{ secrets.GITHUB_TOKEN }}
2731

2832
- name: Build and push
29-
uses: docker/build-push-action@v6
33+
uses: docker/build-push-action@v5
3034
with:
3135
context: .
3236
platforms: linux/amd64,linux/arm64
3337
file: data/Dockerfiles/backup/Dockerfile
3438
push: true
35-
tags: mailcow/backup:latest
39+
tags: ghcr.io/mailcow/backup:latest

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ data/conf/sogo/custom-theme.js
4747
data/conf/sogo/plist_ldap
4848
data/conf/sogo/sieve.creds
4949
data/conf/sogo/cron.creds
50-
data/conf/sogo/sogo-full.svg
50+
data/conf/sogo/custom-fulllogo.svg
51+
data/conf/sogo/custom-shortlogo.svg
52+
data/conf/sogo/custom-fulllogo.png
5153
data/gitea/
5254
data/gogs/
5355
data/hooks/dovecot/*

data/Dockerfiles/backup/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
FROM debian:bookworm-slim
22

3-
RUN apt update && apt install pigz
3+
RUN apt update && apt install pigz -y --no-install-recommends

data/Dockerfiles/dovecot/quota_notify.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
while True:
2525
try:
26-
r = redis.StrictRedis(host='redis', decode_responses=True, port=6379, db=0, password=os.environ['REDISPASS'])
26+
r = redis.StrictRedis(host='redis', decode_responses=True, port=6379, db=0, username='quota_notify', password='')
2727
r.ping()
2828
except Exception as ex:
2929
print('%s - trying again...' % (ex))

data/Dockerfiles/dovecot/syslog-ng-redis_slave.conf

+5
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,13 @@ filter f_replica {
3838
not match("User has no mail_replica in userdb" value("MESSAGE"));
3939
not match("Error: sync: Unknown user in remote" value("MESSAGE"));
4040
};
41+
filter f_dovecot_auth_try {
42+
not match("- trying the next passdb" value("MESSAGE")) and
43+
not match("- trying the next userdb" value("MESSAGE"));
44+
};
4145
log {
4246
source(s_dgram);
47+
filter(f_dovecot_auth_try);
4348
filter(f_replica);
4449
destination(d_stdout);
4550
filter(f_mail);

data/Dockerfiles/dovecot/syslog-ng.conf

+5
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,13 @@ filter f_replica {
3838
not match("User has no mail_replica in userdb" value("MESSAGE"));
3939
not match("Error: sync: Unknown user in remote" value("MESSAGE"));
4040
};
41+
filter f_dovecot_auth_try {
42+
not match("- trying the next passdb" value("MESSAGE")) and
43+
not match("- trying the next userdb" value("MESSAGE"));
44+
};
4145
log {
4246
source(s_dgram);
47+
filter(f_dovecot_auth_try);
4348
filter(f_replica);
4449
destination(d_stdout);
4550
filter(f_mail);

data/Dockerfiles/netfilter/main.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,10 @@ def refreshF2bregex():
8585
f2bregex[3] = r'warning: .*\[([0-9a-f\.:]+)\]: SASL .+ authentication failed: (?!.*Connection lost to authentication server).+'
8686
f2bregex[4] = r'warning: non-SMTP command from .*\[([0-9a-f\.:]+)]:.+'
8787
f2bregex[5] = r'NOQUEUE: reject: RCPT from \[([0-9a-f\.:]+)].+Protocol error.+'
88-
f2bregex[6] = r'-login: Disconnected.+ \(auth failed, .+\): user=.*, method=.+, rip=([0-9a-f\.:]+),'
89-
f2bregex[7] = r'-login: Aborted login.+ \(auth failed .+\): user=.+, rip=([0-9a-f\.:]+), lip.+'
90-
f2bregex[8] = r'-login: Aborted login.+ \(tried to use disallowed .+\): user=.+, rip=([0-9a-f\.:]+), lip.+'
91-
f2bregex[9] = r'SOGo.+ Login from \'([0-9a-f\.:]+)\' for user .+ might not have worked'
92-
f2bregex[10] = r'([0-9a-f\.:]+) \"GET \/SOGo\/.* HTTP.+\" 403 .+'
88+
f2bregex[6] = r'\w+\([^,]+,([0-9a-f\.:]+),<[^>]+>\): Password mismatch \(SHA1 of given password: [a-f0-9]+\)'
89+
f2bregex[7] = r'\w+\([^,]+,([0-9a-f\.:]+),<[^>]+>\): unknown user \(SHA1 of given password: [a-f0-9]+\)'
90+
f2bregex[8] = r'SOGo.+ Login from \'([0-9a-f\.:]+)\' for user .+ might not have worked'
91+
f2bregex[9] = r'([0-9a-f\.:]+) \"GET \/SOGo\/.* HTTP.+\" 403 .+'
9392
r.set('F2B_REGEX', json.dumps(f2bregex, ensure_ascii=False))
9493
else:
9594
try:

data/Dockerfiles/nginx/bootstrap.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ def nginx_conf(env, template_vars):
4343
def prepare_template_vars():
4444
ipv4_network = os.getenv("IPV4_NETWORK", "172.22.1")
4545
additional_server_names = os.getenv("ADDITIONAL_SERVER_NAMES", "")
46+
trusted_proxies = os.getenv("TRUSTED_PROXIES", "")
4647

4748
template_vars = {
4849
'IPV4_NETWORK': ipv4_network,
49-
'TRUSTED_NETWORK': os.getenv("TRUSTED_NETWORK", False),
50+
'TRUSTED_PROXIES': [item.strip() for item in trusted_proxies.split(",") if item.strip()],
5051
'SKIP_RSPAMD': os.getenv("SKIP_RSPAMD", "n").lower() in ("y", "yes"),
5152
'SKIP_SOGO': os.getenv("SKIP_SOGO", "n").lower() in ("y", "yes"),
5253
'NGINX_USE_PROXY_PROTOCOL': os.getenv("NGINX_USE_PROXY_PROTOCOL", "n").lower() in ("y", "yes"),

data/Dockerfiles/postfix/postfix.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,11 @@ postscreen_dnsbl_sites = wl.mailspike.net=127.0.0.[18;19;20]*-2
416416
bl.mailspike.net=127.0.0.[10;11;12]*4
417417
EOF
418418
fi
419-
DNSBL_CONFIG=$(grep -v '^#' /opt/postfix/conf/dns_blocklists.cf | grep '\S')
420419

421-
# Remove discontinued Nixspam DNSBL from existing dns_blocklists.cf
422-
sed -i '/ix\.dnsbl\.manitu\.net\*2/d' /opt/postfix/conf/dns_blocklists.cf
420+
# Remove discontinued DNSBLs from existing dns_blocklists.cf
421+
sed -i '/ix\.dnsbl\.manitu\.net\*2/d' /opt/postfix/conf/dns_blocklists.cf # Nixspam
422+
423+
DNSBL_CONFIG=$(grep -v '^#' /opt/postfix/conf/dns_blocklists.cf | grep '\S')
423424

424425
if [ ! -z "$DNSBL_CONFIG" ]; then
425426
echo -e "\e[33mChecking if ASN for your IP is listed for Spamhaus Bad ASN List...\e[0m"

data/Dockerfiles/rspamd/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM debian:bookworm-slim
22
LABEL maintainer="The Infrastructure Company GmbH <[email protected]>"
33

44
ARG DEBIAN_FRONTEND=noninteractive
5-
ARG RSPAMD_VER=rspamd_3.10.2-1~b8a232043
5+
ARG RSPAMD_VER=rspamd_3.11.0-2~90a175b45
66
ARG CODENAME=bookworm
77
ENV LC_ALL=C
88

data/Dockerfiles/sogo/Dockerfile

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LABEL maintainer="The Infrastructure Company GmbH <[email protected]>"
44

55
ARG DEBIAN_FRONTEND=noninteractive
66
ARG DEBIAN_VERSION=bookworm
7-
ARG SOGO_DEBIAN_REPOSITORY=http://www.axis.cz/linux/debian
7+
ARG SOGO_DEBIAN_REPOSITORY=https://packagingv2.sogo.nu/sogo-nightly-debian/
88
# renovate: datasource=github-releases depName=tianon/gosu versioning=semver-coerced extractVersion=^(?<version>.*)$
99
ARG GOSU_VERSION=1.17
1010
ENV LC_ALL=C
@@ -33,9 +33,8 @@ RUN echo "Building from repository $SOGO_DEBIAN_REPOSITORY" \
3333
&& gosu nobody true \
3434
&& mkdir /usr/share/doc/sogo \
3535
&& touch /usr/share/doc/sogo/empty.sh \
36-
&& wget http://www.axis.cz/linux/debian/axis-archive-keyring.deb -O /tmp/axis-archive-keyring.deb \
37-
&& apt install -y /tmp/axis-archive-keyring.deb \
38-
&& echo "deb [trusted=yes] ${SOGO_DEBIAN_REPOSITORY} ${DEBIAN_VERSION} sogo-v5" > /etc/apt/sources.list.d/sogo.list \
36+
&& wget -O- https://keys.openpgp.org/vks/v1/by-fingerprint/74FFC6D72B925A34B5D356BDF8A27B36A6E2EAE9 | gpg --dearmor | apt-key add - \
37+
&& echo "deb [trusted=yes] ${SOGO_DEBIAN_REPOSITORY} ${DEBIAN_VERSION} main" > /etc/apt/sources.list.d/sogo.list \
3938
&& apt-get update && apt-get install -y --no-install-recommends \
4039
sogo \
4140
sogo-activesync \

data/Dockerfiles/sogo/bootstrap-sogo.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if [[ "${MASTER}" =~ ^([yY][eE][sS]|[yY])+$ ]]; then
3030
mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} -e "DROP VIEW IF EXISTS sogo_view"
3131
while [[ ${VIEW_OK} != 'OK' ]]; do
3232
mysql --socket=/var/run/mysqld/mysqld.sock -u ${DBUSER} -p${DBPASS} ${DBNAME} << EOF
33-
CREATE VIEW sogo_view (c_uid, domain, c_name, c_password, c_cn, mail, aliases, ad_aliases, ext_acl, kind, multiple_bookings) AS
33+
CREATE VIEW sogo_view (c_uid, domain, c_name, c_password, c_cn, mail, aliases, ad_aliases, ext_acl, kind, multiple_bookings) AS
3434
SELECT
3535
mailbox.username,
3636
mailbox.domain,
@@ -240,8 +240,8 @@ chmod 600 /var/lib/sogo/GNUstep/Defaults/sogod.plist
240240
# fi
241241
#fi
242242

243-
# Copy logo, if any
244-
[[ -f /etc/sogo/sogo-full.svg ]] && cp /etc/sogo/sogo-full.svg /usr/lib/GNUstep/SOGo/WebServerResources/img/sogo-full.svg
243+
# Rename custom logo, if any
244+
[[ -f /etc/sogo/sogo-full.svg ]] && mv /etc/sogo/sogo-full.svg /etc/sogo/custom-fulllogo.svg
245245

246246
# Rsync web content
247247
echo "Syncing web content with named volume"

data/assets/ssl-example/dhparams.pem

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
-----BEGIN DH PARAMETERS-----
2-
MIIBCAKCAQEA9iHB0CRDhV8wfBgqnmvuJpl0fzL3qL75R4ZvQHlfMNLrxuIz2x9D
3-
9zcDhPcBTVzV5Ay0AAkke4wP6r6wDQqXqBP4Y8IOkYAyLh3jM40jfHQzQt+5JdQl
4-
ond3kiscBsFOch/vMfSLMu3lAb0YhPNTvrxhMz7LcVAWYl82swASupdiKR+MgaQr
5-
XsugpmDKsHW60VmIM9B7K9Y+rNHwvMWkmISd0KxA8oOy1WJvsVEissMALZDE3c4w
6-
2xHmO2lXxgEx3aez28736t4m/KW3g9Zr31a1M0KusmfY//fGkPk4NUrLBOS2xrgp
7-
Y/rG1qSBdcVyerM0Ki93qCyHKYu4ene0OwIBAg==
2+
MIIBCAKCAQEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz
3+
+8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a
4+
87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7
5+
YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi
6+
7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD
7+
ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg==
88
-----END DH PARAMETERS-----

data/conf/dovecot/dovecot.conf

+1
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ imap_max_line_length = 2 M
278278
#auth_cache_negative_ttl = 0
279279
#auth_cache_ttl = 30 s
280280
#auth_cache_size = 2 M
281+
auth_verbose_passwords = sha1:6
281282
service replicator {
282283
process_min_avail = 1
283284
}

data/conf/mysql/my.cnf

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[mysqld]
22
character-set-client-handshake = FALSE
33
character-set-server = utf8mb4
4-
collation-server = utf8mb4_unicode_ci
4+
collation-server = utf8mb4_general_ci
55
#innodb_file_per_table = TRUE
66
#innodb_file_format = barracuda
77
#innodb_large_prefix = TRUE
@@ -20,7 +20,7 @@ thread_cache_size = 8
2020
query_cache_type = 0
2121
query_cache_size = 0
2222
max_heap_table_size = 48M
23-
thread_stack = 192K
23+
thread_stack = 256K
2424
skip-host-cache
2525
skip-name-resolve
2626
log-warnings = 0

data/conf/nginx/templates/sites-default.conf.j2

+4-2
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ set_real_ip_from 10.0.0.0/8;
5252
set_real_ip_from 172.16.0.0/12;
5353
set_real_ip_from 192.168.0.0/16;
5454
set_real_ip_from fc00::/7;
55-
{% if not TRUSTED_NETWORK %}
55+
{% for TRUSTED_PROXY in TRUSTED_PROXIES %}
56+
set_real_ip_from {{ TRUSTED_PROXY }};
57+
{% endfor %}
58+
{% if not NGINX_USE_PROXY_PROTOCOL %}
5659
real_ip_header X-Forwarded-For;
5760
{% else %}
58-
set_real_ip_from {{ TRUSTED_NETWORK }};
5961
real_ip_header proxy_protocol;
6062
{% endif %}
6163
real_ip_recursive on;

data/conf/postfix/main.cf

+2-3
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,9 @@ transport_maps = pcre:/opt/postfix/conf/custom_transport.pcre,
162162
proxy:mysql:/opt/postfix/conf/sql/mysql_relay_ne.cf,
163163
proxy:mysql:/opt/postfix/conf/sql/mysql_transport_maps.cf
164164
smtp_sasl_auth_soft_bounce = no
165-
postscreen_discard_ehlo_keywords = silent-discard, dsn, chunking
166-
smtpd_discard_ehlo_keywords = chunking, silent-discard
165+
postscreen_discard_ehlo_keywords = chunking, silent-discard, smtputf8, dsn
166+
smtpd_discard_ehlo_keywords = chunking, silent-discard, smtputf8
167167
compatibility_level = 3.7
168-
smtputf8_enable = no
169168
# Define protocols for SMTPS and submission service
170169
submission_smtpd_tls_mandatory_protocols = >=TLSv1.2
171170
smtps_smtpd_tls_mandatory_protocols = >=TLSv1.2

data/conf/redis/redis-conf.sh

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
cat <<EOF > /redis.conf
44
requirepass $REDISPASS
5+
user quota_notify on nopass ~QW_* -@all +get +hget +ping
56
EOF
67

8+
if [ -n "$REDISMASTERPASS" ]; then
9+
echo "masterauth $REDISMASTERPASS" >> /redis.conf
10+
fi
11+
712
exec redis-server /redis.conf

data/conf/rspamd/local.d/options.inc

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ dns {
33
}
44
map_watch_interval = 30s;
55
task_timeout = 30s;
6+
enable_mime_utf = true;
67
disable_monitoring = true;
78
# In case a task times out (like DNS lookup), soft reject the message
89
# instead of silently accepting the message without further processing.

data/conf/sogo/custom-fulllogo.png

2.22 KB
Loading

data/conf/sogo/custom-fulllogo.svg

+44
Loading

data/conf/sogo/custom-shortlogo.svg

+16
Loading

data/web/edit.php

+3
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@
166166
if (substr($result['recipient_map_old'], 0, 1) == '@') {
167167
$result['recipient_map_old'] = substr($result['recipient_map_old'], 1);
168168
}
169+
if (substr($result['recipient_map_new'], 0, 1) == '@') {
170+
$result['recipient_map_new'] = substr($result['recipient_map_new'], 1);
171+
}
169172
$template = 'edit/recipient_map.twig';
170173
$template_data = ['map' => $map];
171174
}

0 commit comments

Comments
 (0)