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

Friedrich Weber f.weber at proxmox.com
Tue Jun 27 11:15:56 CEST 2023


Tested-by: Friedrich Weber <f.weber at proxmox.com>

Tested by manually patching my PMG 7.3.
Without this patch, the PMG system report contains:

# resolve www.proxmox.com
NXDOMAIN

With this patch applied, it contains:

# resolve www.proxmox.com
www.proxmox.com. 74817 IN A 212.224.123.69

On 27/06/2023 11:00, Stoiko Ivanov wrote:
> 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];




More information about the pmg-devel mailing list