Skip to content

Commit e10532a

Browse files
authored
Update to Debian Bookworm (mailserver2/debian-mail-overlay:1.0.12) (#56)
* Install python3-watchdog package instead of pip3 install * Update to base image 1.0.12. Small changes to Dockerfile for debian bookworm. Fix a few failing tests. * Fix waiting for containers. Wait until a successful connection is established.
1 parent 00a1964 commit e10532a

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mailserver2/debian-mail-overlay:1.0.11
1+
FROM mailserver2/debian-mail-overlay:1.0.12
22

33
LABEL description="Simple and full-featured mail server using Docker"
44

@@ -10,17 +10,16 @@ RUN apt-get update && apt-get install -y -q --no-install-recommends \
1010
dovecot-core dovecot-imapd dovecot-lmtpd dovecot-pgsql dovecot-mysql dovecot-ldap dovecot-sieve dovecot-managesieved dovecot-pop3d \
1111
fetchmail libdbi-perl libdbd-pg-perl libdbd-mysql-perl liblockfile-simple-perl \
1212
clamav clamav-daemon \
13-
python3-pip python3-setuptools python3-wheel python3-gpg \
14-
rsyslog dnsutils curl unbound jq rsync \
13+
python3-pip python3-setuptools python3-wheel python3-gpg python3-watchdog \
14+
rsyslog dnsutils curl unbound unbound-anchor jq rsync \
1515
inotify-tools \
1616
# To enable compression in imap
1717
arj bzip2 cabextract cpio file gzip nomarch pax unzip zip \
1818
&& rm -rf /var/spool/postfix \
1919
&& ln -s /var/mail/postfix/spool /var/spool/postfix \
2020
&& apt-get autoremove -y \
2121
&& apt-get clean \
22-
&& rm -rf /tmp/* /var/lib/apt/lists/* /var/cache/debconf/*-old \
23-
&& pip3 install watchdog
22+
&& rm -rf /tmp/* /var/lib/apt/lists/* /var/cache/debconf/*-old
2423

2524
EXPOSE 25 143 465 587 993 4190 11334
2625
COPY rootfs /

Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ init_redis:
3636
docker run \
3737
-d \
3838
--name redis \
39-
-t redis:6.2-alpine
39+
-t redis:7.0-alpine
4040
sleep 10
4141

4242
init_mariadb:
@@ -51,7 +51,7 @@ init_mariadb:
5151
-e MYSQL_PASSWORD=testpasswd \
5252
-v "`pwd`/test/config/mariadb/struct.sql":/docker-entrypoint-initdb.d/struct.sql \
5353
-v "`pwd`/test/config/mariadb/bind.cnf":/etc/mysql/conf.d/bind.cnf \
54-
-t mysql:5.7
54+
-t mysql:8
5555

5656
init_postgres:
5757
-docker rm -f \
@@ -198,7 +198,8 @@ init_ldap2: init_openldap init_redis
198198
-h mail.domain.tld \
199199
-t $(NAME)
200200
fixtures_ldap2:
201-
sleep 20
201+
docker exec mailserver_ldap2 /bin/sh -c "while ! echo PING | nc -z 0.0.0.0 25 ; do sleep 1 ; done"
202+
sleep 30
202203
docker exec mailserver_ldap2 /bin/sh -c "nc 0.0.0.0 25 < /tmp/tests/email-templates/external-to-existing-user.txt"
203204
docker exec mailserver_ldap2 /bin/sh -c "nc 0.0.0.0 25 < /tmp/tests/email-templates/external-to-valid-user-subaddress.txt"
204205
docker exec mailserver_ldap2 /bin/sh -c "nc 0.0.0.0 25 < /tmp/tests/email-templates/external-to-non-existing-user.txt"
@@ -282,6 +283,7 @@ init_reverse: init_redis init_postgres
282283
-v "`pwd`/test/share/letsencrypt":/etc/letsencrypt \
283284
-t $(NAME)
284285
fixtures_reverse:
286+
docker exec mailserver_reverse /bin/sh -c "while ! echo PING | nc -z 0.0.0.0 25 ; do sleep 1 ; done"
285287
sleep 30
286288
docker exec mailserver_reverse /bin/sh -c "nc 0.0.0.0 25 < /tmp/tests/email-templates/external-to-existing-user.txt"
287289
docker exec mailserver_reverse /bin/sh -c "nc 0.0.0.0 25 < /tmp/tests/email-templates/external-to-valid-user-subaddress-with-default-separator.txt"
@@ -318,8 +320,8 @@ init_ecdsa: init_redis init_mariadb
318320
-v "`pwd`/test/share/postfix/custom.ecdsa.conf":/var/mail/postfix/custom.conf \
319321
-h mail.domain.tld \
320322
-t $(NAME)
321-
sleep 10
322323
run_ecdsa:
324+
docker exec mailserver_ecdsa /bin/sh -c "while ! echo PING | nc -z 0.0.0.0 587 ; do sleep 1 ; done"
323325
./test/bats/bin/bats test/ecdsa.bats
324326
stop_ecdsa:
325327
-docker rm -f \
@@ -344,7 +346,7 @@ init_traefik_acmev1: init_redis init_mariadb
344346
-h mail.domain.tld \
345347
-t $(NAME)
346348
run_traefik_acmev1:
347-
sleep 20
349+
docker exec mailserver_traefik_acmev1 /bin/sh -c "while ! echo PING | nc -z 0.0.0.0 587 ; do sleep 1 ; done"
348350
./test/bats/bin/bats test/traefik_acmev1.bats
349351
stop_traefik_acmev1:
350352
-docker rm -f \
@@ -369,7 +371,7 @@ init_traefik_acmev2: init_redis init_mariadb
369371
-h mail.domain.tld \
370372
-t $(NAME)
371373
run_traefik_acmev2:
372-
sleep 20
374+
docker exec mailserver_traefik_acmev2 /bin/sh -c "while ! echo PING | nc -z 0.0.0.0 587 ; do sleep 1 ; done"
373375
./test/bats/bin/bats test/traefik_acmev2.bats
374376
stop_traefik_acmev2:
375377
-docker rm -f \

test/default.bats

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ load 'test_helper/bats-assert/load'
626626
#
627627

628628
@test "checking clamav: TCP Bound to 3310 port" {
629-
run docker exec mailserver_default grep -i 'TCP: Bound to \[0.0.0.0\]:3310' /var/log/mail.log
629+
run docker exec mailserver_default grep -i 'TCP: Bound to \[\]:3310' /var/log/mail.log
630630
assert_success
631631
}
632632

@@ -804,7 +804,7 @@ load 'test_helper/bats-assert/load'
804804
#
805805

806806
@test "checking ssl: generated default cert works correctly" {
807-
run docker exec mailserver_default /bin/sh -c "timeout 1 openssl s_client -ign_eof -connect 0.0.0.0:587 -starttls smtp | grep 'Verify return code: 18 (self signed certificate)'"
807+
run docker exec mailserver_default /bin/sh -c "timeout 1 openssl s_client -ign_eof -connect 0.0.0.0:587 -starttls smtp | grep 'Verify return code: 18 (self-signed certificate)'"
808808
assert_success
809809
}
810810

test/ecdsa.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ load 'test_helper/bats-assert/load'
2626
#
2727

2828
@test "checking ssl: ECDSA P-384 cert works correctly" {
29-
run docker exec mailserver_ecdsa /bin/sh -c "timeout 1 openssl s_client -ign_eof -connect 0.0.0.0:587 -starttls smtp | grep 'Verify return code: 18 (self signed certificate)'"
29+
run docker exec mailserver_ecdsa /bin/sh -c "timeout 1 openssl s_client -ign_eof -connect 0.0.0.0:587 -starttls smtp | grep 'Verify return code: 18 (self-signed certificate)'"
3030
assert_success
3131
}
3232

0 commit comments

Comments
 (0)