X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fexim%2Fmanifests%2Fmx.pp;h=3a30975e5597470f86cacde0d7dc0a89ba897658;hb=a88171ed3f6b43024a077f7044a8fdda95fe69d7;hp=833ba262c1ba8e6d20a832ee500436070359fa94;hpb=69f0b861e58644fba443ececeb29eb03cca333dc;p=mirror%2Fdsa-puppet.git diff --git a/modules/exim/manifests/mx.pp b/modules/exim/manifests/mx.pp index 833ba262c..3a30975e5 100644 --- a/modules/exim/manifests/mx.pp +++ b/modules/exim/manifests/mx.pp @@ -1,4 +1,13 @@ -class exim::mx inherits exim { +# our heavy exim class +# @param is_mailrelay this system is a mailrelay, both in and out, for debian hosts +class exim::mx( + Boolean $is_mailrelay = false, +){ + class { 'exim': + use_smarthost => false, + is_mailrelay => $is_mailrelay, + } + include clamav include postgrey include fail2ban::exim @@ -9,39 +18,23 @@ class exim::mx inherits exim { file { '/etc/exim4/surbl_whitelist.txt': source => 'puppet:///modules/exim/common/surbl_whitelist.txt', } + file { '/etc/exim4/two-level-tlds': + source => 'puppet:///modules/exim/common/two-level-tlds', + } + file { '/etc/exim4/three-level-tlds': + source => 'puppet:///modules/exim/common/three-level-tlds', + } file { '/etc/exim4/exim_surbl.pl': source => 'puppet:///modules/exim/common/exim_surbl.pl', 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 - } - } - file { '/etc/cron.d/dsa-email-virtualdomains': ensure => absent, } + ferm::rule::simple { 'dsa-smtp': + description => 'Allow smtp access from the world', + port => '25', + } }