summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkwadronaut <kwadronaut@leap.se>2018-11-06 18:43:45 +0100
committerkwadronaut <kwadronaut@leap.se>2018-11-06 18:44:28 +0100
commite14722271a7700945874b72daed79240fbadaa4a (patch)
treef8edee79945fcd2d93d624878579725f12258d33
parent6550524550debe1eaadf99e8adb7c568ae8797b1 (diff)
parent6743a08b90a118130edd3e59449c5b389fb1796e (diff)
Merge remote-tracking branch 'shared/master'
-rw-r--r--README.md11
-rw-r--r--manifests/config.pp4
-rw-r--r--manifests/header_checks_snippet.pp3
-rw-r--r--manifests/tlspolicy_snippet.pp8
-rw-r--r--manifests/transport_regexp_snippet.pp7
-rw-r--r--manifests/virtual_regexp_snippet.pp7
-rw-r--r--templates/master.cf.debian-9.erb2
7 files changed, 21 insertions, 21 deletions
diff --git a/README.md b/README.md
index 7a6b01f..c7646a9 100644
--- a/README.md
+++ b/README.md
@@ -122,9 +122,13 @@ Convience classes
postfix::config
---------------
-this can be used to pass arbitrary postfix configurations by passing the $name
+This can be used to pass arbitrary postfix configurations by passing the $name
to postconf to add/alter/remove options in main.cf
+It can also be used to ensure that a certain configuration is not present by
+setting the ensure parameter to absent. In this case, the value parameter is
+still mandatory but can be set to whatever value.
+
Parameters:
- *name*: name of the parameter.
- *ensure*: present/absent. defaults to present.
@@ -144,6 +148,11 @@ Example usage:
"relayhost" => "[mail.example.com]:587";
}
+ postfix::config { 'smtp_tls_cert_file':
+ ensure => absent,
+ value => '',
+ }
+
postfix::disable
----------------
diff --git a/manifests/config.pp b/manifests/config.pp
index ce7af9e..a1eb651 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -43,7 +43,9 @@ define postfix::config ($ensure = present, $value, $nonstandard = false) {
}
absent: {
- fail "postfix::config ensure => absent: Not implemented"
+ exec { "postconf -X ${name}":
+ unless => "test \"x$(postconf -n ${name})\" = \"x\"",
+ }
}
}
}
diff --git a/manifests/header_checks_snippet.pp b/manifests/header_checks_snippet.pp
index 05929a3..4c8df86 100644
--- a/manifests/header_checks_snippet.pp
+++ b/manifests/header_checks_snippet.pp
@@ -6,7 +6,6 @@ See the postfix::header_checks class for details.
Parameters:
- *source* or *content*: source or content of the header_checks snippet
-- *ensure*: present (default) or absent
Requires:
- Class["postfix"]
@@ -24,7 +23,6 @@ Example usage:
*/
define postfix::header_checks_snippet (
- $ensure = "present",
$source = '',
$content = undef
) {
@@ -42,7 +40,6 @@ define postfix::header_checks_snippet (
$fragment = "postfix_header_checks_${name}"
concat::fragment { "$fragment":
- ensure => "$ensure",
target => '/etc/postfix/header_checks',
}
diff --git a/manifests/tlspolicy_snippet.pp b/manifests/tlspolicy_snippet.pp
index b63f812..77fc457 100644
--- a/manifests/tlspolicy_snippet.pp
+++ b/manifests/tlspolicy_snippet.pp
@@ -7,7 +7,6 @@ See the postfix::tlspolicy class for details.
Parameters:
- *name*: name of destination domain Postfix will lookup. See TLS_README.
- *value*: right-hand part of the tls_policy map
-- *ensure*: present/absent, defaults to present.
Requires:
- Class["postfix"]
@@ -28,16 +27,15 @@ Example usage:
*/
-define postfix::tlspolicy_snippet ($ensure="present", $value = false) {
+define postfix::tlspolicy_snippet ($value = false) {
- if ($value == false) and ($ensure == "present") {
- fail("The value parameter must be set when using the postfix::tlspolicy_snippet define with ensure=present.")
+ if $value == false {
+ fail("The value parameter must be set when using the postfix::tlspolicy_snippet define.")
}
include postfix::tlspolicy
concat::fragment { "postfix_tlspolicy_${name}":
- ensure => "$ensure",
content => "${name} ${value}\n",
target => "$postfix::tlspolicy::postfix_merged_tlspolicy",
}
diff --git a/manifests/transport_regexp_snippet.pp b/manifests/transport_regexp_snippet.pp
index 2b13ed1..9d37f2b 100644
--- a/manifests/transport_regexp_snippet.pp
+++ b/manifests/transport_regexp_snippet.pp
@@ -6,7 +6,6 @@ See the postfix::transport_regexp class for details.
Parameters:
- *source* or *content*: source or content of the transport_regexp snippet
-- *ensure*: present (default) or absent
Requires:
- Class["postfix"]
@@ -24,7 +23,6 @@ Example usage:
*/
define postfix::transport_regexp_snippet (
- $ensure = "present",
$source = '',
$content = undef
) {
@@ -37,8 +35,8 @@ define postfix::transport_regexp_snippet (
fail("Only one of \$source or \$content must specified for postfix::transport_regexp_snippet ${name}")
}
- if ($value == false) and ($ensure == "present") {
- fail("The value parameter must be set when using the postfix::transport_regexp_snippet define with ensure=present.")
+ if $value == false {
+ fail("The value parameter must be set when using the postfix::transport_regexp_snippet define.")
}
include postfix::transport_regexp
@@ -46,7 +44,6 @@ define postfix::transport_regexp_snippet (
$snippetfile = "${postfix::transport_regexp::postfix_transport_regexp_snippets_dir}/${name}"
file { "$snippetfile":
- ensure => "$ensure",
mode => 600,
owner => root,
group => 0,
diff --git a/manifests/virtual_regexp_snippet.pp b/manifests/virtual_regexp_snippet.pp
index bd9a982..e6202df 100644
--- a/manifests/virtual_regexp_snippet.pp
+++ b/manifests/virtual_regexp_snippet.pp
@@ -6,7 +6,6 @@ See the postfix::virtual_regexp class for details.
Parameters:
- *source* or *content*: source or content of the virtual_regexp snippet
-- *ensure*: present (default) or absent
Requires:
- Class["postfix"]
@@ -24,7 +23,6 @@ Example usage:
*/
define postfix::virtual_regexp_snippet (
- $ensure = "present",
$source = '',
$content = undef
) {
@@ -37,8 +35,8 @@ define postfix::virtual_regexp_snippet (
fail("Only one of \$source or \$content must specified for postfix::virtual_regexp_snippet ${name}")
}
- if ($value == false) and ($ensure == "present") {
- fail("The value parameter must be set when using the postfix::virtual_regexp_snippet define with ensure=present.")
+ if $value == false {
+ fail("The value parameter must be set when using the postfix::virtual_regexp_snippet define.")
}
include postfix::virtual_regexp
@@ -46,7 +44,6 @@ define postfix::virtual_regexp_snippet (
$snippetfile = "${postfix::virtual_regexp::postfix_virtual_regexp_snippets_dir}/${name}"
file { "$snippetfile":
- ensure => "$ensure",
mode => 600,
owner => root,
group => 0,
diff --git a/templates/master.cf.debian-9.erb b/templates/master.cf.debian-9.erb
index 397c089..e96f657 100644
--- a/templates/master.cf.debian-9.erb
+++ b/templates/master.cf.debian-9.erb
@@ -148,7 +148,7 @@ amavis unix - - - - 2 smtp
<% end %>
<% if @use_dovecot_lda == 'yes' %>
dovecot unix - n n - - pipe
- flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -n -m ${extension}
+ flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop} -m ${extension} -a "${recipient}"
<% end %>
<% if @use_schleuder == 'yes' %>
schleuder unix - n n - - pipe