[pmg-devel] [PATCH pmg-api] report: adapt to changes in SpamAssassin dns api

Stoiko Ivanov s.ivanov at proxmox.com
Tue Jun 27 11:00:27 CEST 2023


SpamAssassin 4.0 changed the way it does DNS-lookups a bit (switched
to asynchronous lookups) - this broke pmg-system-report, since
we use the SpamAssassin API to check that DNS-resolution works.
The reason for this is that SA used to take only the first entry from
/etc/resolv.conf - and SA being able to do correct resolution is
critical for it to work.

This patch fixes the incompatible use of the DNS-API, but does not
change to the asynchronous model.

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
tested on my pmg installation - a quick verification that it works
indeed would be appreciated

 src/PMG/Report.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/PMG/Report.pm b/src/PMG/Report.pm
index aeda802..027c882 100644
--- a/src/PMG/Report.pm
+++ b/src/PMG/Report.pm
@@ -125,6 +125,7 @@ sub check_dns_resolution {
 	stop_at_threshold => 0,
     });
     $sa->init();
+    $sa->{resolver}->load_resolver();
 
     my $packet = $sa->{resolver}->send('www.proxmox.com');
     my $answer = $packet->{answer}->[0];
-- 
2.30.2





More information about the pmg-devel mailing list