Franziska Kunsmann
6772b3b5d0
Some checks failed
bundlewrap/pipeline/head There was a failure building this commit
94 lines
2.4 KiB
Python
94 lines
2.4 KiB
Python
from bundlewrap.metadata import atomic
|
|
|
|
defaults = {
|
|
'apt': {
|
|
'packages': {
|
|
'dovecot-imapd': {},
|
|
'dovecot-lmtpd': {},
|
|
'dovecot-managesieved': {},
|
|
'dovecot-pgsql': {},
|
|
'dovecot-sieve': {},
|
|
},
|
|
},
|
|
'icinga2_api': {
|
|
'dovecot': {
|
|
'services': {
|
|
'DOVECOT PROCESS': {
|
|
'command_on_monitored_host': '/usr/local/share/icinga/plugins/check_systemd_unit dovecot',
|
|
},
|
|
'IMAP CONNECT': {
|
|
'check_command': 'check_imap',
|
|
'vars.imap_port': 143,
|
|
'vars.notification.sms': True,
|
|
},
|
|
'IMAPS CONNECT': {
|
|
'check_command': 'check_imap',
|
|
'vars.imap_port': 993,
|
|
'vars.imap_ssl': True,
|
|
'vars.notification.sms': True,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
'letsencrypt': {
|
|
'reload_after': {
|
|
'dovecot',
|
|
},
|
|
},
|
|
}
|
|
|
|
if node.has_bundle('postfixadmin'):
|
|
defaults['dovecot'] = {
|
|
'database': {
|
|
'dbname': 'postfixadmin',
|
|
'dbuser': 'postfixadmin',
|
|
},
|
|
}
|
|
|
|
if node.has_bundle('telegraf'):
|
|
defaults['telegraf'] = {
|
|
'input_plugins': {
|
|
'builtin': {
|
|
'dovecot': [{
|
|
'type': 'global',
|
|
}],
|
|
},
|
|
},
|
|
}
|
|
|
|
|
|
@metadata_reactor.provides(
|
|
'dovecot/admin_email',
|
|
'dovecot/database/dbpass',
|
|
)
|
|
def import_database_settings_from_postfixadmin(metadata):
|
|
if not node.has_bundle('postfixadmin'):
|
|
raise DoNotRunAgain
|
|
|
|
return {
|
|
'dovecot': {
|
|
'admin_email': metadata.get('postfixadmin/admin_email'),
|
|
'database': {
|
|
'dbpass': metadata.get('postgresql/roles/postfixadmin/password'),
|
|
},
|
|
},
|
|
}
|
|
|
|
|
|
@metadata_reactor.provides(
|
|
'iptables/port_rules/143',
|
|
'iptables/port_rules/993',
|
|
'iptables/port_rules/4190',
|
|
)
|
|
def iptables(metadata):
|
|
return {
|
|
'iptables': {
|
|
'port_rules': {
|
|
# imap(s)
|
|
'143': atomic(metadata.get('dovecot/restrict-to', {'*'})),
|
|
'993': atomic(metadata.get('dovecot/restrict-to', {'*'})),
|
|
# managesieve
|
|
'4190': atomic(metadata.get('dovecot/restrict-to', {'*'})),
|
|
},
|
|
},
|
|
}
|