2 # @param use_smarthost use the smarthost
3 # @param smarthost host to relay through (if set and use_smarthost)
4 # @param is_bugsmx this system handles bugs.debian.org
5 # @param is_mailrelay this system is a mailrelay, both in and out, for debian hosts
6 # @param is_rtmaster this system handles rt.debian.org
7 # @param is_packagesmaster this system handles packagesrt.debian.org
8 # @param is_packagesqamaster this system handles packages.qa.debian.org
9 # @param mail_port override the default incoming mailport (only applicable for hosts behind an incoming relay)
10 # @param smarthost_port the port on which satellites send mail to the smarthost (needs to be the same on both sides)
12 Optional[String] $smarthost,
13 Optional[Integer] $mail_port,
14 Boolean $use_smarthost = true,
15 Boolean $is_bugsmx = false,
16 Boolean $is_mailrelay = false,
17 Boolean $is_rtmaster = false,
18 Boolean $is_packagesmaster = false,
19 Boolean $is_packagesqamaster = false,
20 Integer $smarthost_port = 587,
22 include exim::vdomain::setup
23 include debian_org::mail_incoming_port
29 fail('No smarthost set but use_smarthost is true')
34 fail('Cannot override mail_port in heavy/no-smarthost hosts')
38 munin::check { 'ps_exim4': script => 'ps_' }
39 munin::check { 'exim_mailqueue': }
40 munin::check { 'exim_mailstats': }
42 munin::check { 'postfix_mailqueue': ensure => absent }
43 munin::check { 'postfix_mailstats': ensure => absent }
44 munin::check { 'postfix_mailvolume': ensure => absent }
46 package { 'exim4-daemon-heavy': ensure => installed }
48 Package['exim4-daemon-heavy']->Mailalias<| |>
50 concat::fragment { 'virtual_domain_template':
51 target => '/etc/exim4/virtualdomains',
52 content => template('exim/virtualdomains.erb'),
59 File['/etc/exim4/exim4.conf'],
60 Package['exim4-daemon-heavy'],
67 require => Package['exim4-daemon-heavy'],
70 file { '/etc/exim4/conf.d':
75 source => 'puppet:///files/empty/',
77 file { '/etc/exim4/ssl':
79 group => 'Debian-exim',
83 file { '/etc/exim4/exim4.conf':
84 content => template('exim/eximconf.erb'),
85 require => File['/etc/exim4/ssl/thishost.crt'],
86 notify => Service['exim4'],
88 file { '/etc/mailname':
89 content => template('exim/mailname.erb'),
91 file { '/etc/exim4/manualroute':
92 content => template('exim/manualroute.erb')
94 file { '/etc/exim4/locals':
95 content => template('exim/locals.erb')
97 file { '/etc/exim4/submission-domains':
98 content => template('exim/submission-domains.erb'),
100 file { '/etc/exim4/host_blacklist':
101 source => 'puppet:///modules/exim/common/host_blacklist',
103 file { '/etc/exim4/blacklist':
104 source => 'puppet:///modules/exim/common/blacklist',
106 file { '/etc/exim4/callout_users':
107 source => 'puppet:///modules/exim/common/callout_users',
109 file { '/etc/exim4/grey_users':
110 source => 'puppet:///modules/exim/common/grey_users',
112 file { '/etc/exim4/helo-check':
113 source => 'puppet:///modules/exim/common/helo-check',
115 file { '/etc/exim4/localusers':
116 source => 'puppet:///modules/exim/common/localusers',
118 file { '/etc/exim4/rbllist':
119 source => 'puppet:///modules/exim/common/rbllist',
121 file { '/etc/exim4/rhsbllist':
122 source => 'puppet:///modules/exim/common/rhsbllist',
124 file { '/etc/exim4/whitelist':
125 source => 'puppet:///modules/exim/common/whitelist',
127 file { '/etc/logrotate.d/exim4-base':
128 source => 'puppet:///modules/exim/common/logrotate-exim4-base',
130 file { '/etc/logrotate.d/exim4-paniclog':
131 source => 'puppet:///modules/exim/common/logrotate-exim4-paniclog'
133 file { '/etc/exim4/ssl/thishost.crt':
134 content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_certs_dir"]) + "/" + @fqdn + ".crt") %>'),
135 group => 'Debian-exim',
138 file { '/etc/exim4/ssl/thishost.key':
139 content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_certs_dir"]) + "/" + @fqdn + ".key") %>'),
140 group => 'Debian-exim',
143 file { '/etc/exim4/ssl/ca.crt':
144 content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_certs_dir"]) + "/ca.crt") %>'),
145 group => 'Debian-exim',
148 file { '/etc/exim4/ssl/ca.crl':
149 content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_certs_dir"]) + "/ca.crl") %>'),
150 group => 'Debian-exim',
153 file { '/var/log/exim4':
156 owner => 'Debian-exim',
160 # Do we actually want this? I'm only doing it because it's harmless
161 # and makes the logs quiet. There are better ways of making logs quiet,
163 ferm::rule { 'dsa-ident':
164 domain => '(ip ip6)',
165 description => 'Allow ident access',
166 rule => '&SERVICE(tcp, 113)'
169 # These only affect the alias @$fqdn, not say, @debian.org