mirror of
https://github.com/chatmail/relay.git
synced 2026-08-29 19:43:14 +00:00
introduce "mailboxes_dir" config ini option to avoid hardcoding /home/vmail/mail/....
in source code and to improve testability.
This commit is contained in:
@@ -16,10 +16,11 @@ def make_config(tmp_path):
|
||||
inipath = tmp_path.joinpath("chatmail.ini")
|
||||
|
||||
def make_conf(mail_domain):
|
||||
write_initial_config(inipath, mail_domain=mail_domain)
|
||||
basedir = tmp_path.joinpath(f"vmail/{mail_domain}")
|
||||
basedir.mkdir(parents=True, exist_ok=True)
|
||||
return read_config(inipath, mail_basedir=basedir)
|
||||
overrides = dict(mailboxes_dir=str(basedir))
|
||||
write_initial_config(inipath, mail_domain=mail_domain, **overrides)
|
||||
return read_config(inipath)
|
||||
|
||||
return make_conf
|
||||
|
||||
|
||||
Reference in New Issue
Block a user