Skip to content

Commit 918a566

Browse files
committed
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
1 parent 5261762 commit 918a566

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/splitgpg/tests.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -449,13 +449,13 @@ def setUp(self):
449449
# IMAP configuration
450450
self.imap_pw = "pass"
451451
self.frontend.run(
452-
'echo "mail_location=maildir:~/Mail" |\
453-
sudo tee /etc/dovecot/conf.d/100-mail.conf', wait=True)
454-
self.frontend.run('sudo systemctl restart dovecot', wait=True)
455-
self.frontend.run( # set a user password because IMAP needs one for auth
456-
'sudo usermod -p `echo "{}" | openssl passwd --stdin` user'\
457-
.format(self.imap_pw),
458-
wait=True)
452+
'echo "mail_location=maildir:~/Mail\nuserdb {\n driver = passwd\n}\npassdb {\n driver = static\n args = password=pass\n}" |\
453+
tee /etc/dovecot/conf.d/100-mail.conf', wait=True, user="root")
454+
self.frontend.run(
455+
"sed -i 's/^!include/#\\0/' /etc/dovecot/conf.d/10-auth.conf",
456+
wait=True, user="root")
457+
self.frontend.run('systemctl restart dovecot',
458+
wait=True, user="root")
459459

460460
self.setup_tb_profile(setup_openpgp=True)
461461

0 commit comments

Comments
 (0)