1 |
class postfix { |
2 |
class base { |
3 |
package { [postfix,nail]: } |
4 |
|
5 |
service { postfix: |
6 |
ensure => running, |
7 |
subscribe => [ Package['postfix']], |
8 |
path => "/etc/init.d/postfix" |
9 |
} |
10 |
|
11 |
file { '/etc/postfix/main.cf': |
12 |
require => Package["postfix"], |
13 |
content => "", |
14 |
notify => [Service['postfix']], |
15 |
} |
16 |
} |
17 |
|
18 |
|
19 |
class simple_relay inherits base { |
20 |
File['/etc/postfix/main.cf'] { |
21 |
content => template("postfix/simple_relay_main.cf"), |
22 |
} |
23 |
} |
24 |
|
25 |
class smtp_server inherits base { |
26 |
include postgrey |
27 |
include amavis |
28 |
include spamassassin |
29 |
|
30 |
File['/etc/postfix/main.cf'] { |
31 |
content => template("postfix/main.cf"), |
32 |
} |
33 |
|
34 |
file { '/etc/postfix/transport_regexp': |
35 |
content => template("postfix/transport_regexp"), |
36 |
} |
37 |
|
38 |
} |
39 |
|
40 |
class primary_smtp inherits smtp_server { |
41 |
|
42 |
package { "postfix-ldap": } |
43 |
|
44 |
# council is here until we fully decide who has aliases in com team, |
45 |
# see https://bugs.mageia.org/show_bug.cgi?id=1345 |
46 |
# alumini is a special group for tracking previous members of |
47 |
# the project, so they keep their aliases for a time |
48 |
$aliases_group = ['mga-founders','mga-packagers', |
49 |
'mga-sysadmin','mga-council', |
50 |
'mga-alumni','mga-i18n-committers', |
51 |
] |
52 |
$ldap_password = extlookup("postfix_ldap",'x') |
53 |
|
54 |
file { |
55 |
'/etc/postfix/master.cf': content => template("postfix/primary_master.cf"); |
56 |
'/etc/postfix/ldap_aliases.conf': content => template("postfix/ldap_aliases.conf"); |
57 |
# TODO merge the file with the previous one, for common part (ldap, etc) |
58 |
'/etc/postfix/group_aliases.conf': content => template("postfix/group_aliases.conf"); |
59 |
# TODO make it conditional to the presence of sympa |
60 |
'/etc/postfix/sympa_aliases': content => template("postfix/sympa_aliases"); |
61 |
'/etc/postfix/virtual_aliases': content => template("postfix/virtual_aliases"); |
62 |
} |
63 |
|
64 |
exec { "postmap /etc/postfix/virtual_aliases": |
65 |
refreshonly => true, |
66 |
subscribe => File['/etc/postfix/virtual_aliases'], |
67 |
} |
68 |
} |
69 |
|
70 |
class secondary_smtp inherits smtp_server { |
71 |
} |
72 |
} |