summaryrefslogtreecommitdiff
path: root/puppet/modules/site_postfix/manifests/mx/checks.pp
blob: 5d75a5e51bb9e912410b1edca8c2ebc019581a29 (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
class site_postfix::mx::checks {

  file {
    '/etc/postfix/checks':
      ensure  => directory,
      mode    => '0755',
      owner   => root,
      group   => postfix,
      require => Package['postfix'];

    '/etc/postfix/checks/helo_checks':
      content => template('site_postfix/checks/helo_access.erb'),
      mode    => '0644',
      owner   => root,
      group   => root;
  }

  exec {
    '/usr/sbin/postmap /etc/postfix/checks/helo_checks':
      refreshonly => true,
      subscribe   => File['/etc/postfix/checks/helo_checks'];
  }

  # Anonymize the user's home IP from the email headers (Feature #3866)
  package { 'postfix-pcre': ensure => installed, require => Package['postfix'] }

  file { '/etc/postfix/checks/received_anon':
    source  => 'puppet:///modules/site_postfix/checks/received_anon',
    mode    => '0644',
    owner   => root,
    group   => root,
    notify  => Service['postfix']
  }

  postfix::config {
    'header_checks':
      value   => 'pcre:/etc/postfix/checks/received_anon',
      require => File['/etc/postfix/checks/received_anon'];
  }

}