Skip to content

Commit

Permalink
fix(event): try to reload postfix for user-domain-changed
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdl committed Nov 21, 2024
1 parent b69f588 commit 2a0ea7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions imageroot/events/user-domain-changed/20configure_ldap
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ if event.get('domain') != os.getenv('POSTFIX_ORIGIN'):
if 'node_id' in event and str(event['node_id']) != os.getenv('NODE_ID'):
exit(0) # ignore event if the source is not in our node

agent.run_helper('systemctl', '--user', '-T', 'try-reload-or-restart', 'dovecot.service').check_returncode()
# restart postfix to apply the new domain, a reload is not enough when we migrate from one domain to another
agent.run_helper('systemctl', '--user', '-T', 'try-restart', 'postfix.service').check_returncode()
agent.run_helper('systemctl', '--user', '-T', 'try-reload-or-restart', 'dovecot.service', 'postfix.service').check_returncode()

2 changes: 1 addition & 1 deletion imageroot/systemd/user/postfix.service
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ExecStart=/usr/bin/podman run \
${MAIL_POSTFIX_IMAGE}
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/postfix.ctr-id -t 60
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/postfix.ctr-id
ExecReload=runagent /usr/bin/podman exec --env=POSTFIX_* %N reload-config
ExecReload=runagent /usr/bin/podman exec --env-file=discovery.env --env=POSTFIX_* %N reload-config
PIDFile=%t/postfix.pid
Type=forking
SyslogIdentifier=%N
Expand Down

0 comments on commit 2a0ea7a

Please sign in to comment.