class mail::system { $postfix_smtp_listen = "all" $postfix_use_amavisd = "yes" $postfix_mydestination = '$myhostname, $mydomain, localhost.$mydomain, localhost' case $postfix_mynetworks { '': { $postfix_mynetworks = "127.0.0.0/8" } } case $postfixadmin_password { '': { fail("You need to define \$postfixadmin_password host config") } } case $postfixadmin_user { '': { $postfixadmin_user = "postfix" } } case $postfixadmin_hosts { '': { $postfixadmin_hosts = "localhost" } } case $postfixadmin_dbname { '': { $postfixadmin_dbname= "postfix" } } # Module requirements include postfix include database include ssl::mail include websites::setup # Subsystems include mail::packages include mail::sasl include mail::tls include mail::dovecot include mail::amavisd include mail::header_checks include mail::postfixadmin # Postfix configuration postfix::config { "mydomain": value => "$domain"; "myhostname": value => "$fqdn"; "mydestination": value => "$postfix_mydestination"; "mynetworks": value => "$postfix_mynetworks"; "relay_domains": value => "$domain"; "transport_maps": value => "hash:/etc/postfix/transport"; "mailbox_command": value => '/usr/bin/maildrop -d ${USER}'; "virtual_mailbox_base": value => '/var/mail/virtual'; } postfix::hash { "/etc/postfix/virtual": ensure => present, } postfix::hash { "/etc/postfix/transport": ensure => present, } # Recipient restrictions postfix::config { "smtpd_recipient_restrictions": value => 'permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_rbl_client psbl.surriel.com, check_policy_service inet:127.0.0.1:60000' } }