summaryrefslogtreecommitdiff
path: root/manifests/base.pp
blob: 77a818ebeedf551242f936aca2b9cf6c61626c69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class mail::base {
  # Postfix configuration
  postfix::config {
    "mydomain":                            value => "$::domain";
    "myhostname":                          value => "$::fqdn";
    "mydestination":                       value => "${mail::system::mydestination}";
    "mynetworks":                          value => "${mail::system::mynetworks}";
    "relay_domains":                       value => "${mail::system::real_relay_domains}";
    "transport_maps":                      value => "hash:/etc/postfix/transport, regexp:/etc/postfix/transport_regexp";
    "mailbox_command":                     value => '/usr/bin/maildrop -d ${USER}';
    "virtual_mailbox_base":                value => '/var/mail/virtual';
    "virtual_uid_maps":                    value => 'static:5000';
    "virtual_gid_maps":                    value => 'static:5000';
    "recipient_delimiter":                 value => '+';
  }

  # Postgrey port configuration
  $postgrey_port = $::lsbdistcodename ? {
    'lenny' => '60000',
    default => '10023',
  }

  # 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:${postgrey_port}" }

  postfix::hash { "/etc/postfix/virtual":
    ensure => present,
  }

  postfix::hash { "/etc/postfix/transport":
    ensure => present,
  }
}