# our heavy exim class
-class exim::mx {
+# @param is_mailrelay this system is a mailrelay, both in and out, for debian hosts
+class exim::mx(
+ Boolean $is_mailrelay = false,
+){
class { 'exim':
- smarthost => undef,
+ use_smarthost => false,
+ is_mailrelay => $is_mailrelay,
}
include clamav
notify => Service['exim4'],
}
- # MXs used as smarthosts
- ferm::rule { 'dsa-exim-submission':
- description => 'Allow SMTP',
- rule => '&SERVICE_RANGE(tcp, submission, $SMTP_SOURCES)'
- }
- ferm::rule { 'dsa-exim-v6-submission':
- description => 'Allow SMTP',
- domain => 'ip6',
- rule => '&SERVICE_RANGE(tcp, submission, $SMTP_V6_SOURCES)',
- }
- $autocertdir = hiera('paths.auto_certs_dir')
- dnsextras::tlsa_record{ 'tlsa-submission':
- zone => 'debian.org',
- certfile => "${autocertdir}/${::fqdn}.crt",
- port => 587,
- hostname => $::fqdn,
- }
package { 'monitoring-plugins-standard':
ensure => installed,
}
- if $exim::is_mailrelay {
- concat::fragment { 'puppet-crontab--email-virtualdomains':
- target => '/etc/cron.d/puppet-crontab',
- content => @(EOF)
- @hourly root if [ ! -d /etc/exim4/email-virtualdomains ]; then cd /etc/exim4 && git clone mail-git:email-virtualdomains ; fi && cd /etc/exim4/email-virtualdomains && git pull --quiet --ff-only
- | EOF
- }
+ ferm::rule::simple { 'dsa-smtp':
+ description => 'Allow smtp access from the world',
+ port => '25',
}
- file { '/etc/cron.d/dsa-email-virtualdomains': ensure => absent, }
}