[GH-ISSUE #2084] Default password scheme list is empty #1520

Closed
opened 2026-02-27 11:17:32 +03:00 by kerem · 10 comments
Owner

Originally created by @bosgold on GitHub (Nov 20, 2020).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/2084

Originally assigned to: @tonioo on GitHub.

Impacted versions

  • OS Type: Debian/Ubuntu
  • OS Version: Ubuntu 18.04
  • Modoboa: 1.17.0
  • Webserver: Nginx
  • Dovecot: 2.3.11.3

Current behavior

Modoboa -> Parameters -> General
Default passwort scheme drop down list is empty but "This field is required".

root # doveadm pw -l
SHA1 SSHA512 SCRAM-SHA-256 BLF-CRYPT PLAIN HMAC-MD5 OTP SHA512 SHA RPA DES-CRYPT CRYPT SSHA MD5-CRYPT SKEY PLAIN-MD4 PLAIN-MD5 SCRAM-SHA-1 LANMAN SHA512-CRYPT CLEAR CLEARTEXT ARGON2I ARGON2ID SSHA256 NTLM MD5 PBKDF2 SHA256 CRAM-MD5 PLAIN-TRUNC SHA256-CRYPT SMD5 DIGEST-MD5 LDAP-MD5

modobao # doveadm pw -l
doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/10-ssl.conf line 18: ssl_key: Can't open file /etc/dovecot/private/dovecot.key.pem: Permission denied

/etc/dovecot/conf.d/10-ssl.conf
# PEM encoded X.509 SSL/TLS certificate and private key. They're opened before
# dropping root privileges, so keep the key file unreadable by anyone but
# root.

Thus when sticking to the advice by Dovecot the command "doveadm pw -l" won't work for the modoboa user. And the "default password scheme" list stays empty.

Originally created by @bosgold on GitHub (Nov 20, 2020). Original GitHub issue: https://github.com/modoboa/modoboa/issues/2084 Originally assigned to: @tonioo on GitHub. # Impacted versions * OS Type: Debian/Ubuntu * OS Version: Ubuntu 18.04 * Modoboa: 1.17.0 * Webserver: Nginx * Dovecot: 2.3.11.3 # Current behavior Modoboa -> Parameters -> General Default passwort scheme drop down list is empty but "This field is required". root # doveadm pw -l SHA1 SSHA512 SCRAM-SHA-256 BLF-CRYPT PLAIN HMAC-MD5 OTP SHA512 SHA RPA DES-CRYPT CRYPT SSHA MD5-CRYPT SKEY PLAIN-MD4 PLAIN-MD5 SCRAM-SHA-1 LANMAN SHA512-CRYPT CLEAR CLEARTEXT ARGON2I ARGON2ID SSHA256 NTLM MD5 PBKDF2 SHA256 CRAM-MD5 PLAIN-TRUNC SHA256-CRYPT SMD5 DIGEST-MD5 LDAP-MD5 modobao # doveadm pw -l doveconf: Fatal: Error in configuration file /etc/dovecot/conf.d/10-ssl.conf line 18: ssl_key: Can't open file /etc/dovecot/private/dovecot.key.pem: Permission denied /etc/dovecot/conf.d/10-ssl.conf `# PEM encoded X.509 SSL/TLS certificate and private key. They're opened before` `# dropping root privileges, so keep the key file unreadable by anyone but` `# root.` Thus when sticking to the advice by Dovecot the command "doveadm pw -l" won't work for the modoboa user. And the "default password scheme" list stays empty.
kerem 2026-02-27 11:17:32 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@tonioo commented on GitHub (Dec 4, 2020):

@bosgold How did you install Modoboa? You need some sudo configuration to make this work.

<!-- gh-comment-id:738655222 --> @tonioo commented on GitHub (Dec 4, 2020): @bosgold How did you install Modoboa? You need some sudo configuration to make this work.
Author
Owner

@fyryNy commented on GitHub (Dec 16, 2020):

Hi, I had the same problem on Ubuntu 20.10, so if someone is struggling with this, this is what I did to fix it:

Edit "/etc/dovecot/dovecot-sql.conf.ext"
Find and uncomment #default_pass_scheme = MD5 and change to "default_pass_scheme = CRYPT" (or just add this line to config file)
Restart services.

It worked for me, so I hope it would work for someone else.

<!-- gh-comment-id:745917138 --> @fyryNy commented on GitHub (Dec 16, 2020): Hi, I had the same problem on Ubuntu 20.10, so if someone is struggling with this, this is what I did to fix it: Edit "/etc/dovecot/dovecot-sql.conf.ext" Find and uncomment #default_pass_scheme = MD5 and change to "default_pass_scheme = CRYPT" (or just add this line to config file) Restart services. It worked for me, so I hope it would work for someone else.
Author
Owner

@bosgold commented on GitHub (Dec 16, 2020):

@bosgold How did you install Modoboa? You need some sudo configuration to make this work.

Installation was using the modoboa-installer. Sometime in 2018.
This problem came however only up when upgrading from Modoboa 1.15 to 1.17. Not sure when I've been the last time on the "Parameters - configure Modoboa" page, maybe not with version 1.15 but surely no later than 1.13 or 1.14. And back than it still worked.

Follwing runs as a crontab

Operations on mailboxes

  •   *       *       *       *       vmail   $PYTHON $INSTANCE/manage.py handle_mailbox_operations
    

"The cron script must be executed by the system user owning the mailboxes." -> system user: vmail

<!-- gh-comment-id:747096438 --> @bosgold commented on GitHub (Dec 16, 2020): > @bosgold How did you install Modoboa? You need some sudo configuration to make this work. Installation was using the modoboa-installer. Sometime in 2018. This problem came however only up when upgrading from Modoboa 1.15 to 1.17. Not sure when I've been the last time on the "Parameters - configure Modoboa" page, maybe not with version 1.15 but surely no later than 1.13 or 1.14. And back than it still worked. Follwing runs as a crontab # Operations on mailboxes * * * * * vmail $PYTHON $INSTANCE/manage.py handle_mailbox_operations "The cron script must be executed by the system user owning the mailboxes." -> system user: vmail
Author
Owner

@tonioo commented on GitHub (Jan 27, 2021):

@bosgold Have you tried to run sudo doveadm pw -l as modoboa user?

<!-- gh-comment-id:768373948 --> @tonioo commented on GitHub (Jan 27, 2021): @bosgold Have you tried to run ``sudo doveadm pw -l`` as modoboa user?
Author
Owner

@reesing322 commented on GitHub (Feb 6, 2021):

As I have the same problem, I can answer this:

modoboa@mail:~$ sudo doveadm pw -l
[sudo] password for modoboa:
Sorry, user modoboa is not allowed to execute '/usr/bin/doveadm pw -l' as root on .

In the modoboa sudoers file is only this:

# This file was automatically installed on 2021-02-02T18:16:57.800271
modoboa ALL=(vmail) NOPASSWD: /usr/bin/doveadm

This is on a rather fresh install, I've used the installer to install modoboa on a clean latest Ubuntu Server.
I think after the installation, when I was first checkout out the website, I've seen 2 options (plain and one of the crypts),
but since I've added a first domain, the 'default password scheme' remains empty, and prevents saves to the parameters section.

<!-- gh-comment-id:774518808 --> @reesing322 commented on GitHub (Feb 6, 2021): As I have the same problem, I can answer this: > modoboa@mail:~$ sudo doveadm pw -l > [sudo] password for modoboa: > Sorry, user modoboa is not allowed to execute '/usr/bin/doveadm pw -l' as root on <host>. In the modoboa sudoers file is only this: > \# This file was automatically installed on 2021-02-02T18:16:57.800271 > modoboa ALL=(vmail) NOPASSWD: /usr/bin/doveadm This is on a rather fresh install, I've used the installer to install modoboa on a clean latest Ubuntu Server. I think after the installation, when I was first checkout out the website, I've seen 2 options (plain and one of the crypts), but since I've added a first domain, the 'default password scheme' remains empty, and prevents saves to the parameters section.
Author
Owner

@bosgold commented on GitHub (Feb 7, 2021):

Same result for me as @reesing322 when I try
modoboa@mail:~$ sudo doveadm pw -l

Also the same /etc/sudoers.d/modoboa content. And this brought me to the idea to try

modoboa@mail:~$ sudo -u vmail doveadm pw -l
doveadm(vmail): Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: Permission denied
SHA1 SSHA512 SCRAM-SHA-256 BLF-CRYPT PLAIN HMAC-MD5 OTP SHA512 SHA RPA DES-CRYPT CRYPT SSHA MD5-CRYPT SKEY PLAIN-MD4 PLAIN-MD5 SCRAM-SHA-1 LANMAN SHA512-CRYPT CLEAR CLEARTEXT ARGON2I ARGON2ID SSHA256 NTLM MD5 PBKDF2 SHA256 CRAM-MD5 PLAIN-TRUNC SHA256-CRYPT SMD5 DIGEST-MD5 LDAP-MD5

At least now without asking for a password.
And when adding the user vmail to the group doveadm the error

doveadm(vmail): Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: Permission denied

is no more showing up.

But this does nothing change about the fact that the key file has to be readable by anyone to work.

-rw-r--r-- /etc/dovecot/private/dovecot.key.pem

and not

-rw------- /etc/dovecot/private/dovecot.key.pem

as suggested.

For this the the modobao sudoers file should read

modoboa ALL=(ALL) NOPASSWD: /usr/bin/doveadm

and with this the command

modoboa@mail:~$ sudo doveadm pw -l

will work as effectively eqivalent with

modoboa@mail:~$ sudo -u root doveadm pw -l

<!-- gh-comment-id:774573923 --> @bosgold commented on GitHub (Feb 7, 2021): Same result for me as @reesing322 when I try modoboa@mail:~$ sudo doveadm pw -l Also the same /etc/sudoers.d/modoboa content. And this brought me to the idea to try > modoboa@mail:~$ sudo -u vmail doveadm pw -l doveadm(vmail): Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: Permission denied SHA1 SSHA512 SCRAM-SHA-256 BLF-CRYPT PLAIN HMAC-MD5 OTP SHA512 SHA RPA DES-CRYPT CRYPT SSHA MD5-CRYPT SKEY PLAIN-MD4 PLAIN-MD5 SCRAM-SHA-1 LANMAN SHA512-CRYPT CLEAR CLEARTEXT ARGON2I ARGON2ID SSHA256 NTLM MD5 PBKDF2 SHA256 CRAM-MD5 PLAIN-TRUNC SHA256-CRYPT SMD5 DIGEST-MD5 LDAP-MD5 At least now without asking for a password. And when adding the user vmail to the group doveadm the error > doveadm(vmail): Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: Permission denied is no more showing up. But this does nothing change about the fact that the key file has to be readable by anyone to work. > -rw-r--r-- /etc/dovecot/private/dovecot.key.pem and not > -rw------- /etc/dovecot/private/dovecot.key.pem as suggested. For this the the modobao sudoers file should read > modoboa ALL=(ALL) NOPASSWD: /usr/bin/doveadm and with this the command > modoboa@mail:~$ sudo doveadm pw -l will work as effectively eqivalent with > modoboa@mail:~$ sudo -u root doveadm pw -l
Author
Owner

@reesing322 commented on GitHub (Feb 7, 2021):

@bosgold @tonioo
Indeed, the solution by Bosgold works. The issue with the empty "Default password scheme list" for me is solved by adding vmail to the dovecot group.

@bosgold Your solution for the 'permission denied' issue with the stats-writer might work, however, accessing the private key should not be necessary in this case. I have implemented the solution given here:
https://github.com/postfixadmin/postfixadmin/issues/381
The config reader will no longer fail over the permission issue, and you private key still has the same level of protection.

<!-- gh-comment-id:774696481 --> @reesing322 commented on GitHub (Feb 7, 2021): @bosgold @tonioo Indeed, the solution by Bosgold works. The issue with the empty "Default password scheme list" for me is solved by adding vmail to the dovecot group. @bosgold Your solution for the 'permission denied' issue with the stats-writer might work, however, accessing the private key should not be necessary in this case. I have implemented the solution given here: [https://github.com/postfixadmin/postfixadmin/issues/381](https://github.com/postfixadmin/postfixadmin/issues/381) The config reader will no longer fail over the permission issue, and you private key still has the same level of protection.
Author
Owner

@greatpilaf commented on GitHub (Apr 29, 2021):

I had the same error, with the next enviroment:

OS Type: Debian
OS Version: Debian Bullseye
Modoboa: 1.17.0
Webserver: Nginx/1.18.0
Dovecot: 2.3.13
Certificates: self-signed located on /etc/ssl/cert.crt and /etc/ssl/private/cert.key

So, in the modoboa web app, parameters tab, the default password scheme appeared empty, when i was trying to execute:

doveadm pw -l as modoboa user, gave me the error Can't open file /etc/ssl/private/cert.key: Permission denied.

So, i added the modoboa user to the group ssl-cert, after that the modoboa user was able to read the key, but the next error was: Error: net_connect_unix(/run/dovecot/stats-writer) failed: Permission denied, then i added the modoboa user to the dovecot group too, after that and restart the services, the default password scheme showed all available options.

Maybe this can help.

<!-- gh-comment-id:829418863 --> @greatpilaf commented on GitHub (Apr 29, 2021): I had the same error, with the next enviroment: OS Type: Debian OS Version: Debian Bullseye Modoboa: 1.17.0 Webserver: Nginx/1.18.0 Dovecot: 2.3.13 Certificates: self-signed located on /etc/ssl/cert.crt and /etc/ssl/private/cert.key So, in the modoboa web app, parameters tab, the default password scheme appeared empty, when i was trying to execute: `doveadm pw -l` as modoboa user, gave me the error `Can't open file /etc/ssl/private/cert.key: Permission denied`. So, i added the modoboa user to the group `ssl-cert`, after that the modoboa user was able to read the key, but the next error was: `Error: net_connect_unix(/run/dovecot/stats-writer) failed: Permission denied`, then i added the modoboa user to the `dovecot `group too, after that and restart the services, the default password scheme showed all available options. Maybe this can help.
Author
Owner

@fpiccinali commented on GitHub (Nov 26, 2021):

For ubuntu 20.04:

apt install python3-crypto

<!-- gh-comment-id:980138595 --> @fpiccinali commented on GitHub (Nov 26, 2021): For ubuntu 20.04: apt install python3-crypto
Author
Owner

@MrGeneration commented on GitHub (Apr 13, 2022):

For anyone else bumping their head for like an hour like me.
If you followed above hints and solved the permission issues, make sure to restart Modoboas application handler (like e.g. uwsgi).

<!-- gh-comment-id:1098235277 --> @MrGeneration commented on GitHub (Apr 13, 2022): For anyone else bumping their head for like an hour like me. If you followed above hints and solved the permission issues, make sure to restart Modoboas application handler (like e.g. `uwsgi`).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1520
No description provided.