Skip to content
Snippets Groups Projects
Select Git revision
  • 61b4876cb7d8031956e6497b6e43bfba1a1461d8
  • master default protected
  • 5.x
  • ll-php8-bs5
  • release_5_bs5
  • ll-php8
  • 4.x
  • laminas_migration
  • release_1.0.0.2
  • release_4.0.0
  • release_3.2.8
  • bootstrap4_migration
  • 1.0.0.3
  • 6.0.7
  • 6.0.6
  • 6.0.5
  • 6.0.4
  • 6.0.3
  • 6.0.2
  • 6.0.1
  • 5.1.1
  • 6.0.0
  • 5.1.0
  • 5.0.0
  • 4.0.2
  • 3.2.11
  • 4.0.1
  • 3.2.10
  • 4.0.0
  • 1.0.0.2
  • 3.2.9
  • 3.2.8
32 results

schema_mysql.sql

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    mta.pp 1.76 KiB
    # == Class: postfix::mta
    #
    # This class configures a minimal MTA, delivering mail to
    # $mydestination.
    #
    # Either a valid relay host or the special word 'direct' is required
    # ($relayhost) for outbound email.
    #
    # transport & virtual maps get configured and can be populated with
    # postfix::transport and postfix::virtual
    #
    # === Parameters
    #
    # [*relayhost*]     - (string) the relayhost to use or 'direct' to send mail
    #                     directly without a relay.
    # [*mydestination*] - (string)
    # [*mynetworks*]    - (string)
    #
    # === Examples
    #
    #   class { 'postfix':
    #     relayhost     => 'mail.example.com',
    #     smtp_listen   => '0.0.0.0',
    #     mydestination => '$myorigin, myapp.example.com',
    #     mta           => true,
    #   }
    #
    class postfix::mta (
      $mydestination = $postfix::mydestination,
      $mynetworks    = $postfix::mynetworks,
      $relayhost     = $postfix::relayhost,
    ) {
    
      validate_re($relayhost, '^\S+$',
                  'Wrong value for $relayhost')
      validate_re($mydestination, '^\S+(?:,\s*\S+)*$',
                  'Wrong value for $mydestination')
      validate_re($mynetworks, '^(?:\S+?(?:(?:,\s)|(?:\s))?)*$',
                  'Wrong value for $mynetworks')
    
      # If direct is specified then relayhost should be blank
      if ($relayhost == 'direct') {
        postfix::config { 'relayhost': ensure => 'blank' }
      }
      else {
        postfix::config { 'relayhost': value => $relayhost }
      }
    
      postfix::config {
        'mydestination':       value => $mydestination;
        'mynetworks':          value => $mynetworks;
        'virtual_alias_maps':  value => 'hash:/etc/postfix/virtual';
        'transport_maps':      value => 'hash:/etc/postfix/transport';
      }
    
      postfix::hash { '/etc/postfix/virtual':
        ensure => 'present',
      }
    
      postfix::hash { '/etc/postfix/transport':
        ensure => 'present',
      }
    
    }