From 66aeda7f653cfb72731fe7ff2925d7291158500f Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Fri, 25 Apr 2025 17:59:57 +0200 Subject: Port tests and documentation to Dovecot 2.4. See https://doc.dovecot.org/main/installation/upgrade/2.3-to-2.4.html . --- tests/run | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'tests/run') diff --git a/tests/run b/tests/run index eed77df..c5614ee 100755 --- a/tests/run +++ b/tests/run @@ -97,9 +97,12 @@ prepare() { mkdir -pm0700 -- "$home/.dovecot" cat >"$home/.dovecot/config" <<-EOF + dovecot_config_version = 2.4.0 + dovecot_storage_version = 2.4.0 log_path = $HOME_local/mail.log mail_home = $home - mail_location = dbox:~/inbox:LAYOUT=index + mail_driver = sdbox + mail_path = ~/inbox mailbox_list_index = yes ssl = no listen = 127.0.0.1, 127.0.1.1, ::1 @@ -116,7 +119,9 @@ prepare() { proto="$(env -i "${ENVIRON[@]}" doveconf -c "$home/.dovecot/config" -h protocols)" if [ -n "$proto" ]; then cat >>"$home/.dovecot/config" <<-EOF - # https://wiki.dovecot.org/HowTo/Rootless + # https://doc.dovecot.org/latest/core/config/rootless.html#rootless-installation + dovecot_config_version = 2.4.0 + dovecot_storage_version = 2.4.0 base_dir = $home/.dovecot/run default_internal_user = $(id -un) default_internal_group = $(id -gn) @@ -132,13 +137,14 @@ prepare() { chroot = } - passdb { - args = scheme=PLAIN username_format=%u $home/.dovecot/users + passdb passwd-file { driver = passwd-file + default_password_scheme = plain + passwd_file_path = $home/.dovecot/users } - userdb { - args = username_format=%u $home/.dovecot/users + userdb passwd-file { driver = passwd-file + passwd_file_path = $home/.dovecot/users } EOF @@ -352,9 +358,9 @@ check_mailbox_status2() { check_mailbox_status_values "$u" "$rmailbox" $rUIDVALIDITY $rUIDNEXT $rHIGHESTMODSEQ $MESSAGES local a b - a="$(doveadm -u "local" -f "flow" mailbox status "messages unseen vsize" -- "$lmailbox" | \ + a="$(doveadm -u "local" -f "flow" mailbox status --no-userdb-lookup "messages unseen vsize" -- "$lmailbox" | \ sed -nr '/.*\s+(\w+=[0-9]+\s+\w+=[0-9]+\s+\w+=[0-9]+)$/ {s//\1/p;q}')" - b="$(doveadm -u "$u" -f "flow" mailbox status "messages unseen vsize" -- "$rmailbox" | \ + b="$(doveadm -u "$u" -f "flow" mailbox status --no-userdb-lookup "messages unseen vsize" -- "$rmailbox" | \ sed -nr '/.*\s+(\w+=[0-9]+\s+\w+=[0-9]+\s+\w+=[0-9]+)$/ {s//\1/p;q}')" if [ "$a" != "$b" ]; then echo "Mailbox $lmailbox status differs: \"$a\" != \"$b\"" >&2 @@ -363,7 +369,7 @@ check_mailbox_status2() { } check_mailbox_status_values() { local user="$1" mailbox="$2" UIDVALIDITY="$3" UIDNEXT="$4" HIGHESTMODSEQ="$5" MESSAGES="$6" x xs v k - xs="$(doveadm -u "$user" -f "flow" mailbox status "uidvalidity uidnext highestmodseq messages" -- "$mailbox" | \ + xs="$(doveadm -u "$user" -f "flow" mailbox status --no-userdb-lookup "uidvalidity uidnext highestmodseq messages" -- "$mailbox" | \ sed -nr '/.*\s+(\w+=[0-9]+\s+\w+=[0-9]+\s+\w+=[0-9]+\s+\w+=[0-9]+)$/ {s//\1/p;q}')" [ -n "$xs" ] || exit 1 for x in $xs; do @@ -411,12 +417,12 @@ check_mailbox_list() { done fi - mapfile -t lmailboxes < <( doveadm -u "local" mailbox list $sub -- "${lmailboxes[@]}" ) + mapfile -t lmailboxes < <( doveadm -u "local" mailbox list --no-userdb-lookup $sub -- "${lmailboxes[@]}" ) for ((i = 0; i < ${#lmailboxes[@]}; i++)); do lmailboxes[i]="${lmailboxes[i]#"$lprefix"}" done - mapfile -t rmailboxes < <( doveadm -u "remote" mailbox list $sub -- "${rmailboxes[@]}" ) + mapfile -t rmailboxes < <( doveadm -u "remote" mailbox list --no-userdb-lookup $sub -- "${rmailboxes[@]}" ) for ((i = 0; i < ${#rmailboxes[@]}; i++)); do rmailboxes[i]="${rmailboxes[i]#"$rprefix"}" rmailboxes[i]="${rmailboxes[i]//"$rsep"/"$lsep"}" -- cgit v1.2.3