From 35e813d00dc4896b9b952a83aee01229299bfb61 Mon Sep 17 00:00:00 2001 From: Giovanni Date: Wed, 19 Jun 2024 09:07:20 +0200 Subject: [PATCH] SPF explanation text is restricted to 7-bit ascii --- lib/Mail/SPF/Result.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Mail/SPF/Result.pm b/lib/Mail/SPF/Result.pm index f247943..cbc660c 100644 --- a/lib/Mail/SPF/Result.pm +++ b/lib/Mail/SPF/Result.pm @@ -552,6 +552,10 @@ sub authority_explanation { try { # ... then try to expand it: $authority_explanation = $authority_explanation_macrostring->expand; + # SPF explanation text is restricted to 7-bit ascii + if(defined $authority_explanation and utf8::is_utf8($authority_explanation)) { + $authority_explanation = $server->default_authority_explanation->new(request => $request)->expand; + } } catch Mail::SPF::EInvalidMacroString with {}; # Ignore expansion errors and leave authority explanation undefined.