[pmg-devel] [PATCH pmg-api] Fix #2224: override reference to openspf.org

Fabian Grünbichler f.gruenbichler at proxmox.com
Mon Sep 2 11:26:38 CEST 2019


On August 29, 2019 5:39 pm, Stoiko Ivanov wrote:
> This is a fix for a small cosmetic issue, which keeps coming up on our various
> support-channels:
> pmgpolicy as user of 'Mail::SPF::Server' logs lines referencing the (now
> defunct) url: http://www.openspf.org/Why
> 
> By overriding 'default_authority_explanation' [0] the logs now simply contain:
> 'Rejected by SPF record'.

doesn't this lose information compared to the built-in default, which is

'Please see http://www.openspf.org/Why?s=%{_scope};id=%{S};ip=%{C};r=%{R}'

note the macros..

> 
> Given that we are (by far) not the only users of this module I additionally
> opened an issue upstream [1] (and linked it to the debian bug-report [2]).
> 
> Tested by providing a SPF policy not allowing the ip of the sender in my
> testsetup and observing the logs.
> 
> [0] https://metacpan.org/pod/Mail::SPF::Server
> [1] https://rt.cpan.org/Public/Bug/Display.html?id=130413
> [2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=930032
> 
> Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
> ---
>  src/bin/pmgpolicy | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/bin/pmgpolicy b/src/bin/pmgpolicy
> index 59d28f7..836fa9d 100755
> --- a/src/bin/pmgpolicy
> +++ b/src/bin/pmgpolicy
> @@ -377,7 +377,8 @@ sub child_init_hook {
>  	$self->{dns_resolver} = Net::DNS::Resolver->new(%dnsargs);
>  
>  	$self->{spf_server} = Mail::SPF::Server->new(
> -	    hostname => $self->{fqdn}, dns_resolver => $self->{dns_resolver});
> +	    hostname => $self->{fqdn}, dns_resolver => $self->{dns_resolver},
> +	    default_authority_explanation => 'Rejected by SPF record');
>      };
>      if (my $err = $@) {
>  	$self->log(0, $err);
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> pmg-devel mailing list
> pmg-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel
> 
> 



More information about the pmg-devel mailing list