summaryrefslogtreecommitdiff
path: root/manifests/mlmmj.pp
blob: 9db4356bf14131bd0ebcf82241741713a521e949 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
class mail::mlmmj {
  include mail::packages::mlmmj
  include mail::web::mlmmj::disabled

  group { 'mlmmj':
    ensure => present,
  }

  user { 'mlmmj':
    ensure  => present,
    gid     => 'mlmmj',
    require => Group['mlmmj'],
  }

  file { '/var/spool/mlmmj':
    ensure  => directory,
    owner   => mlmmj,
    group   => mlmmj,
    mode    => 0750,
    require => User['mlmmj'],
  }

  #cron { 'mlmmj-maintd':
  #  command  => '/usr/bin/mlmmj-maintd -F -d /var/spool/mlmmj',
  #  user     => root,
  #  hour     => "*",
  #  minute   => "*/2",
  #  ensure   => present,
  #  require  => User['mlmmj'],
  #}

  postfix::transport_regexp_snippet { 'mlmmj_transport_regexp':
    content => template('mail/postfix/mlmmj/transport_regexp.erb'),
  }

  postfix::virtual_regexp_snippet { 'mlmmj_virtual_regexp':
    content => template('mail/postfix/mlmmj/virtual_regexp.erb'),
  }

  # 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 list($ensure = 'present') {
    postfix::transport_regexp_snippet { "mlmmj_transport_regexp-$name":
      content => "/^($name)\\@.*$/    mlmmj:$name\n",
      ensure  => $ensure,
    }

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