summaryrefslogtreecommitdiff
path: root/manifests/mlmmj/list.pp
blob: 24e5e227819b8a059a2af21dccfc474aa3b1e3f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# From transport(5):
#
#   The trivial-rewrite(8) server disallows regular expression
#   substitution  of  $1  etc.  in  regular  expression lookup
#   tables, because that could open a security  hole  (Postfix
#   version 2.3 and later).
#
# That's why we need one definition per mailing list.
define mail::mlmmj::list(
  $ensure    = 'present',
  $subdomain = hiera('mail::mlmmj::subdomain', $mail::mlmmj::params::subdomain),
  $tld       = $::domain
) {
  $fulldomain = regsubst("${subdomain}.${tld}", '\.', '\.', 'G')

  postfix::transport_regexp_snippet { "mlmmj_transport_regexp-${name}":
    content => "/^${name}\\@${fulldomain}$/    mlmmj:${name}\n",
    ensure  => $ensure,
  }

  postfix::transport_regexp_snippet { "mlmmj_transport_regexp-${name}-request":
    content => "/^${name}\\+.*\\@${fulldomain}$/    mlmmj:${name}\n",
    ensure  => $ensure,
  }
}