diff --git a/bundles/postfix/files/aliases b/bundles/postfix/files/aliases new file mode 100644 index 0000000..31983d8 --- /dev/null +++ b/bundles/postfix/files/aliases @@ -0,0 +1,5 @@ +root: hostmaster@kunbox.net + +% for source, target in node.metadata.get('postfix', {}).get('aliases', {}).items(): +${source}: ${', '.join(sorted(target))} +% endfor diff --git a/bundles/postfix/files/main.cf b/bundles/postfix/files/main.cf index 30eff4a..3f9fe84 100644 --- a/bundles/postfix/files/main.cf +++ b/bundles/postfix/files/main.cf @@ -11,6 +11,7 @@ mailbox_size_limit = 0 recipient_delimiter = + inet_protocols = all message_size_limit = ${node.metadata.get('postfix', {}).get('message_size_limit_mb', 10)*1024*1024} +alias_database = hash:/etc/aliases % if node.has_bundle('postfixadmin'): inet_interfaces = all diff --git a/bundles/postfix/items.py b/bundles/postfix/items.py index 56e2ac5..11aa735 100644 --- a/bundles/postfix/items.py +++ b/bundles/postfix/items.py @@ -8,6 +8,12 @@ files = { 'svc_systemd:postfix:restart', }, }, + '/etc/aliases': { + 'content_type': 'mako', + 'triggers': { + 'action:postfix_newaliases', + }, + }, '/etc/postfix/master.cf': { 'content_type': 'mako', 'triggers': { @@ -22,6 +28,13 @@ files = { }, } +actions = { + 'postfix_newaliases': { + 'command': 'newaliases', + 'triggered': True, + }, +} + svc_systemd = { 'postfix': { 'needs': { diff --git a/bundles/rspamd/metadata.py b/bundles/rspamd/metadata.py index d5e8b6e..65cf06a 100644 --- a/bundles/rspamd/metadata.py +++ b/bundles/rspamd/metadata.py @@ -19,6 +19,13 @@ defaults = { 'cron': { 'clamav-unofficial-sigs': f'{node.magic_number%60} */4 * * * clamav /usr/sbin/clamav-unofficial-sigs >/dev/null 2>&1', }, + 'postfix': { + 'aliases': { + 'clamav': { + 'root', + }, + }, + }, }