From 66649d84cb064ab7bea574c3f81835e273e868e0 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Mon, 12 Aug 2019 12:47:08 -0700 Subject: [PATCH] puppet: Reload postfix on /etc/postfix/virtual changes. `/etc/postfix/virtual` is of `regexp:` type, not `hash:` type, so running `postmap` on it has no effect; we need to reload Postfix when it changes. http://www.postfix.org/DATABASE_README.html#detect In the interest of forcing a reload now, optimize the regexes by eliding the unanchored `.*`s at the beginnings and ends. Signed-off-by: Anders Kaseorg --- puppet/zulip/files/postfix/virtual | 6 +++--- puppet/zulip/manifests/postfix_localmail.pp | 9 +-------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/puppet/zulip/files/postfix/virtual b/puppet/zulip/files/postfix/virtual index c25b08cb7d..86624fae98 100644 --- a/puppet/zulip/files/postfix/virtual +++ b/puppet/zulip/files/postfix/virtual @@ -1,3 +1,3 @@ -/.*\+.*@.*/ zulip@localhost -/.*\..*@.*/ zulip@localhost -/^mm.*/ zulip@localhost +/\+.*@/ zulip@localhost +/\..*@/ zulip@localhost +/^mm/ zulip@localhost diff --git a/puppet/zulip/manifests/postfix_localmail.pp b/puppet/zulip/manifests/postfix_localmail.pp index b3007c5ebc..345ab310f2 100644 --- a/puppet/zulip/manifests/postfix_localmail.pp +++ b/puppet/zulip/manifests/postfix_localmail.pp @@ -47,14 +47,7 @@ class zulip::postfix_localmail { group => root, source => 'puppet:///modules/zulip/postfix/virtual', require => Package[postfix], - } - exec {'postmap /etc/postfix/virtual': - subscribe => File['/etc/postfix/virtual'], - refreshonly => true, - require => [ - File['/etc/postfix/main.cf'], - Package[postfix], - ], + notify => Service['postfix'], } file {'/etc/postfix/transport':