Bug 60 - check_for_faraway_charset_in_headers() does nothing because get() un-mime header requested
Summary: check_for_faraway_charset_in_headers() does nothing because get() un-mime hea...
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Libraries (show other bugs)
Version: 2.30CVS
Hardware: PC FreeBSD
: P2 major
Target Milestone: ---
Assignee: Craig Hughes
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-02-26 08:29 UTC by Andrey A. Chernov
Modified: 2002-06-15 03:58 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey A. Chernov 2002-02-26 08:29:04 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;
Comment 1 Andrey A. Chernov 2002-03-04 02:06:32 UTC
I found that this bug still present in 2.11, see my patch
Comment 2 Craig Hughes 2002-03-04 09:35:20 UTC
About to commit to CVS -- thanks for patches