mirror of
https://github.com/chatmail/relay.git
synced 2026-05-19 04:18:09 +00:00
fix: ensure Dovecot mailboxes and systemd override directories exist, and correct Postfix systemd override path
This commit is contained in:
@@ -137,6 +137,14 @@ def _configure_dovecot(config: Config, debug: bool = False) -> (bool, bool):
|
|||||||
disable_ipv6=config.disable_ipv6,
|
disable_ipv6=config.disable_ipv6,
|
||||||
)
|
)
|
||||||
need_restart |= main_config.changed
|
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(
|
auth_config = files.put(
|
||||||
src=get_resource("dovecot/auth.conf"),
|
src=get_resource("dovecot/auth.conf"),
|
||||||
dest="/etc/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",
|
line="TZ=:/etc/localtime",
|
||||||
)
|
)
|
||||||
need_restart |= timezone_env.changed
|
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(
|
restart_conf = files.put(
|
||||||
name="dovecot: restart automatically on failure",
|
name="dovecot: restart automatically on failure",
|
||||||
src=get_resource("service/10_restart.conf"),
|
src=get_resource("service/10_restart.conf"),
|
||||||
|
|||||||
@@ -61,11 +61,17 @@ class PostfixDeployer(Deployer):
|
|||||||
mode="644",
|
mode="644",
|
||||||
)
|
)
|
||||||
need_restart |= login_map.changed
|
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(
|
restart_conf = files.put(
|
||||||
name="postfix: restart automatically on failure",
|
name="postfix: restart automatically on failure",
|
||||||
src=get_resource("service/10_restart.conf"),
|
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.daemon_reload = restart_conf.changed
|
||||||
self.need_restart = need_restart
|
self.need_restart = need_restart
|
||||||
|
|||||||
Reference in New Issue
Block a user