]> git.proxmox.com Git - pmg-api.git/commitdiff
report: adapt to changes in SpamAssassin DNS api
authorStoiko Ivanov <s.ivanov@proxmox.com>
Tue, 27 Jun 2023 09:00:27 +0000 (11:00 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 27 Jun 2023 09:22:39 +0000 (11:22 +0200)
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@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
src/PMG/Report.pm

index aeda802958099a2bea89ceeb7cd3902061a106c7..027c882f88ef7be2184f94100ee68ba412cb8dc5 100644 (file)
@@ -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];