SA Bugzilla – Bug 60
check_for_faraway_charset_in_headers() does nothing because get() un-mime header requested
Last modified: 2002-06-15 03:58:08 UTC
check_for_faraway_charset_in_headers() can't test for charset requested because ?CHARSET?Q? prefix stripped down by get() function (see $_ = $self->mime_decode_header ($_); call there). Use patch below to fix it. --- lib/Mail/SpamAssassin/EvalTests.pm.bak Fri Jan 25 07:36:02 2002 +++ lib/Mail/SpamAssassin/EvalTests.pm Tue Feb 26 19:17:43 2002 @@ -688,10 +688,17 @@ sub check_for_faraway_charset_in_headers { my ($self) = @_; + my $hdr; my @locales = $self->get_my_locales(); for my $h (qw(From Subject)) { - my $hdr = $self->get($h); +# Can't use just get() because it un-mime header + my @hdrs = $self->{msg}->get_header ($h); + if ($#hdrs >= 0) { + $hdr = join (" ", @hdrs); + } else { + $hdr = ''; + } while ($hdr =~ /=\?(.+?)\?.\?.*?\?=/g) { Mail::SpamAssassin::Locales::is_charset_ok_for_locales($1, @locales) or return 1;
I found that this bug still present in 2.11, see my patch
About to commit to CVS -- thanks for patches