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 <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2019-08-12 12:47:08 -07:00
committed by Tim Abbott
parent 0d52d24d64
commit 66649d84cb
2 changed files with 4 additions and 11 deletions

View File

@@ -1,3 +1,3 @@
/.*\+.*@.*/ zulip@localhost
/.*\..*@.*/ zulip@localhost
/^mm.*/ zulip@localhost
/\+.*@/ zulip@localhost
/\..*@/ zulip@localhost
/^mm/ zulip@localhost

View File

@@ -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':