Skip to content

Commit c0e3269

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 c776577 commit c0e3269

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

splitgpg2tests/tests.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,13 @@ def setUp(self):
371371
# IMAP configuration
372372
self.imap_pw = "pass"
373373
self.frontend.run(
374-
'echo "mail_location=maildir:~/Mail" |\
375-
sudo tee /etc/dovecot/conf.d/100-mail.conf', wait=True)
376-
self.frontend.run('sudo systemctl restart dovecot', wait=True)
377-
self.frontend.run( # set a user password because IMAP needs one for auth
378-
'sudo usermod -p `echo "{}" | openssl passwd --stdin` user'\
379-
.format(self.imap_pw),
380-
wait=True)
374+
'echo "mail_location=maildir:~/Mail\nuserdb {\n driver = passwd\n}passdb {\n driver = static\n args = password=pass\n}" |\
375+
tee /etc/dovecot/conf.d/100-mail.conf', wait=True, user="root")
376+
self.frontend.run(
377+
"sed -i 's/^!include/#\\0/' /etc/dovecot/conf.d/10-auth.conf",
378+
wait=True, user="root")
379+
self.frontend.run('systemctl restart dovecot',
380+
wait=True, user="root")
381381

382382
self.setup_tb_profile(setup_openpgp=True)
383383

0 commit comments

Comments
 (0)