[packages/exim-surbl] Release 3. Add nameservers_rotate option.
arekm
arekm at pld-linux.org
Mon Aug 24 14:40:33 CEST 2026
commit ccc63fbd0ee4466f8fee92916fd5abbf42c70f35
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Mon Aug 24 14:39:40 2026 +0200
Release 3. Add nameservers_rotate option.
Net::DNS queries the list in order and ignores resolv.conf "options rotate";
rotating spreads load but costs cache hits, so it defaults to off.
exim-surbl.spec | 2 +-
ip-meaning.patch | 10 +++++-----
public_resolvers.patch | 32 +++++++++++++++++++++-----------
3 files changed, 27 insertions(+), 17 deletions(-)
---
diff --git a/exim-surbl.spec b/exim-surbl.spec
index 3cd99ca..0845eef 100644
--- a/exim-surbl.spec
+++ b/exim-surbl.spec
@@ -1,7 +1,7 @@
Summary: Blocking Spam in Exim with URI Block Lists
Name: exim-surbl
Version: 2.4
-Release: 2
+Release: 3
License: GPL
Group: Networking/Daemons/SMTP
Source0: https://www.teuton.org/~ejm/exim_surbl/exim_surbl-%{version}.tar.gz
diff --git a/ip-meaning.patch b/ip-meaning.patch
index 3fcc321..d164963 100644
--- a/ip-meaning.patch
+++ b/ip-meaning.patch
@@ -4,9 +4,9 @@ DBL uses codes outside its 127.0.1.0/24 listing range. Answers outside a
list's own range are ignored too, so a resolver that rewrites NXDOMAIN
cannot turn every URL into a reject.
diff -urN exim_surbl-2.4.orig/exim_surbl.pl exim_surbl-2.4/exim_surbl.pl
---- exim_surbl-2.4.orig/exim_surbl.pl 2026-08-24 13:38:35.801903706 +0200
-+++ exim_surbl-2.4/exim_surbl.pl 2026-08-24 13:40:28.887554293 +0200
-@@ -123,8 +123,16 @@
+--- exim_surbl-2.4.orig/exim_surbl.pl 2026-08-24 14:36:27.600945519 +0200
++++ exim_surbl-2.4/exim_surbl.pl 2026-08-24 14:36:27.677916935 +0200
+@@ -130,8 +130,16 @@
# If gethostbyname() returned anything, build a return message.
$return_string = "";
if (scalar(@dnsbladdr) != 0) {
@@ -24,7 +24,7 @@ diff -urN exim_surbl-2.4.orig/exim_surbl.pl exim_surbl-2.4/exim_surbl.pl
if ($surblipaddr[3] & 128) {
$return_string .= " [CR]";
}
-@@ -151,8 +159,16 @@
+@@ -158,8 +166,16 @@
# If gethostbyname() returned anything, build a return message.
$return_string = "";
if (scalar(@dnsbladdr) != 0) {
@@ -42,7 +42,7 @@ diff -urN exim_surbl-2.4.orig/exim_surbl.pl exim_surbl-2.4/exim_surbl.pl
if ($ipaddr[3] & 8) {
$return_string .= " [red]";
}
-@@ -176,6 +192,12 @@
+@@ -183,6 +199,12 @@
# If gethostbyname() returned anything, build a return message.
$return_string = "";
if (scalar(@dnsbladdr) != 0) {
diff --git a/public_resolvers.patch b/public_resolvers.patch
index cbc3a12..5eaaced 100644
--- a/public_resolvers.patch
+++ b/public_resolvers.patch
@@ -4,9 +4,9 @@ URIBL and Spamhaus refuse queries arriving via public resolvers.
getips() returns a plain address list, not gethostbyname()'s 5-element list,
so the answer index in both callers becomes [0].
diff -urN exim_surbl-2.4.orig/config.ini exim_surbl-2.4/config.ini
---- exim_surbl-2.4.orig/config.ini 2026-08-24 13:38:11.826574679 +0200
-+++ exim_surbl-2.4/config.ini 2026-08-24 13:52:55.571807814 +0200
-@@ -3,3 +3,8 @@
+--- exim_surbl-2.4.orig/config.ini 2026-08-24 14:36:16.013648814 +0200
++++ exim_surbl-2.4/config.ini 2026-08-24 14:36:27.600552463 +0200
+@@ -3,3 +3,11 @@
surbl_enable = 1
uribl_enable = 1
dbl_enable = 1
@@ -15,10 +15,13 @@ diff -urN exim_surbl-2.4.orig/config.ini exim_surbl-2.4/config.ini
+# arriving via public resolvers (8.8.8.8, 1.1.1.1), so prefer a local one.
+# nameservers = 127.0.0.1, 192.0.2.53
+nameservers =
++# Net::DNS queries the list in order, which keeps one resolver's cache warm.
++# Set to 1 to round-robin instead, spreading load at the cost of cache hits.
++nameservers_rotate = 0
diff -urN exim_surbl-2.4.orig/exim_surbl.pl exim_surbl-2.4/exim_surbl.pl
---- exim_surbl-2.4.orig/exim_surbl.pl 2026-08-24 13:38:11.827113210 +0200
-+++ exim_surbl-2.4/exim_surbl.pl 2026-08-24 13:45:42.996272097 +0200
-@@ -21,6 +21,27 @@
+--- exim_surbl-2.4.orig/exim_surbl.pl 2026-08-24 14:36:16.014123350 +0200
++++ exim_surbl-2.4/exim_surbl.pl 2026-08-24 14:36:27.600945519 +0200
+@@ -21,6 +21,33 @@
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
use Config::IniFiles;
@@ -29,8 +32,14 @@ diff -urN exim_surbl-2.4.orig/exim_surbl.pl exim_surbl-2.4/exim_surbl.pl
+{
+ my @params = @_;
+ my @addresses;
++ my @ns = @nameservers;
++ if ($nameservers_rotate && scalar(@ns) > 1) {
++ # Round-robin like resolv.conf "options rotate", which Net::DNS ignores.
++ $nsindex = ($nsindex + 1) % scalar(@ns);
++ push @ns, splice(@ns, 0, $nsindex);
++ }
+ my $res = Net::DNS::Resolver->new(
-+ @nameservers ? (nameservers => \@nameservers) : ()
++ @ns ? (nameservers => \@ns) : ()
+ );
+ my $reply = $res->search($params[0], 'A');
+ if ($reply) {
@@ -46,17 +55,18 @@ diff -urN exim_surbl-2.4.orig/exim_surbl.pl exim_surbl-2.4/exim_surbl.pl
sub surblspamcheck
{
-@@ -67,6 +88,9 @@
+@@ -67,6 +94,10 @@
my $surbl_enable = $cfg->val('config', 'surbl_enable', 1);
my $uribl_enable = $cfg->val('config', 'uribl_enable', 0);
my $dbl_enable = $cfg->val('config', 'dbl_enable', 1);
+
+ # Package global: getips() is defined outside this sub and reads it there.
+ @nameservers = grep { length } split(/[,\s]+/, $cfg->val('config', 'nameservers', ''));
++ $nameservers_rotate = $cfg->val('config', 'nameservers_rotate', 0);
# Check to see if a decode MIME attachment is being checked or
# just a plain old text message with no attachments
-@@ -95,12 +119,12 @@
+@@ -95,12 +126,12 @@
# the return message for the SURBL lookup.
my @params = @_;
my $surbldomain = ".multi.surbl.org";
@@ -71,7 +81,7 @@ diff -urN exim_surbl-2.4.orig/exim_surbl.pl exim_surbl-2.4/exim_surbl.pl
if ($surblipaddr[3] & 128) {
$return_string .= " [CR]";
}
-@@ -123,12 +147,12 @@
+@@ -123,12 +154,12 @@
# the return message for the URIBL check.
my @params = @_;
my $uribldomain = ".black.uribl.com";
@@ -86,7 +96,7 @@ diff -urN exim_surbl-2.4.orig/exim_surbl.pl exim_surbl-2.4/exim_surbl.pl
if ($ipaddr[3] & 8) {
$return_string .= " [red]";
}
-@@ -148,7 +172,7 @@
+@@ -148,7 +179,7 @@
# the return message for the Spamhaus DBL check.
my @params = @_;
my $dbldomain = ".dbl.spamhaus.org";
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/exim-surbl.git/commitdiff/ccc63fbd0ee4466f8fee92916fd5abbf42c70f35
More information about the pld-cvs-commit
mailing list