Commit 003e7f3e authored by Raphaël Pinson's avatar Raphaël Pinson
Browse files

Merge pull request #23 from ekohl/blank-destination

Unable to drop outbound external mail using transports
parents bd055b50 a9878376
......@@ -32,7 +32,7 @@
# }
#
define postfix::transport (
$destination,
$destination='',
$nexthop='',
$file='/etc/postfix/transport',
$ensure='present'
......@@ -41,21 +41,23 @@ define postfix::transport (
case $ensure {
'present': {
if ($destination) {
$change_destination = "set pattern[. = '${name}']/transport '${destination}'"
} else {
$change_destination = "clear pattern[. = '${name}']/transport"
}
if ($nexthop) {
$changes = [
"set pattern[. = '${name}'] '${name}'",
"set pattern[. = '${name}']/transport '${destination}'",
# TODO: support nexthop
"set pattern[. = '${name}']/nexthop '${nexthop}'",
]
$change_nexthop = "set pattern[. = '${name}']/nexthop '${nexthop}'"
} else {
$changes = [
"set pattern[. = '${name}'] '${name}'",
"set pattern[. = '${name}']/transport '${destination}'",
# TODO: support nexthop
"clear pattern[. = '${name}']/nexthop",
]
$change_nexthop = "clear pattern[. = '${name}']/nexthop"
}
$changes = [
"set pattern[. = '${name}'] '${name}'",
$change_destination,
$change_nexthop,
]
}
'absent': {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment