aboutsummaryrefslogtreecommitdiff
path: root/manifests/mail.pp
blob: 54b3045ae09f2660aa2493df803a8d1859a8a87c (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
class nodo::mail {
  # Class for mail nodes
  $mail_host             = true
  $postfix_relayhost     = "$domain"
  $postfix_smtp_listen   = "$ipaddress"
  $postfix_mydestination = "\$myorigin"

  include nodo::vserver
  include postfix::mta
  include database

  # The needed packages
  package { [ 'postfix-mysql', 'dovecot-imapd', 'maildrop' ]:
    ensure => installed,
  }

  package { [ 'libauthen-sasl-cyrus-perl', 'libpam-mysql', 'libsasl2-modules',
              'libsasl2-modules-sql',      'libgsasl7',    'sasl2-bin' ]:
    ensure => installed,
  }

  package { [ 'postgrey', 'amavisd-new', 'spamassassin', 'spamc' ]:
    ensure => installed,
  }

  package { [ 'clamav-base', 'clamav-daemon', 'clamav-freshclam' ]:
    ensure => installed,
  }

  package { [ 'squirrelmail', 'squirrelmail-secure-login', 'squirrelmail-locales' ]:
    ensure => installed,
  } 

  # Postfix configuration
  postfix::config { "myhostname":      value  => "$fqdn" }
  postfix::config { "mailbox_command": value => '/usr/bin/maildrop -d ${USER}' }

  # SASL
  postfix::config { "smtpd_sasl_auth_enable":         value => 'yes' }
  postfix::config { "smtpd_sasl_local_domain":        value => '$myhostname' }
  postfix::config { "smtpd_sasl_security_options":    value => 'noanonymous' }
  postfix::config { "broken_sasl_auth_clients":       value => 'yes' }
  postfix::config { "smtpd_sasl_authenticated_header" value => 'yes' }

  # Whitelisting: local clients may specify any destination. Others may not.
  postfix::config { "smtpd_recipient_restrictions":
    value => 'permit_mynetworks,
              permit_sasl_authenticated,
              reject_unauth_destination,
              #reject_non_fqdn_hostname,
              #reject_non_fqdn_sender,
              #reject_non_fqdn_recipient,  
              #reject_unauth_destination,
              #reject_unauth_pipelining,   
              #reject_invalid_hostname,
              #reject_rbl_client multi.uribl.com,
              #reject_rbl_client dsn.rfc-ignorant.org,
              #reject_rbl_client dul.dnsbl.sorbs.net,
              #reject_rbl_client dnsbl.sorbs.net,
              #reject_rbl_client cbl.abuseat.org,
              #reject_rbl_client ix.dnsbl.manitu.net,
              #reject_rbl_client combined.rbl.msrbl.net,
              #reject_rbl_client rabl.nuclearelephant.com,
              #reject_rbl_client bl.spamcop.net,
              #reject_rbl_client zen.spamhaus.org,
              reject_rbl_client psbl.surriel.com,
              check_policy_service inet:127.0.0.1:10023' }
}