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 @@ ...@@ -32,7 +32,7 @@
# } # }
# #
define postfix::transport ( define postfix::transport (
$destination, $destination='',
$nexthop='', $nexthop='',
$file='/etc/postfix/transport', $file='/etc/postfix/transport',
$ensure='present' $ensure='present'
...@@ -41,21 +41,23 @@ define postfix::transport ( ...@@ -41,21 +41,23 @@ define postfix::transport (
case $ensure { case $ensure {
'present': { 'present': {
if ($destination) {
$change_destination = "set pattern[. = '${name}']/transport '${destination}'"
} else {
$change_destination = "clear pattern[. = '${name}']/transport"
}
if ($nexthop) { if ($nexthop) {
$changes = [ $change_nexthop = "set pattern[. = '${name}']/nexthop '${nexthop}'"
"set pattern[. = '${name}'] '${name}'",
"set pattern[. = '${name}']/transport '${destination}'",
# TODO: support nexthop
"set pattern[. = '${name}']/nexthop '${nexthop}'",
]
} else { } else {
$changes = [ $change_nexthop = "clear pattern[. = '${name}']/nexthop"
"set pattern[. = '${name}'] '${name}'",
"set pattern[. = '${name}']/transport '${destination}'",
# TODO: support nexthop
"clear pattern[. = '${name}']/nexthop",
]
} }
$changes = [
"set pattern[. = '${name}'] '${name}'",
$change_destination,
$change_nexthop,
]
} }
'absent': { 'absent': {
......
Supports Markdown
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