remove "passdb_path" as default option

This commit is contained in:
holger krekel
2024-07-28 11:59:12 +02:00
parent 87d6d2d5cb
commit b32a57105d
5 changed files with 6 additions and 9 deletions

View File

@@ -7,7 +7,7 @@
([#370](https://github.com/deltachat/chatmail/pull/370))
- migrate and remove sqlite database in favor of password/lastlogin tracking
in a user's maildir. this removes the need for "passdb" setting in ini file
in a user's maildir. This removes the need for "passdb_path" setting in ini file
which was introduced through #351 below.
([#379](https://github.com/deltachat/chatmail/pull/379))

View File

@@ -28,7 +28,6 @@ class Config:
self.passthrough_senders = params["passthrough_senders"].split()
self.passthrough_recipients = params["passthrough_recipients"].split()
self.mailboxes_dir = Path(params["mailboxes_dir"].strip())
self.passdb_path = Path(params["passdb_path"].strip())
self.filtermail_smtp_port = int(params["filtermail_smtp_port"])
self.postfix_reinject_port = int(params["postfix_reinject_port"])
self.iroh_relay = params.get("iroh_relay")
@@ -37,6 +36,9 @@ class Config:
self.privacy_pdo = params.get("privacy_pdo")
self.privacy_supervisor = params.get("privacy_supervisor")
# old unused option (except for first migration from sqlite to maildir store)
self.passdb_path = Path(params.get("passdb_path", "/home/vmail/passdb.sqlite"))
def _getbytefile(self):
return open(self._inipath, "rb")

View File

@@ -45,9 +45,6 @@ passthrough_recipients = xstore@testrun.org groupsbot@hispanilandia.net
# Directory where user mailboxes are stored
mailboxes_dir = /home/vmail/mail/{mail_domain}
# user address sqlite database path
passdb_path = /home/vmail/passdb.sqlite
# where the filtermail SMTP service listens
filtermail_smtp_port = 10080

View File

@@ -17,8 +17,7 @@ def make_config(tmp_path):
def make_conf(mail_domain):
basedir = tmp_path.joinpath(f"vmail/{mail_domain}")
basedir.mkdir(parents=True, exist_ok=True)
passdb = tmp_path.joinpath("vmail/passdb.sqlite")
overrides = dict(mailboxes_dir=str(basedir), passdb_path=str(passdb))
overrides = dict(mailboxes_dir=str(basedir))
write_initial_config(inipath, mail_domain, overrides=overrides)
return read_config(inipath)

View File

@@ -38,8 +38,7 @@ def test_config_userstate_paths(make_config, tmp_path):
mailboxes_dir = config.mailboxes_dir
passdb_path = config.passdb_path
assert mailboxes_dir.name == "something.testrun.org"
assert passdb_path.name == "passdb.sqlite"
assert passdb_path.is_relative_to(tmp_path)
assert str(passdb_path) == "/home/vmail/passdb.sqlite"
assert config.mail_domain == "something.testrun.org"
path = config.get_user("user1@something.testrun.org").maildir
assert not path.exists()