summaryrefslogtreecommitdiff
path: root/manifests/system.pp
blob: a1df20f8d46ad23c401abc88c2c61e62fbf42a15 (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
class mail::system {
  $postfix_smtp_listen             = "all"
  $postfix_use_amavisd             = "yes"
  $postfix_use_dovecot_lda         = "yes"
  $postfix_use_schleuder           = "yes"
  $postfix_use_sympa               = "yes"
  $postfix_use_mlmmj               = "yes"
  $postfix_use_firma               = "yes"
  $postfix_anon_sasl               = "yes"
  $postfix_manage_transport_regexp = "yes"
  $postfix_manage_virtual_regexp   = "yes"
  $postfix_mydestination           = '$myhostname, localhost.$mydomain, localhost'
  $postfix_default_relay_domains   = '$mydestination'

  case $postfix_mynetworks {
    '': { $postfix_mynetworks = "127.0.0.0/8" }
  }

  case $sympa_subdomain {
    '': { $sympa_subdomain = "lists" }
  }

  # Module requirements
  include postfix
  include ssl

  # Common subsystems
  include mail::packages
  include mail::tls
  include mail::amavisd
  include mail::header_checks
  include mail::clamav
  include mail::spamassassin

  # Virtual mail system
  case $mail_virtual {
    true: {
      include mail::virtual
    }
    default: {
      include mail::regular
    }
  }

  # Sympa mailing list manager
  case $mail_sympa {
    true: {
      $sympa_relay_domains = ", ${sympa_subdomain}.${domain}"
      include mail::sympa
    }
    'disabled': {
      include mail::sympa::disabled
    }
    default: {
    }
  }

  # Schleuder mailing list manager
  case $mail_schleuder {
    true: {
      case $schleuder_subdomain {
        '': { $schleuder_subdomain = "encrypted" }
      }

      $schleuder_relay_domains = ", ${schleuder_subdomain}.${domain}"
      include mail::schleuder
    }
  }

  # Mlmmj
  case $mail_mlmmj {
    true: {
      case $mlmmj_subdomain {
        '': { $mlmmj_subdomain = "mlmmj" }
      }

      $mlmmj_relay_domains = ", ${mlmmj_subdomain}.${domain}"
      include mail::mlmmj
    }
  }

  # Firma
  case $mail_firma {
    true: {
      case $firma_subdomain {
        '': { $firma_subdomain = "firma" }
      }

      $firma_relay_domains = ", ${firma_subdomain}.${domain}"
      include mail::firma
    }
  }

  case $postfix_relay_domains {
    '': { $postfix_relay_domains = "${postfix_default_relay_domains}${sympa_relay_domains}${schleuder_relay_domains}${mlmmj_relay_domains}${firma_relay_domains}" }
  }

  # Include base configuration
  include mail::base
}