]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - modules/exim/manifests/init.pp
generate TLSA record for our mailserver ports
[dsa-puppet.git] / modules / exim / manifests / init.pp
index e18f0aab5b20c586149a07bb3d2e8622b4ae1edf..10c449e704fc68ce020a3b49567f823cd68ea98c 100644 (file)
@@ -1,5 +1,7 @@
 class exim {
 
+       include exim::vdomain::setup
+
        munin::check { 'ps_exim4': script => 'ps_' }
        munin::check { 'exim_mailqueue': }
        munin::check { 'exim_mailstats': }
@@ -10,9 +12,20 @@ class exim {
 
        package { 'exim4-daemon-heavy': ensure => installed }
 
+       Package['exim4-daemon-heavy']->Mailalias<| |>
+
+       concat::fragment { 'virtual_domain_template':
+               target  => '/etc/exim4/virtualdomains',
+               content => template('exim/virtualdomains.erb'),
+               order   => 05,
+       }
+
        service { 'exim4':
                ensure  => running,
-               require => File['/etc/exim4/exim4.conf'],
+               require => [
+                       File['/etc/exim4/exim4.conf'],
+                       Package['exim4-daemon-heavy'],
+               ]
        }
 
        file { '/etc/exim4/':
@@ -43,6 +56,7 @@ class exim {
        }
        file { '/etc/exim4/exim4.conf':
                content => template('exim/eximconf.erb'),
+               require => File['/etc/exim4/ssl/thishost.crt'],
                notify  => Service['exim4'],
        }
        file { '/etc/mailname':
@@ -54,11 +68,8 @@ class exim {
        file { '/etc/exim4/locals':
                content => template('exim/locals.erb')
        }
-       file { '/etc/exim4/virtualdomains':
-               content => template('exim/virtualdomains.erb'),
-       }
        file { '/etc/exim4/submission-domains':
-               content => template('exim/common/submission-domains.erb'),
+               content => template('exim/submission-domains.erb'),
        }
        file { '/etc/exim4/host_blacklist':
                source => 'puppet:///modules/exim/common/host_blacklist',
@@ -122,23 +133,29 @@ class exim {
 
        case getfromhash($site::nodeinfo, 'mail_port') {
                /^(\d+)$/: { $mail_port = $1 }
-               default: { $mail_port = 'smtp' }
+               default: { $mail_port = '25' }
        }
 
        @ferm::rule { 'dsa-exim':
                description => 'Allow SMTP',
-               rule        => '&SERVICE_RANGE(tcp, $mail_port, \$SMTP_SOURCES)'
+               rule        => "&SERVICE_RANGE(tcp, $mail_port, \$SMTP_SOURCES)"
        }
 
        @ferm::rule { 'dsa-exim-v6':
                description => 'Allow SMTP',
                domain      => 'ip6',
-               rule        => '&SERVICE_RANGE(tcp, $mail_port, \$SMTP_V6_SOURCES)'
+               rule        => "&SERVICE_RANGE(tcp, $mail_port, \$SMTP_V6_SOURCES)"
+       }
+       dnsextras::tlsa_record{ "tlsa-mailport":
+               zone => 'debian.org',
+               certfile => "/etc/puppet/modules/exim/files/certs/${::fqdn}.crt",
+               port => "$mail_port",
+               hostname => "$::fqdn",
        }
 
        # Do we actually want this?  I'm only doing it because it's harmless
-  # and makes the logs quiet.  There are better ways of making logs quiet,
-  # though.
+       # and makes the logs quiet.  There are better ways of making logs quiet,
+       # though.
        @ferm::rule { 'dsa-ident':
                domain      => '(ip ip6)',
                description => 'Allow ident access',