aboutsummaryrefslogtreecommitdiff
path: root/manifests/subsystem/mail.pp
blob: d0773e93e16bd1274dac6d1b8141f8d81d2161a3 (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
class nodo::subsystem::mail {
  # Email delivery configuration
  $mail_delivery = hiera('nodo::subsystem::mail::delivery', 'exim')

  # A handy SMTP wrapper
  include nodo::subsystem::mail::msmtp

  if $mail_delivery != 'postfix' {
  #if !defined(Package['mailx']) {
    package { 'mailx':
      name   => 'bsd-mailx',
      ensure => present,
    }
  }

  case $mail_delivery {
    'tunnel': {
      $mail_hostname = hiera('nodo::subsystem::mail::hostname')
      tunnel::autossh::mail { "$mail_hostname":
        sshport   => hiera('nodo::subsystem::mail::ssh_port'),
      }
    }
    'postfix', 'disabled': { }
    '','exim',default: {
        include exim::tls
     }
  }
}