1 |
class postfix { |
2 |
|
3 |
class base { |
4 |
package { postfix: |
5 |
ensure => installed |
6 |
} |
7 |
package { 'nail': |
8 |
ensure => installed |
9 |
} |
10 |
service { postfix: |
11 |
ensure => running, |
12 |
subscribe => [ Package['postfix']], |
13 |
path => "/etc/init.d/postfix" |
14 |
} |
15 |
|
16 |
file { '/etc/postfix/main.cf': |
17 |
ensure => present, |
18 |
owner => root, |
19 |
group => root, |
20 |
mode => 644, |
21 |
require => Package["postfix"], |
22 |
content => "", |
23 |
notify => [Service['postfix']], |
24 |
} |
25 |
} |
26 |
|
27 |
|
28 |
class simple_relay inherits base { |
29 |
File['/etc/postfix/main.cf'] { |
30 |
content => template("postfix/simple_relay_main.cf"), |
31 |
} |
32 |
} |
33 |
|
34 |
class smtp_server inherits base { |
35 |
include postgrey |
36 |
include amavis |
37 |
include spamassassin |
38 |
File['/etc/postfix/main.cf'] { |
39 |
content => template("postfix/main.cf"), |
40 |
} |
41 |
|
42 |
file { '/etc/postfix/transport_regexp': |
43 |
ensure => present, |
44 |
owner => root, |
45 |
group => root, |
46 |
mode => 644, |
47 |
content => template("postfix/transport_regexp"), |
48 |
} |
49 |
|
50 |
} |
51 |
|
52 |
class primary_smtp inherits smtp_server { |
53 |
file { '/etc/postfix/master.cf': |
54 |
ensure => present, |
55 |
owner => root, |
56 |
group => root, |
57 |
mode => 644, |
58 |
content => template("postfix/primary_master.cf"), |
59 |
} |
60 |
|
61 |
package { "postfix-ldap": |
62 |
ensure => installed |
63 |
} |
64 |
# council is here until we fully decide who has aliases in com team, |
65 |
# see https://bugs.mageia.org/show_bug.cgi?id=1345 |
66 |
# alumini is a special group for tracking previous members of |
67 |
# the project, so they keep their aliases for a time |
68 |
$aliases_group = ['mga-founders','mga-packagers', |
69 |
'mga-sysadmin','mga-council', |
70 |
'mga-alumni','mga-i18n-committers', |
71 |
] |
72 |
$ldap_password = extlookup("postfix_ldap",'x') |
73 |
file { '/etc/postfix/ldap_aliases.conf': |
74 |
ensure => present, |
75 |
owner => root, |
76 |
group => root, |
77 |
mode => 644, |
78 |
content => template("postfix/ldap_aliases.conf"), |
79 |
} |
80 |
|
81 |
# TODO merge the file with the previous one, for common part (ldap, etc) |
82 |
file { '/etc/postfix/group_aliases.conf': |
83 |
ensure => present, |
84 |
owner => root, |
85 |
group => root, |
86 |
mode => 644, |
87 |
content => template("postfix/group_aliases.conf"), |
88 |
} |
89 |
|
90 |
# TODO make it conditional to the presence of sympa |
91 |
file { '/etc/postfix/sympa_aliases': |
92 |
ensure => present, |
93 |
owner => root, |
94 |
group => root, |
95 |
mode => 644, |
96 |
content => template("postfix/sympa_aliases"), |
97 |
} |
98 |
|
99 |
|
100 |
|
101 |
|
102 |
file { '/etc/postfix/virtual_aliases': |
103 |
ensure => present, |
104 |
owner => root, |
105 |
group => root, |
106 |
mode => 644, |
107 |
content => template("postfix/virtual_aliases"), |
108 |
} |
109 |
|
110 |
exec { "postmap /etc/postfix/virtual_aliases": |
111 |
refreshonly => true, |
112 |
subscribe => File['/etc/postfix/virtual_aliases'], |
113 |
} |
114 |
} |
115 |
|
116 |
|
117 |
class secondary_smtp inherits smtp_server { |
118 |
} |
119 |
|
120 |
} |