init.pp 1.23 KB
Newer Older
1
2
3
4
5
6
7
#
# == Class: postfix
#
# This class provides a basic setup of postfix with local and remote
# delivery and an SMTP server listening on the loopback interface.
#
# Parameters:
8
9
10
# - *$postfix_smtp_listen*: address on which the smtp service will listen to.
#      defaults to 127.0.0.1
# - *$root_mail_recipient*: who will recieve root's emails. defaults to 'nobody'
11
12
13
#
# Example usage:
#
14
15
#   node 'toto.example.com' {
#     $postfix_smtp_listen = '192.168.1.10'
16
17
18
#     include postfix
#   }
#
Raphaël Pinson's avatar
Linting    
Raphaël Pinson committed
19
20
21
class postfix (
  $smtp_listen = '127.0.0.1',         # postfix_smtp_listen
  $root_mail_recipient = 'nobody',    # root_mail_recipient
22
23
24
25
  $use_amavisd = false,               # postfix_use_amavisd
  $use_dovecot_lda = false,           # postfix_use_dovecot_lda
  $use_schleuder = false,             # postfix_use_schleuder
  $use_sympa = false,                 # postfix_use_sympa
Raphaël Pinson's avatar
Linting    
Raphaël Pinson committed
26
27
28
29
30
  $mail_user = 'vmail',               # postfix_mail_user
  $myorigin = $::fqdn,
  $inet_interfaces = 'localhost',
) inherits postfix::params {

31
32
33
34
35
  validate_bool($use_amavisd)
  validate_bool($use_dovecot_lda)
  validate_bool($use_schleuder)
  validate_bool($use_sympa)

Raphaël Pinson's avatar
Linting    
Raphaël Pinson committed
36
37
38
39
  class { 'postfix::packages': } ->
  class { 'postfix::files': } ~>
  class { 'postfix::service': } ->
  Class['postfix']
40
}