From 338fc96a32bd605c6dc4d27facd5cd968595e43c Mon Sep 17 00:00:00 2001 From: Karsten Kosmala Date: Wed, 8 Mar 2017 13:53:00 +0100 Subject: [PATCH] en-/disable domain in mydestination --- pillar.example | 2 ++ postfix/files/main.cf | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/pillar.example b/pillar.example index d83b61c..3d2e9b5 100644 --- a/pillar.example +++ b/pillar.example @@ -2,6 +2,8 @@ postfix: manage_master_config: True master_config: enable_submission: False + main_config: + include_domain_in_mydestination: True enable_service: True diff --git a/postfix/files/main.cf b/postfix/files/main.cf index fe6a2b9..68c8715 100644 --- a/postfix/files/main.cf +++ b/postfix/files/main.cf @@ -74,7 +74,11 @@ {{ set_parameter('myhostname', grains['fqdn']) }} {{ set_parameter('alias_maps', 'hash:' ~ postfix.aliases_file) }} {{ set_parameter('alias_database', 'hash:' ~ postfix.aliases_file) }} +{%- if salt['pillar.get']('postfix:main_config:include_domain_in_mydestination', True) %} {{ set_parameter('mydestination', [grains['fqdn'], 'localhost', 'localhost.localdomain', grains['domain']]) }} +{%- else %} +{{ set_parameter('mydestination', [grains['fqdn'], 'localhost', 'localhost.localdomain']) }} +{%- endif %} {{ set_parameter('relayhost', '') }} {{ set_parameter('mynetworks', ['127.0.0.0/8', '[::ffff:127.0.0.0]/104', '[::1]/128']) }} {{ set_parameter('mailbox_size_limit', '0') }}