mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-19 14:57:04 +00:00
test: Support Dovecot 2.4 in the integration tests
Dovecot 2.4 has a new configuration format, which is unfortunately backwards-incompatible with Dovecot 2.3. This patch adds a 2.4-compatible config, and selects which one to use based on the Dovecot version in the environment. In the future, once 2.4 becomes more common, we will drop the 2.3 config from the test. Note that we don't change the config used in the Docker image, because that is based on Debian **stable** which is still on 2.3.
This commit is contained in:
@@ -25,8 +25,24 @@ export ROOT="/tmp/chasquid-dovecot-test"
|
||||
mkdir -p $ROOT $ROOT/run $ROOT/lib
|
||||
rm -f $ROOT/dovecot.log
|
||||
|
||||
# Dovecot 2.4 config is not backwards compatible with 2.3.
|
||||
# Since for now both are popular, we support testing against either.
|
||||
# TODO: Remove 2.3 support once 2.4 becomes more common.
|
||||
case "$(dovecot --version | cut -d . -f 1-2)" in
|
||||
2.3)
|
||||
DOVE_VER=2.3
|
||||
;;
|
||||
2.4)
|
||||
DOVE_VER=2.4
|
||||
;;
|
||||
*)
|
||||
skip "unknown dovecot version $(dovecot --version)"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
GROUP=$(id -g -n) envsubst \
|
||||
< config/dovecot.conf.in > $ROOT/dovecot.conf
|
||||
< config/dovecot.conf-$DOVE_VER.in > $ROOT/dovecot.conf
|
||||
cp -f config/passwd $ROOT/passwd
|
||||
|
||||
dovecot -F -c $ROOT/dovecot.conf &
|
||||
|
||||
Reference in New Issue
Block a user