X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fexim%2Fmanifests%2Fmx.pp;h=3a30975e5597470f86cacde0d7dc0a89ba897658;hb=3d1e20d9385fd27268e268d7d022b86ac6c905c5;hp=dce03586f0ed168b2211bc14d161e60fd8f53204;hpb=4658098c84ab6b11f6419fee7cc0e70f7eeb25df;p=mirror%2Fdsa-puppet.git diff --git a/modules/exim/manifests/mx.pp b/modules/exim/manifests/mx.pp index dce03586f..3a30975e5 100644 --- a/modules/exim/manifests/mx.pp +++ b/modules/exim/manifests/mx.pp @@ -1,56 +1,40 @@ -class exim::mx inherits exim { - include clamav - include postgrey +# 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, + } - file { '/etc/exim4/ccTLD.txt': - source => 'puppet:///modules/exim/common/ccTLD.txt', - } - file { '/etc/exim4/surbl_whitelist.txt': - source => 'puppet:///modules/exim/common/surbl_whitelist.txt', - } - file { '/etc/exim4/exim_surbl.pl': - source => 'puppet:///modules/exim/common/exim_surbl.pl', - notify => Service['exim4'], - } + include clamav + include postgrey + include fail2ban::exim - # 20181010 many connections: - # 188.165.219.27 - # 125.72.232.* - # 140.224.61.* - # 117.24.38.* - @ferm::rule { 'dsa-mail-abusers': - prio => "000", - rule => "saddr (188.165.219.27 125.72.232.0/24 140.224.61.0/24 117.24.38.0/24) DROP", - } + file { '/etc/exim4/ccTLD.txt': + source => 'puppet:///modules/exim/common/ccTLD.txt', + } + 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 { 'nagios-plugins-standard': - ensure => installed, - } + package { 'monitoring-plugins-standard': + ensure => installed, + } - if has_role('mailrelay') { - concat::fragment { 'dsa-puppet-stuff--email-virtualdomains': - target => '/etc/cron.d/dsa-puppet-stuff', - 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', + } }