public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pmg-devel] [PATCH pmg-api] report: adapt to changes in SpamAssassin dns api
@ 2023-06-27  9:00 Stoiko Ivanov
  2023-06-27  9:15 ` Friedrich Weber
  2023-06-27  9:23 ` [pmg-devel] applied: " Thomas Lamprecht
  0 siblings, 2 replies; 4+ messages in thread
From: Stoiko Ivanov @ 2023-06-27  9:00 UTC (permalink / raw)
  To: pmg-devel

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 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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pmg-devel] [PATCH pmg-api] report: adapt to changes in SpamAssassin dns api
  2023-06-27  9:00 [pmg-devel] [PATCH pmg-api] report: adapt to changes in SpamAssassin dns api Stoiko Ivanov
@ 2023-06-27  9:15 ` Friedrich Weber
  2023-06-27  9:23 ` [pmg-devel] applied: " Thomas Lamprecht
  1 sibling, 0 replies; 4+ messages in thread
From: Friedrich Weber @ 2023-06-27  9:15 UTC (permalink / raw)
  To: Stoiko Ivanov, pmg-devel

Tested-by: Friedrich Weber <f.weber@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@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];




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pmg-devel] applied: [PATCH pmg-api] report: adapt to changes in SpamAssassin dns api
  2023-06-27  9:00 [pmg-devel] [PATCH pmg-api] report: adapt to changes in SpamAssassin dns api Stoiko Ivanov
  2023-06-27  9:15 ` Friedrich Weber
@ 2023-06-27  9:23 ` Thomas Lamprecht
  2023-07-07 16:57   ` Stoiko Ivanov
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Lamprecht @ 2023-06-27  9:23 UTC (permalink / raw)
  To: Stoiko Ivanov, pmg-devel

Am 27/06/2023 um 11:00 schrieb Stoiko Ivanov:
> 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 on my pmg installation - a quick verification that it works
> indeed would be appreciated
> 
>  src/PMG/Report.pm | 1 +
>  1 file changed, 1 insertion(+)
> 
>

applied, with Friedrich's T-b, thanks!

should this get also backported to stable-7 branch? as SA 4.0 is available
there too.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pmg-devel] applied: [PATCH pmg-api] report: adapt to changes in SpamAssassin dns api
  2023-06-27  9:23 ` [pmg-devel] applied: " Thomas Lamprecht
@ 2023-07-07 16:57   ` Stoiko Ivanov
  0 siblings, 0 replies; 4+ messages in thread
From: Stoiko Ivanov @ 2023-07-07 16:57 UTC (permalink / raw)
  To: Thomas Lamprecht; +Cc: pmg-devel

On Tue, 27 Jun 2023 11:23:58 +0200
Thomas Lamprecht <t.lamprecht@proxmox.com> wrote:

> Am 27/06/2023 um 11:00 schrieb Stoiko Ivanov:
> > 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 on my pmg installation - a quick verification that it works
> > indeed would be appreciated
> > 
> >  src/PMG/Report.pm | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> >  
> 
> applied, with Friedrich's T-b, thanks!
> 
> should this get also backported to stable-7 branch? as SA 4.0 is available
> there too.

Sorry for overlooking the question (and underlying issue) - yes it should.
I pushed the changes to stable-7 - thanks!




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-07 16:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-27  9:00 [pmg-devel] [PATCH pmg-api] report: adapt to changes in SpamAssassin dns api Stoiko Ivanov
2023-06-27  9:15 ` Friedrich Weber
2023-06-27  9:23 ` [pmg-devel] applied: " Thomas Lamprecht
2023-07-07 16:57   ` Stoiko Ivanov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal