summaryrefslogtreecommitdiff
path: root/manifests/sieve.pp
blob: 31b7a15adb40e9d1a74f442d86c95063fd03b308 (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
class dovecot::sieve {
  include ::dovecot
  package{'dovecot-sieve':
    ensure => installed,
    before => Service['dovecot'],
  }

  file{'/var/lib/dovecot-sieve':
    ensure => directory,
    owner => root, group => 0, mode => 0644;
  }
  file{'/var/lib/dovecot-sieve/global':
    source => [ "puppet:///modules/site-dovecot/sieve/${fqdn}/global/",
                "puppet:///modules/site-dovecot/sieve/global/",
                "puppet:///modules/dovecot/sieve/${operatingsystem}/global/",
                "puppet:///modules/dovecot/sieve/global/",
                "puppet:///modules/common/empty/" ],
    ensure => directory,
    recurse => true,
    purge => true,
    force => true,
    notify => Exec['compile_global_sieve'],
    owner => root, group => root, mode => 0644;
  }
  file{'/var/lib/dovecot-sieve/default.sieve':
    source => [ "puppet:///modules/site-dovecot/sieve/${fqdn}/default.sieve",
                "puppet:///modules/site-dovecot/sieve/default.sieve",
                "puppet:///modules/dovecot/sieve/${operatingsystem}/default.sieve",
                "puppet:///modules/dovecot/sieve/default.sieve" ],
    notify => Exec['compile_default_sieve'],
    owner => root, group => root, mode => 0644;
  }

  exec{'compile_default_sieve':
    command => 'sievec /var/lib/dovecot-sieve/default.sieve',
    creates => '/var/lib/dovecot-sieve/default.svbin',
    require => File['/var/lib/dovecot-sieve/default.sieve'],
  }
  exec{'compile_global_sieve':
    command => 'sievec /var/lib/dovecot-sieve/global/',
    refreshonly => true,
  }
}