From caee18415852a8021b82529080e0f3b347eebfd4 Mon Sep 17 00:00:00 2001 From: Alexander Weidinger Date: Fri, 8 Dec 2017 14:04:35 +0100 Subject: [PATCH] master.cf: added dovecot --- pillar.example | 8 ++++++++ postfix/defaults.yaml | 1 + postfix/files/master.cf | 9 ++++++++- postfix/osmap.yaml | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/pillar.example b/pillar.example index 9733ba2..2441d2f 100644 --- a/pillar.example +++ b/pillar.example @@ -1,6 +1,14 @@ postfix: manage_master_config: True master_config: + enable_dovecot: False + # The following are the default values: + dovecot: + user: vmail + group: vmail + flags: DRhu + argv: "/usr/lib/dovecot/deliver -d ${recipient}" + enable_submission: False # To replace the defaults use this: submission: diff --git a/postfix/defaults.yaml b/postfix/defaults.yaml index 0ff63f7..584c6f6 100644 --- a/postfix/defaults.yaml +++ b/postfix/defaults.yaml @@ -10,3 +10,4 @@ postfix: root_grp: root service: postfix xbin_prefix: /usr + dovecot_deliver: /usr/lib/dovecot/deliver diff --git a/postfix/files/master.cf b/postfix/files/master.cf index 39d7615..5b69be5 100644 --- a/postfix/files/master.cf +++ b/postfix/files/master.cf @@ -1,3 +1,5 @@ +{%- from "postfix/map.jinja" import postfix with context -%} + {%- macro set_option(parameter, value) -%} {%- if value is number or value is string -%} -o {{ parameter }}={{ value }} @@ -146,7 +148,12 @@ scache unix - - n - 1 scache #mailman unix - n n - - pipe # flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py # ${nexthop} ${user} -{% if salt['pillar.get']('postfix:policyd-spf:enabled', False) %} +{%- if salt['pillar.get']('postfix:policyd-spf:enabled', False) %} policy-spf unix - n n - - spawn user=nobody argv={{ xbin_prefix }}/bin/policyd-spf {%- endif %} +{%- if master_config.get('enable_dovecot', False) -%} +{%- set dovecot = master_config.get('dovecot', {} )%} +dovecot unix - n n - - pipe + flags={{ dovecot.get('flags', 'DRhu') }} user={{ dovecot.get('user', 'vmail') }}:{{ dovecot.get('group', 'vmail') }} argv={{ dovecot.get('argv', postfix.dovecot_deliver) ~ ' -d ${recipient}' }} +{% endif -%} diff --git a/postfix/osmap.yaml b/postfix/osmap.yaml index a63d17a..c5e79a3 100644 --- a/postfix/osmap.yaml +++ b/postfix/osmap.yaml @@ -12,6 +12,7 @@ FreeBSD: xbin_prefix: /usr/local config_path: /usr/local/etc/postfix root_grp: wheel + dovecot_deliver: /usr/local/libexec/dovecot/deliver Gentoo: package: mail-mta/postfix