postfix-satellite.pp 949 Bytes
Newer Older
1
2
#
# == Class: postfix::satellite
3
4
5
#
# This class configures all local email (cron, mdadm, etc) to be forwarded
# to $root_mail_recipient, using $postfix_relayhost as a relay.
6
#
7
8
9
# $valid_fqdn can be set to override $fqdn in the case where the FQDN is
# not recognized as valid by the destination server.
#
10
11
12
13
14
# Parameters:
# - *valid_fqdn*
# - every global variable which works for class "postfix" will work here.
#
# Example usage:
15
#
16
17
18
19
#   node "toto.local.lan" {
#     $postfix_relayhost = "mail.example.com"
#     $valid_fqdn = "toto.example.com"
#     $root_mail_recipient = "the.sysadmin@example.com"
20
#
21
22
#     include postfix::satellite
#   }
23
#
Francois Deppierraz's avatar
Francois Deppierraz committed
24
class postfix::satellite {
25

26
  # If $valid_fqdn exists, use it to override $fqdn
27
28
29
30
31
  case $valid_fqdn {
    "":      { $valid_fqdn = $fqdn }
    default: { $fqdn = "${valid_fqdn}" }
  }

Francois Deppierraz's avatar
Francois Deppierraz committed
32
  include postfix::mta
33

Francois Deppierraz's avatar
Francois Deppierraz committed
34
  postfix::virtual {"@${valid_fqdn}":
35
36
37
38
    ensure      => present,
    destination => "root",
  }
}