Commit 8395745b authored by Raphaël Pinson's avatar Raphaël Pinson
Browse files

Move mta defaults to init, force mta params from satellite

parent 66b66f09
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -77,8 +77,8 @@ class postfix (
  $master_smtps        = undef,         # postfix_master_smtps
  $master_submission   = undef,         # postfix_master_submission
  $mta                 = false,
  $mydestination       = undef,       # postfix_mydestination
  $mynetworks          = undef,       # postfix_mynetworks
  $mydestination       = '$myorigin',   # postfix_mydestination
  $mynetworks          = '127.0.0.0/8', # postfix_mynetworks
  $myorigin            = $::fqdn,
  $relayhost           = undef,         # postfix_relayhost
  $root_mail_recipient = 'nobody',      # root_mail_recipient
+4 −11
Original line number Diff line number Diff line
@@ -30,17 +30,10 @@
#     }
#   }
#
class postfix::mta {

  $mydestination = $postfix::mydestination ? {
    undef   => '$myorigin',
    default => $postfix::mydestination,
  }

  $mynetworks = $postfix::mynetworks ? {
    undef   => '127.0.0.0/8',
    default => $postfix::mynetworks,
  }
class postfix::mta (
  $mydestination = $postfix::mydestination,
  $mynetworks = $postfix::mynetworks,
) {

  validate_re($postfix::relayhost, '^\S+$',
              'You must pass $relayhost to the postfix class')
+8 −2
Original line number Diff line number Diff line
@@ -21,11 +21,17 @@
#     include postfix::satellite
#   }
#
class postfix::satellite {
class postfix::satellite (
  $mydestination = $postfix::mydestination,
  $mynetworks    = $postfix::mynetworks,
) {

  validate_re($postfix::myorigin, '^\S+$')

  include ::postfix::mta
  class { '::postfix::mta':
    mydestination => $mydestination,
    mynetworks    => $mynetworks,
  }

  postfix::virtual { "@${postfix::myorigin}":
    ensure      => present,