orchestra list exec postmap after edit mailman3_virt*

This commit is contained in:
Jorge Pastor 2024-10-03 12:35:01 +02:00
parent 5b6bc35063
commit bee347c9f5
1 changed files with 20 additions and 1 deletions

View File

@ -57,6 +57,14 @@ class MailmanVirtualDomainController(ServiceController):
def commit(self):
context = self.get_context_files()
super(MailmanVirtualDomainController, self).commit()
self.append(textwrap.dedent("""
# Apply changes if needed
if [[ $UPDATED_VIRTUAL_ALIAS_DOMAINS == 1 ]]; then
postmap %(virtual_alias_domains)s
systemctl reload postfix
fi
exit $exit_code""") % context
)
def get_context_files(self):
return {
@ -165,7 +173,18 @@ class MailmanController(MailmanVirtualDomainController):
def commit(self):
pass
context = self.get_context_files()
self.append(textwrap.dedent("""
# Apply changes if needed
if [[ $UPDATED_VIRTUAL_ALIAS == 1 ]]; then
postmap %(virtual_alias)s
fi
if [[ $UPDATED_VIRTUAL_ALIAS_DOMAINS == 1 ]]; then
systemctl reload postfix
fi
exit $exit_code""") % context
)
def get_context_files(self):
return {