[PR #2144] [MERGED] Prevent that password are stored in plain-text #2465

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

📋 Pull Request Information

Original PR: https://github.com/modoboa/modoboa/pull/2144
Author: @jeromelebleu
Created: 1/27/2021
Status: Merged
Merged: 2/9/2021
Merged by: @tonioo

Base: masterHead: fix/default-password-scheme


📝 Commits (5)

  • abd3ba5 Add MD5-CRYPT to the fallback password schemes
  • 5cbbd46 Allow one to define Dovecot's schemes in settings
  • 82ec811 Add and document missing settings in template
  • a7ced66 Document the settings related to Dovecot
  • 1a677d5 Ignore E265 in settings.py template

📊 Changes

5 files changed (+63 additions, -25 deletions)

View changed files

📝 doc/configuration.rst (+13 -2)
📝 modoboa/core/commands/templates/settings.py.tpl (+13 -7)
📝 modoboa/core/password_hashers/__init__.py (+17 -12)
📝 modoboa/core/tests/test_authentication.py (+18 -4)
📝 setup.cfg (+2 -0)

📄 Description

Description of the issue/feature this PR addresses

Dovecot is not a hard-dependency of Modoboa, thus it could be installed and running on another host or container - i.e. for isolation reasons. This PR allows one to define - strong - password schemes to use in this case and document the related variables available in the settings.

Current behavior before PR

If doveadm binary is not found on the host, the only password scheme which will be available - and use - will be {PLAIN} - which means that password will be stored in clear. There is no alternative to define a fake doveadm binary - as it is done in tests - to mimic the output and tell Modoboa which schemes are supported - which I think it is not a real and clean solution since Modoboa is at least calling doveadm with other arguments.

Desired behavior after PR is merged

Password must never be stored in clear, so MD5-CRYPT is added to the fallback list of supported password schemes. Moreover, to handle the case of an installation of Dovecot on another host, a new setting is added to specify which schemes are supported: DOVECOT_SUPPORTED_SCHEMES.

Is it conceivable to add a stronger scheme than MD5-CRYPT by default depending on the Dovecot documentation?


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/modoboa/modoboa/pull/2144 **Author:** [@jeromelebleu](https://github.com/jeromelebleu) **Created:** 1/27/2021 **Status:** ✅ Merged **Merged:** 2/9/2021 **Merged by:** [@tonioo](https://github.com/tonioo) **Base:** `master` ← **Head:** `fix/default-password-scheme` --- ### 📝 Commits (5) - [`abd3ba5`](https://github.com/modoboa/modoboa/commit/abd3ba537e5c1ff923ad9af085bff1ca1070e471) Add MD5-CRYPT to the fallback password schemes - [`5cbbd46`](https://github.com/modoboa/modoboa/commit/5cbbd4655b937af12c779a59d93e7c036f8a6df3) Allow one to define Dovecot's schemes in settings - [`82ec811`](https://github.com/modoboa/modoboa/commit/82ec811356c746984046285cdb71a693c045c970) Add and document missing settings in template - [`a7ced66`](https://github.com/modoboa/modoboa/commit/a7ced6634c997a6a8b86fc4fc45872007b1ee042) Document the settings related to Dovecot - [`1a677d5`](https://github.com/modoboa/modoboa/commit/1a677d5c7e3696909066811501e22e097f3ee048) Ignore E265 in settings.py template ### 📊 Changes **5 files changed** (+63 additions, -25 deletions) <details> <summary>View changed files</summary> 📝 `doc/configuration.rst` (+13 -2) 📝 `modoboa/core/commands/templates/settings.py.tpl` (+13 -7) 📝 `modoboa/core/password_hashers/__init__.py` (+17 -12) 📝 `modoboa/core/tests/test_authentication.py` (+18 -4) 📝 `setup.cfg` (+2 -0) </details> ### 📄 Description ## Description of the issue/feature this PR addresses Dovecot is not a hard-dependency of Modoboa, thus it could be installed and running on another host or container - i.e. for isolation reasons. This PR allows one to define - strong - password schemes to use in this case and document the related variables available in the settings. ## Current behavior before PR If `doveadm` binary is not found on the host, the only password scheme which will be available - and use - will be `{PLAIN}` - which means that password will be stored in clear. There is no alternative to define a *fake* `doveadm` binary - as it is done in tests - to mimic the output and tell Modoboa which schemes are supported - which I think it is not a real and clean solution since Modoboa is at least calling `doveadm` with other arguments. ## Desired behavior after PR is merged Password must never be stored in clear, so MD5-CRYPT is added to the fallback list of supported password schemes. Moreover, to handle the case of an installation of Dovecot on another host, a new setting is added to specify which schemes are supported: ``DOVECOT_SUPPORTED_SCHEMES``. Is it conceivable to add a stronger scheme than MD5-CRYPT by default depending on the [Dovecot documentation](https://doc.dovecot.org/configuration_manual/authentication/password_schemes/)? --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 12:11:10 +03:00
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#2465
No description provided.