class mail::system( $mydestination = hiera('mail::mydestination', '$myhostname, localhost.$mydomain, localhost'), $relay_domains = hiera('mail::relay_domains', ''), $mynetworks = hiera('mail::postfix_mynetworks', "127.0.0.0/8"), $root_mail_recipient = hiera('mail::root_mail_recipient', 'nobody') ) { # Base postfix class class { 'postfix': root_mail_recipient => $root_mail_recipient, smtp_listen => "all", use_amavisd => "yes", use_dovecot_lda => "yes", use_schleuder => hiera('mail::schleuder', false) ? { true => "yes", default => "no", }, use_sympa => hiera('mail::sympa', false) ? { true => "yes", default => "no", }, use_mlmmj => hiera('mail::mlmmj', false) ? { true => "yes", default => "no", }, use_firma => hiera('mail::firma', false) ? { true => "yes", default => "no", }, use_submission => "yes", use_smtps => "no", anon_sasl => "yes", manage_transport_regexp => "yes", manage_virtual_regexp => "yes", manage_header_checks => "yes", manage_tls_policy => hiera('mail::postfix_manage_tls_policy', 'no') } # Log rotation file { '/etc/logrotate.d/postfix': ensure => present, owner => 'root', group => 'root', mode => '0644', source => 'puppet:///modules/mail/postfix/logrotate', } # SSL support include ssl # Common subsystems include mail::packages include mail::tls::hardened include mail::amavisd include mail::header_checks include mail::clamav include mail::spamassassin include mail::opendkim # DKIM mail::opendkim::key { "$domain": } # Default parameters include mail::firma::params include mail::mlmmj::params include mail::sympa::params include mail::schleuder::params include mail::virtual::params include mail::virtual::web::params # Virtual mail system case hiera('mail::virtual', false) { true: { class { 'mail::virtual': } } default: { include mail::regular } } # Sympa mailing list manager case hiera('mail::sympa', false) { true: { class { 'mail::sympa': } $sympa_relay_domains = ", ${mail::sympa::subdomain}.${domain}" } 'disabled': { $sympa_relay_domains = '' include mail::sympa::disabled } default: { $sympa_relay_domains = '' } } # Schleuder mailing list manager case hiera('mail::schleuder', false) { true: { class { 'mail::schleuder': } $schleuder_relay_domains = ", ${mail::schleuder::subdomain}.${domain}" } default: { $schleuder_relay_domains = '' } } # Mlmmj case hiera('mail::mlmmj', false) { true: { class { 'mail::mlmmj': } $mlmmj_relay_domains = ", ${mail::mlmmj::subdomain}.${domain}" } default: { $mlmmj_relay_domains = '' } } # Firma case hiera('mail::firma', false) { true: { class { 'mail::firma': } $firma_relay_domains = ", ${mail::firma::subdomain}.${domain}" } default: { $firma_relay_domains = '' } } # GPG Mail Gateway case hiera('mail::gpg_mailgate', false) { true: { class { 'mail::gpg_mailgate': } } } case $relay_domains { '': { $real_relay_domains = "${mydestination}${sympa_relay_domains}${schleuder_relay_domains}${mlmmj_relay_domains}${firma_relay_domains}" } } # Include base configuration include mail::base }