Mailing List Archive

SA 4.0.1 - DMARC plugin
Hello,

after updating SA 4.0.0 to 4.0.1, (CentOS 7 - Perl version 5.16.3) I get
the following message in log regarding the DMARC plugin:

plugin: eval failed: Can't use an undefined value as an ARRAY reference at
/usr/share/perl5/Mail/SpamAssassin/Plugin/DMARC.pm line 336.

File "DMARC.pm":

my $dmarc_arc_verified = 0;
if (($result->result ne 'pass') and (ref($pms->{arc_verifier}) and
($pms->{arc_verifier}->result))) {
undef $result;
$dmarc_arc_verified = 1;
# if DMARC fails retry by reading data from AAR headers
# use Mail::SpamAssassin::Plugin::AuthRes if available to read ARC
signature details
* my @spf_parsed = sort { ( $a->{authres_parsed}{spf}{arc_index} // 0 )
<=> ( $b->{authres_parsed}{spf}{arc_index} // 0 ) }
@{$pms->{authres_parsed}{spf}};*
my $old_arc_index = 0;

Any ideas how to solve it ?

Regards,
Mateusz
Re: SA 4.0.1 - DMARC plugin [ In reply to ]
I've open a bug in which I noted my suspicion of what is happening.

https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8245

If you have a sanitized email that consistently causes this to happen,
please attach it to the bug report.

As I said in the bug report, I suspect that an email that does not pass
a DMARC chack, has one or more Authentication-Results headers, and none
of them have an spf= field, would result in this error.

Sidney


Mateusz Krawczyk wrote on 20/04/24 1:07 am:
> Hello,
>
> after updating SA 4.0.0 to 4.0.1, (CentOS 7 - Perl version 5.16.3) I get
> the following message in log regarding the DMARC plugin:
>
> plugin: eval failed: Can't use an undefined value as an ARRAY reference
> at /usr/share/perl5/Mail/SpamAssassin/Plugin/DMARC.pm line 336.
>
> File "DMARC.pm":
>
> my $dmarc_arc_verified = 0;
>   if (($result->result ne 'pass') and (ref($pms->{arc_verifier}) and
> ($pms->{arc_verifier}->result))) {
>     undef $result;
>     $dmarc_arc_verified = 1;
>     # if DMARC fails retry by reading data from AAR headers
>     # use Mail::SpamAssassin::Plugin::AuthRes if available to read ARC
> signature details
> _    my @spf_parsed = sort { ( $a->{authres_parsed}{spf}{arc_index} // 0
> ) <=> ( $b->{authres_parsed}{spf}{arc_index} // 0 ) }
> @{$pms->{authres_parsed}{spf}};_
>     my $old_arc_index = 0;
>
> Any ideas how to solve it ?
>
> Regards,
> Mateusz
Re: SA 4.0.1 - DMARC plugin [ In reply to ]
As a practical matter, the message appears to be a warning in the log,
but the results would be correct, so it can be ignored.

Sidney Markowitz wrote on 20/04/24 9:55 am:
> I've open a bug in which I noted my suspicion of what is happening.
>
> https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8245
>
> If you have a sanitized email that consistently causes this to happen,
> please attach it to the bug report.
>
> As I said in the bug report, I suspect that an email that does not pass
> a DMARC chack, has one or more Authentication-Results headers, and none
> of them have an spf= field, would result in this error.
>
> Sidney
>
>
> Mateusz Krawczyk wrote on 20/04/24 1:07 am:
>> Hello,
>>
>> after updating SA 4.0.0 to 4.0.1, (CentOS 7 - Perl version 5.16.3) I get
>> the following message in log regarding the DMARC plugin:
>>
>> plugin: eval failed: Can't use an undefined value as an ARRAY reference
>> at /usr/share/perl5/Mail/SpamAssassin/Plugin/DMARC.pm line 336.
>>
>> File "DMARC.pm":
>>
>> my $dmarc_arc_verified = 0;
>>   if (($result->result ne 'pass') and (ref($pms->{arc_verifier}) and
>> ($pms->{arc_verifier}->result))) {
>>     undef $result;
>>     $dmarc_arc_verified = 1;
>>     # if DMARC fails retry by reading data from AAR headers
>>     # use Mail::SpamAssassin::Plugin::AuthRes if available to read ARC
>> signature details
>> _    my @spf_parsed = sort { ( $a->{authres_parsed}{spf}{arc_index} // 0
>> ) <=> ( $b->{authres_parsed}{spf}{arc_index} // 0 ) }
>> @{$pms->{authres_parsed}{spf}};_
>>     my $old_arc_index = 0;
>>
>> Any ideas how to solve it ?
>>
>> Regards,
>> Mateusz
>
Re: SA 4.0.1 - DMARC plugin [ In reply to ]
I was wrong about the severity. It does look like the error aborts the
running of the DMARC plugin when it happens, so no DMARC result will be
scored for that email.

I've committed a fix to trunk.

This bug only happens in perl versions less than 5.20.0. I see that this
case was in CentOS 7 which installs perl 5.16. Upgrading to a more
recent perl will make the problem go away, or updating SpamAssassin from
trunk, or for a minimal change, apply the patch that I committed to
close the bug at
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8245

Sidney

Sidney Markowitz wrote on 20/04/24 2:39 pm:
> As a practical matter, the message appears to be a warning in the log,
> but the results would be correct, so it can be ignored.
>
> Sidney Markowitz wrote on 20/04/24 9:55 am:
>> I've open a bug in which I noted my suspicion of what is happening.
>>
>> https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8245
>>
>> If you have a sanitized email that consistently causes this to happen,
>> please attach it to the bug report.
>>
>> As I said in the bug report, I suspect that an email that does not pass
>> a DMARC chack, has one or more Authentication-Results headers, and none
>> of them have an spf= field, would result in this error.
>>
>> Sidney
>>
>>
>> Mateusz Krawczyk wrote on 20/04/24 1:07 am:
>>> Hello,
>>>
>>> after updating SA 4.0.0 to 4.0.1, (CentOS 7 - Perl version 5.16.3) I get
>>> the following message in log regarding the DMARC plugin:
>>>
>>> plugin: eval failed: Can't use an undefined value as an ARRAY reference
>>> at /usr/share/perl5/Mail/SpamAssassin/Plugin/DMARC.pm line 336.
>>>
>>> File "DMARC.pm":
>>>
>>> my $dmarc_arc_verified = 0;
>>>   if (($result->result ne 'pass') and (ref($pms->{arc_verifier}) and
>>> ($pms->{arc_verifier}->result))) {
>>>     undef $result;
>>>     $dmarc_arc_verified = 1;
>>>     # if DMARC fails retry by reading data from AAR headers
>>>     # use Mail::SpamAssassin::Plugin::AuthRes if available to read ARC
>>> signature details
>>> _    my @spf_parsed = sort { ( $a->{authres_parsed}{spf}{arc_index} // 0
>>> ) <=> ( $b->{authres_parsed}{spf}{arc_index} // 0 ) }
>>> @{$pms->{authres_parsed}{spf}};_
>>>     my $old_arc_index = 0;
>>>
>>> Any ideas how to solve it ?
>>>
>>> Regards,
>>> Mateusz
>>
>