From 918a566647eda2d22f167fe6fd178f3cc2c978b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 9 Jun 2025 03:58:32 +0200 Subject: [PATCH] tests: fix setting up IMAP on Whonix Whonix recently introduced user-sysmaint-split, which blocks sudo on normal user account. And also a related but separate change blocks logging as "user" with a password (even when set). Fix both issues by: - not using sudo during setup - not using PAM for authentication, and configuring dovecot with a static password instead Fixes QubesOS/qubes-issues#9995 --- tests/splitgpg/tests.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/splitgpg/tests.py b/tests/splitgpg/tests.py index 2853676..6cf1dff 100644 --- a/tests/splitgpg/tests.py +++ b/tests/splitgpg/tests.py @@ -449,13 +449,13 @@ def setUp(self): # IMAP configuration self.imap_pw = "pass" self.frontend.run( - 'echo "mail_location=maildir:~/Mail" |\ - sudo tee /etc/dovecot/conf.d/100-mail.conf', wait=True) - self.frontend.run('sudo systemctl restart dovecot', wait=True) - self.frontend.run( # set a user password because IMAP needs one for auth - 'sudo usermod -p `echo "{}" | openssl passwd --stdin` user'\ - .format(self.imap_pw), - wait=True) + '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") + self.frontend.run( + "sed -i 's/^!include/#\\0/' /etc/dovecot/conf.d/10-auth.conf", + wait=True, user="root") + self.frontend.run('systemctl restart dovecot', + wait=True, user="root") self.setup_tb_profile(setup_openpgp=True)