From 1ed66d18ee678538da4556c8bf52c385fbdd81a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 4 Aug 2025 00:23:17 +0200 Subject: [PATCH] tests: adjust tests for Dovecot 2.4 Dovecot 2.4 (used in Debian trixie) changed its configuration significantly. Have two sections for the old and the new version. QubesOS/qubes-issues#8841 --- splitgpg2tests/tests.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/splitgpg2tests/tests.py b/splitgpg2tests/tests.py index ebe051a..44bb5b0 100644 --- a/splitgpg2tests/tests.py +++ b/splitgpg2tests/tests.py @@ -370,9 +370,14 @@ def setUp(self): # IMAP configuration self.imap_pw = "pass" - self.frontend.run( - 'echo "mail_location=maildir:~/Mail\nuserdb {\n driver = passwd\n}\npassdb {\n driver = static\n args = password=pass\n}" |\ - tee /etc/dovecot/conf.d/100-mail.conf', wait=True, user="root") + if self.frontend.run("grep -q mail_driver /etc/dovecot/conf.d/10-mail.conf", wait=True) == 0: + self.frontend.run( + 'echo "mail_driver = maildir\nmail_path = ~/Mail\nmail_inbox_path = ~/Mail\nuserdb static {\n driver = passwd\n}\npassdb static {\n driver = static\n password=pass\n}" |\ + tee /etc/dovecot/conf.d/100-mail.conf', wait=True, user="root") + else: + self.frontend.run( + 'echo "mail_location=maildir:~/Mail\nuserdb {\n driver = passwd\n}\npassdb $db_name {\n driver = static\n args = password=pass\n}" |\ + tee /etc/dovecot/conf.d/100-mail.conf', wait=True, user="root") self.frontend.run( "sed -i 's/^!include/#\\0/' /etc/dovecot/conf.d/10-auth.conf", wait=True, user="root")