Commit 5092926d authored by intrigeri's avatar intrigeri Committed by Raphaël Pinson
Browse files

Add postfix::mailalias, that creates an email alias and updates the binary...

Add postfix::mailalias, that creates an email alias and updates the binary version of the local alias database. (#233)

Supersedes #115.
parent 4c578f2a
Loading
Loading
Loading
Loading
+1 −2
Changes for manifests/files.pp: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -101,9 +101,8 @@ class postfix::files {
  }

  if $manage_root_alias {
    mailalias {'root':
    postfix::mailalias {'root':
      recipient => $root_mail_recipient,
      notify    => Exec['newaliases'],
    }
  }

manifests/mailalias.pp

0 → 100644
+37 −0
Changes for manifests/mailalias.pp: 37 added lines, 0 removed lines.
Original line number Diff line number Diff line
# == Definition: postfix::mailalias
#
# Creates an email alias in the local alias database and updates the binary
# version of said database.
#
# === Parameters
#
# [*name*]      - the alias name. See aliases(5).
# [*ensure*]    - present/absent, defaults to present.
# [*recipient*] - where email should be sent.
#
# === Requires
#
# - Class["postfix"]
#
# === Examples
#
#   node "toto.example.com" {
#
#     include postfix
#
#     postfix::mailalias { 'postmaster':
#       ensure    => present,
#       recipient => 'foo',
#     }
#
define postfix::mailalias (
  Variant[String, Array[String]] $recipient,
  Enum['present', 'absent']      $ensure='present',
) {
  mailalias { $title:
    ensure    => $ensure,
    name      => $name,
    recipient => $recipient,
    notify    => Exec['newaliases'],
  }
}