fix: ensure Dovecot mailboxes and systemd override directories exist, and correct Postfix systemd override path

This commit is contained in:
Omid Zamani
2026-01-06 11:36:23 +01:00
parent e32b340fed
commit a3ecad1179
2 changed files with 23 additions and 3 deletions

View File

@@ -137,6 +137,14 @@ def _configure_dovecot(config: Config, debug: bool = False) -> (bool, bool):
disable_ipv6=config.disable_ipv6,
)
need_restart |= main_config.changed
files.directory(
name="Ensure mailboxes directory exists",
path=str(config.mailboxes_dir),
user="vmail",
group="vmail",
mode="750",
create_remote_dir=True,
)
auth_config = files.put(
src=get_resource("dovecot/auth.conf"),
dest="/etc/dovecot/auth.conf",
@@ -182,7 +190,13 @@ def _configure_dovecot(config: Config, debug: bool = False) -> (bool, bool):
line="TZ=:/etc/localtime",
)
need_restart |= timezone_env.changed
files.directory(
name="Ensure dovecot.service.d directory exists",
path="/etc/systemd/system/dovecot.service.d",
user="root",
group="root",
mode="755",
)
restart_conf = files.put(
name="dovecot: restart automatically on failure",
src=get_resource("service/10_restart.conf"),

View File

@@ -61,11 +61,17 @@ class PostfixDeployer(Deployer):
mode="644",
)
need_restart |= login_map.changed
files.directory(
name="Ensure postfix@.service.d directory exists",
path="/etc/systemd/system/postfix@.service.d",
user="root",
group="root",
mode="755",
)
restart_conf = files.put(
name="postfix: restart automatically on failure",
src=get_resource("service/10_restart.conf"),
dest="/etc/systemd/system/postfix.service.d/10_restart.conf",
dest="/etc/systemd/system/postfix@.service.d/10_restart.conf",
)
self.daemon_reload = restart_conf.changed
self.need_restart = need_restart