Puppet Class: postfix::config

Defined in:
manifests/config.pp

Overview

Parameters:

  • admin_email (Any)
  • alias_files (Any)


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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'manifests/config.pp', line 10

class postfix::config (
  $admin_email,
  $alias_files
) {

  # Create concats for the alias files.

  postfix::alias_file { '/etc/aliases': }
  postfix::alias_file { $alias_files: }

  # This is called by postfix::alias_file to refresh the aliases database.

  exec { 'newaliases':
    path        => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ],
    command     => 'newaliases',
    refreshonly => true,
    require     => Package['postfix']
  }

  # Add standard aliases.

  postfix::alias { 'abuse':
    to    => 'postmaster',
    order => '98'
  }

  postfix::alias { 'postmaster':
    to    => 'root',
    order => '98'
  }

  postfix::alias { 'root':
    to    => $admin_email,
    order => '99'
  }

  # Create a concat for the transport file.

  concat { '/etc/postfix/transport':
    ensure_newline => true,
    warn           => true,
    force          => true,
    require        => Package['postfix'],
    notify         => Exec['postmap_transport']
  }

  exec { 'postmap_transport':
    path        => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ],
    command     => 'postmap /etc/postfix/transport',
    refreshonly => true,
    require     => Package['postfix']
  }

  # Create a concat for the virtual file.

  concat { '/etc/postfix/virtual':
    ensure_newline => true,
    warn           => true,
    force          => true,
    require        => Package['postfix'],
    notify         => Exec['postmap_virtual']
  }

  exec { 'postmap_virtual':
    path        => [ '/bin/', '/sbin/' , '/usr/bin/', '/usr/sbin/' ],
    command     => 'postmap /etc/postfix/virtual',
    refreshonly => true,
    require     => Package['postfix']
  }

  # Create a concat for the virtual regexp file.

  concat { '/etc/postfix/virtual_regexp':
    ensure_newline => true,
    warn           => true,
    force          => true,
    require        => Package['postfix']
  }

}