remove mailboxes_dir as default option

This commit is contained in:
holger krekel
2024-07-28 16:24:17 +02:00
parent b32a57105d
commit 1238ed95da
3 changed files with 18 additions and 14 deletions

View File

@@ -6,22 +6,21 @@
outside by accepting their localized "encrypted subject" strings. outside by accepting their localized "encrypted subject" strings.
([#370](https://github.com/deltachat/chatmail/pull/370)) ([#370](https://github.com/deltachat/chatmail/pull/370))
- migrate and remove sqlite database in favor of password/lastlogin tracking - Migrate and remove sqlite database in favor of password/lastlogin tracking
in a user's maildir. This removes the need for "passdb_path" setting in ini file in a user's maildir.
which was introduced through #351 below.
([#379](https://github.com/deltachat/chatmail/pull/379)) ([#379](https://github.com/deltachat/chatmail/pull/379))
- Require pyinfra V3 installed on the client side, - Require pyinfra V3 installed on the client side,
run `./scripts/initenv.sh` to upgrade locally. run `./scripts/initenv.sh` to upgrade locally.
([#378](https://github.com/deltachat/chatmail/pull/378)) ([#378](https://github.com/deltachat/chatmail/pull/378))
- BREAKING: new required chatmail.ini values: - don't hardcode "/home/vmail" paths but rather set them
once in the config object and use it everywhere else,
mailboxes_dir = /home/vmail/mail/{mail_domain} thereby also improving testability.
passdb = /home/vmail/passdb.sqlite
reducing hardcoding these two paths all over the files, also improving testability.
([#351](https://github.com/deltachat/chatmail/pull/351)) ([#351](https://github.com/deltachat/chatmail/pull/351))
temporarily introduced obligatory "passdb_path" and "mailboxes_dir"
settings but they were removed/obsoleted in
([#380](https://github.com/deltachat/chatmail/pull/380))
- BREAKING: new required chatmail.ini value 'delete_inactive_users_after = 100' - BREAKING: new required chatmail.ini value 'delete_inactive_users_after = 100'
which removes users from database and mails after 100 days without any login. which removes users from database and mails after 100 days without any login.

View File

@@ -27,7 +27,6 @@ class Config:
self.password_min_length = int(params["password_min_length"]) self.password_min_length = int(params["password_min_length"])
self.passthrough_senders = params["passthrough_senders"].split() self.passthrough_senders = params["passthrough_senders"].split()
self.passthrough_recipients = params["passthrough_recipients"].split() self.passthrough_recipients = params["passthrough_recipients"].split()
self.mailboxes_dir = Path(params["mailboxes_dir"].strip())
self.filtermail_smtp_port = int(params["filtermail_smtp_port"]) self.filtermail_smtp_port = int(params["filtermail_smtp_port"])
self.postfix_reinject_port = int(params["postfix_reinject_port"]) self.postfix_reinject_port = int(params["postfix_reinject_port"])
self.iroh_relay = params.get("iroh_relay") self.iroh_relay = params.get("iroh_relay")
@@ -36,6 +35,10 @@ class Config:
self.privacy_pdo = params.get("privacy_pdo") self.privacy_pdo = params.get("privacy_pdo")
self.privacy_supervisor = params.get("privacy_supervisor") self.privacy_supervisor = params.get("privacy_supervisor")
# deprecated option
mbdir = params.get("mailboxes_dir", f"/home/vmail/mail/{self.mail_domain}")
self.mailboxes_dir = Path(mbdir.strip())
# old unused option (except for first migration from sqlite to maildir store) # old unused option (except for first migration from sqlite to maildir store)
self.passdb_path = Path(params.get("passdb_path", "/home/vmail/passdb.sqlite")) self.passdb_path = Path(params.get("passdb_path", "/home/vmail/passdb.sqlite"))
@@ -65,14 +68,19 @@ def write_initial_config(inipath, mail_domain, overrides):
# apply config overrides # apply config overrides
new_lines = [] new_lines = []
extra = overrides.copy()
for line in content.split("\n"): for line in content.split("\n"):
new_line = line.strip() new_line = line.strip()
if new_line and new_line[0] not in "#[": if new_line and new_line[0] not in "#[":
name, value = map(str.strip, new_line.split("=", maxsplit=1)) name, value = map(str.strip, new_line.split("=", maxsplit=1))
value = overrides.get(name, value) value = overrides.pop(name, value)
new_line = f"{name} = {value}" new_line = f"{name} = {value}"
new_lines.append(new_line) new_lines.append(new_line)
for name, value in extra.items():
new_line = f"{name} = {value}"
new_lines.append(new_line)
content = "\n".join(new_lines) content = "\n".join(new_lines)
# apply testrun privacy overrides # apply testrun privacy overrides

View File

@@ -42,9 +42,6 @@ passthrough_recipients = xstore@testrun.org groupsbot@hispanilandia.net
# Deployment Details # Deployment Details
# #
# Directory where user mailboxes are stored
mailboxes_dir = /home/vmail/mail/{mail_domain}
# where the filtermail SMTP service listens # where the filtermail SMTP service listens
filtermail_smtp_port = 10080 filtermail_smtp_port = 10080