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 Boolean $use_smarthost = true,
14 Boolean $is_bugsmx = false,
15 Boolean $is_mailrelay = false,
16 Boolean $is_rtmaster = false,
17 Boolean $is_packagesmaster = false,
18 Boolean $is_packagesqamaster = false,
19 Integer $smarthost_port = 587,
20 Optional[Integer] $mail_port = undef,
22 include exim::vdomain::setup
28 fail('No smarthost set but use_smarthost is true')
33 fail('Cannot override mail_port in heavy/no-smarthost hosts')
37 munin::check { 'ps_exim4': script => 'ps_' }
38 munin::check { 'exim_mailqueue': }
39 munin::check { 'exim_mailstats': }
41 munin::check { 'postfix_mailqueue': ensure => absent }
42 munin::check { 'postfix_mailstats': ensure => absent }
43 munin::check { 'postfix_mailvolume': ensure => absent }
45 package { 'exim4-daemon-heavy': ensure => installed }
47 Package['exim4-daemon-heavy']->Mailalias<| |>
49 concat::fragment { 'virtual_domain_template':
50 target => '/etc/exim4/virtualdomains',
51 content => template('exim/virtualdomains.erb'),
58 File['/etc/exim4/exim4.conf'],
59 Package['exim4-daemon-heavy'],
66 require => Package['exim4-daemon-heavy'],
69 file { '/etc/exim4/conf.d':
74 source => 'puppet:///files/empty/',
76 file { '/etc/exim4/ssl':
78 group => 'Debian-exim',
82 file { '/etc/exim4/exim4.conf':
83 content => template('exim/eximconf.erb'),
84 require => File['/etc/exim4/ssl/thishost.crt'],
85 notify => Service['exim4'],
87 file { '/etc/mailname':
88 content => template('exim/mailname.erb'),
90 if ! defined(Class['exim::mailrelay']) {
91 file { '/etc/exim4/manualroute':
95 file { '/etc/exim4/locals':
96 content => template('exim/locals.erb')
98 file { '/etc/exim4/submission-domains':
99 content => template('exim/submission-domains.erb'),
101 file { '/etc/exim4/host_blacklist':
102 source => 'puppet:///modules/exim/common/host_blacklist',
104 file { '/etc/exim4/blacklist':
105 source => 'puppet:///modules/exim/common/blacklist',
107 file { '/etc/exim4/callout_users':
108 source => 'puppet:///modules/exim/common/callout_users',
110 file { '/etc/exim4/grey_users':
111 source => 'puppet:///modules/exim/common/grey_users',
113 file { '/etc/exim4/helo-check':
114 source => 'puppet:///modules/exim/common/helo-check',
116 file { '/etc/exim4/localusers':
117 source => 'puppet:///modules/exim/common/localusers',
119 file { '/etc/exim4/rbllist':
120 source => 'puppet:///modules/exim/common/rbllist',
122 file { '/etc/exim4/rhsbllist':
123 source => 'puppet:///modules/exim/common/rhsbllist',
125 file { '/etc/exim4/whitelist':
126 source => 'puppet:///modules/exim/common/whitelist',
128 file { '/etc/logrotate.d/exim4-base':
129 source => 'puppet:///modules/exim/common/logrotate-exim4-base',
131 file { '/etc/logrotate.d/exim4-paniclog':
132 source => 'puppet:///modules/exim/common/logrotate-exim4-paniclog'
134 file { '/etc/exim4/ssl/thishost.crt':
135 content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_certs_dir"]) + "/" + @fqdn + ".crt") %>'),
136 group => 'Debian-exim',
139 file { '/etc/exim4/ssl/thishost.key':
140 content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_certs_dir"]) + "/" + @fqdn + ".key") %>'),
141 group => 'Debian-exim',
144 file { '/etc/exim4/ssl/ca.crt':
145 content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_certs_dir"]) + "/ca.crt") %>'),
146 group => 'Debian-exim',
149 file { '/etc/exim4/ssl/ca.crl':
150 content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.auto_certs_dir"]) + "/ca.crl") %>'),
151 group => 'Debian-exim',
154 file { '/var/log/exim4':
157 owner => 'Debian-exim',
161 # Do we actually want this? I'm only doing it because it's harmless
162 # and makes the logs quiet. There are better ways of making logs quiet,
164 ferm::rule { 'dsa-ident':
165 domain => '(ip ip6)',
166 description => 'Allow ident access',
167 rule => '&SERVICE(tcp, 113)'
170 # These only affect the alias @$fqdn, not say, @debian.org