fix: pass full config to ChatmailDeployer and ensure mailboxes_dir

ChatmailDeployer now receives the full config object
so it can access mailboxes_dir and create this directory
during deployment, preventing mail delivery failures.
This commit is contained in:
holger krekel
2026-03-10 17:49:58 +01:00
parent de1a53b135
commit a61bbcade2

View File

@@ -463,8 +463,9 @@ class ChatmailDeployer(Deployer):
("iroh", None, None), ("iroh", None, None),
] ]
def __init__(self, mail_domain): def __init__(self, config):
self.mail_domain = mail_domain self.config = config
self.mail_domain = config.mail_domain
def install(self): def install(self):
files.put( files.put(
@@ -513,6 +514,15 @@ class ChatmailDeployer(Deployer):
], ],
) )
files.directory(
name=f"Ensure mailboxes directory {self.config.mailboxes_dir} exists",
path=str(self.config.mailboxes_dir),
user="vmail",
group="vmail",
mode="700",
present=True,
)
class FcgiwrapDeployer(Deployer): class FcgiwrapDeployer(Deployer):
def install(self): def install(self):
@@ -631,7 +641,7 @@ def deploy_chatmail(config_path: Path, disable_mail: bool, website_only: bool) -
tls_deployer = get_tls_deployer(config, mail_domain) tls_deployer = get_tls_deployer(config, mail_domain)
all_deployers = [ all_deployers = [
ChatmailDeployer(mail_domain), ChatmailDeployer(config),
LegacyRemoveDeployer(), LegacyRemoveDeployer(),
FiltermailDeployer(), FiltermailDeployer(),
JournaldDeployer(), JournaldDeployer(),