On 3/3/25 8:22 PM, Andreas Vögele wrote:
Andreas Vögele writes:
Giovanni Bechis writes:
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8319
[...]
Fixed in a different way on r1924149.
I'm not sure whether your solution works with older Mail::DMARC versions, which are 
currently shipped by most Linux distributions. Mail::DMARC 1.20250203, which sets 
$result->result to 'none' if there is no policy, was only released last month. In all 
previous versions, $result->result defaults to 'fail' and the policy may be undefined. 
If there is no policy, $result->published will croak in both new and old versions. 
That's why I suggested to wrap $result->published with eval.
The test failure is back. You cannot check with "defined $result->published" whether a 
policy is set or not. "published" is a method that throws an exception if no policy has been 
set. See 
https://github.com/msimerson/mail-dmarc/blob/df107c6784b19b7fcd3a2407fe61a2ca9db1f3ad/lib/Mail/DMARC/Result.pm#L19.
 Checking $result->result for 'none' isn't useful either unless you depend on Mail::DMARC 1.20250203. 
The patch that I had attached to https://bz.apache.org/SpamAssassin/show_bug.cgi?id=8319 works with all 
Mail::DMARC versions.

I reverted last commit, atm tests passes with new and old Mail::DMARC versions.
The approach using 'eval' is hiding possible issues because it doesn't catch 
any errors.
If you have an saample email that breaks with current code, please send it to 
me.
 Thanks
  Giovanni

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to