bundlewrap/bundles/dovecot/items.py
Franziska Kunsmann 96f1604879
bundles/dovecot: some fixes
- fix postfix/myhostname default
- ensure old_stats plugin is enabled
- ensure permissions for old_stats plugin
- ensure /etc/dovecot/ssl exists
- remove unneeded configuration files
2021-08-21 07:31:22 +02:00

89 lines
2.1 KiB
Python

# Postfix bundle creates metadata and directories which are also used
# by this bundle
repo.libs.tools.require_bundle(node, 'postfix')
directories = {
'/etc/dovecot/ssl': {},
}
files = {
'/etc/dovecot/dovecot.conf': {
'content_type': 'mako',
'context': {
'admin_email': node.metadata['dovecot']['admin_email'],
},
'needs': {
'pkg_apt:'
},
'triggers': {
'svc_systemd:dovecot:restart',
},
},
'/etc/dovecot/dovecot-sql.conf': {
'content_type': 'mako',
'context': node.metadata['dovecot']['database'],
'needs': {
'pkg_apt:'
},
'triggers': {
'svc_systemd:dovecot:restart',
},
},
'/etc/dovecot/conf.d/auth-system.conf.ext': {
'delete': True,
'needs': {
'pkg_apt:'
},
'triggers': {
'svc_systemd:dovecot:restart',
},
},
'/etc/dovecot/conf.d/10-auth.conf': {
'delete': True,
'needs': {
'pkg_apt:'
},
'triggers': {
'svc_systemd:dovecot:restart',
},
},
}
actions = {
'dovecot_generate_dhparam': {
'command': 'openssl dhparam -out /etc/dovecot/ssl/dhparam.pem 2048',
'unless': 'test -f /etc/dovecot/ssl/dhparam.pem',
'cascade_skip': False,
'needs': {
'directory:/etc/dovecot/ssl',
'pkg_apt:'
},
'triggers': {
'svc_systemd:dovecot:restart',
},
},
}
svc_systemd = {
'dovecot': {
'needs': {
'action:dovecot_generate_dhparam',
'file:/etc/dovecot/dovecot.conf',
'file:/etc/dovecot/dovecot-sql.conf',
},
},
}
if node.has_bundle('rspamd'):
files['/var/mail/vmail/sieve/global/learn-ham.sieve'] = {
'owner': 'nobody',
'group': 'nogroup',
}
files['/var/mail/vmail/sieve/global/learn-spam.sieve'] = {
'owner': 'nobody',
'group': 'nogroup',
}
files['/var/mail/vmail/sieve/global/spam-global.sieve'] = {
'owner': 'nobody',
'group': 'nogroup',
}