[pmg-devel] [PATCH pmg-api] Add postfix dnsbl threshold

Alexander Plank alexander.plank at siconnex.com
Thu Jun 21 09:33:23 CEST 2018


Signed-off-by: Alexander Plank <alexander.plank at siconnex.com>
---
 PMG/Config.pm        | 9 +++++++++
 templates/main.cf.in | 1 +
 2 files changed, 10 insertions(+)

diff --git a/PMG/Config.pm b/PMG/Config.pm
index b42cfee..107cea5 100755
--- a/PMG/Config.pm
+++ b/PMG/Config.pm
@@ -585,6 +585,12 @@ sub properties {
 	    description => "Optional list of DNS white/blacklist domains (see postscreen_dnsbl_sites parameter).",
 	    type => 'string', format => 'dnsbl-entry-list',
 	},
+	dnsbl_threshold => {
+	    description => "The inclusive lower bound for blocking a remote SMTP client, based on its combined DNSBL score (see postscreen_dnsbl_threshold parameter).",
+	    type => 'integer',
+	    minimum => 0,
+	    default => 1
+	},
     };
 }
 
@@ -617,6 +623,7 @@ sub options {
 	message_rate_limit => { optional => 1 },
 	verifyreceivers => { optional => 1 },
 	dnsbl_sites => { optional => 1 },
+	dnsbl_threshold => { optional => 1 },
     };
 }
 
@@ -1104,6 +1111,8 @@ sub get_template_vars {
 	$vars->{postfix}->{dnsbl_sites} = join(',', @dnsbl_sites);
     }
 
+    $vars->{postfix}->{dnsbl_threshold} = $self->get('mail', 'dnsbl_threshold');
+
     my $usepolicy = 0;
     $usepolicy = 1 if $self->get('mail', 'greylist') ||
 	$self->get('mail', 'spf');
diff --git a/templates/main.cf.in b/templates/main.cf.in
index 1eac9a5..5486d5a 100644
--- a/templates/main.cf.in
+++ b/templates/main.cf.in
@@ -62,6 +62,7 @@ postscreen_access_list =
 
 [% IF postfix.dnsbl_sites %]
 postscreen_dnsbl_sites = [% postfix.dnsbl_sites %]
+postscreen_dnsbl_threshold = [% postfix.dnsbl_threshold %]
 [% END %]
 
 postscreen_dnsbl_action = enforce
-- 
2.17.1.windows.2




More information about the pmg-devel mailing list