You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@spamassassin.apache.org on 2019/06/19 11:36:06 UTC
[Bug 7724] New: [review] MIMEEval state not checked properly
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7724
Bug ID: 7724
Summary: [review] MIMEEval state not checked properly
Product: Spamassassin
Version: 3.4.2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P2
Component: Plugins
Assignee: dev@spamassassin.apache.org
Reporter: hege@hege.li
Target Milestone: Undefined
Trivial patch, RTC vote for 3.4.3 (+1 from me)
$pms->{mime_checked_attachments} should always be checked to run
_check_attachments, not some random variable someone might forget to add or
remove from internals.
--- MIMEEval.pm (revision 1861575)
+++ MIMEEval.pm (working copy)
@@ -117,7 +117,8 @@
sub check_for_ascii_text_illegal {
my ($self, $pms) = @_;
- $self->_check_attachments($pms) unless exists
$pms->{mime_ascii_text_illegal};
+ $self->_check_attachments($pms) unless exists
$pms->{mime_checked_attachments};
+ return 0 unless exists $pms->{mime_ascii_text_illegal};
return ($pms->{mime_ascii_text_illegal} > 0);
}
@@ -143,7 +144,8 @@
# validate ratio?
return 0 unless ($ratio =~ /^\d{0,3}\.\d{1,3}$/);
- $self->_check_attachments($pms) unless exists
$pms->{mime_text_unicode_ratio};
+ $self->_check_attachments($pms) unless exists
$pms->{mime_checked_attachments};
+ return 0 unless exists $pms->{mime_text_unicode_ratio};
return ($pms->{mime_text_unicode_ratio} >= $ratio);
}
@@ -178,7 +180,8 @@
sub check_for_mime {
my ($self, $pms, undef, $test) = @_;
- $self->_check_attachments($pms) unless exists $pms->{$test};
+ $self->_check_attachments($pms) unless exists
$pms->{mime_checked_attachments};
+ return 0 unless exists $pms->{$test};
return $pms->{$test};
}
@@ -189,7 +192,8 @@
my $ctype = $pms->get('Content-Type');
return 1 if $ctype =~ m{^text/html}i;
- $self->_check_attachments($pms) unless exists $pms->{mime_body_html_count};
+ $self->_check_attachments($pms) unless exists
$pms->{mime_checked_attachments};
+ return 0 unless exists $pms->{mime_body_html_count};
return ($pms->{mime_body_html_count} > 0);
}
@@ -200,7 +204,9 @@
my $ctype = $pms->get('Content-Type');
return 1 if $ctype =~ m{^text/html}i;
- $self->_check_attachments($pms) unless exists $pms->{mime_body_html_count};
+ $self->_check_attachments($pms) unless exists
$pms->{mime_checked_attachments};
+ return 0 unless exists $pms->{mime_body_html_count};
+ return 0 unless exists $pms->{mime_body_text_count};
return ($pms->{mime_body_html_count} > 0 &&
$pms->{mime_body_text_count} == 0);
}
@@ -208,8 +214,8 @@
sub check_mime_multipart_ratio {
my ($self, $pms, undef, $min, $max) = @_;
- $self->_check_attachments($pms) unless exists
$pms->{mime_multipart_alternative};
-
+ $self->_check_attachments($pms) unless exists
$pms->{mime_checked_attachments};
+ return 0 unless exists $pms->{mime_multipart_ratio};
return ($pms->{mime_multipart_ratio} >= $min &&
$pms->{mime_multipart_ratio} < $max);
}
@@ -517,6 +523,7 @@
my ($self, $pms, undef, $min) = @_;
$self->_check_attachments($pms) unless exists
$pms->{mime_checked_attachments};
+ return 0 unless exists $pms->{mime_qp_ratio};
my $qp_ratio = $pms->{mime_qp_ratio};
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 7724] [review] MIMEEval state not checked properly
Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7724
Henrik Krohns <he...@hege.li> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|Undefined |3.4.3
CC| |hege@hege.li
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 7724] [review] MIMEEval state not checked properly
Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7724
--- Comment #1 from Henrik Krohns <he...@hege.li> ---
This is why I removed MIME_BASE64_BLANKS in Revision 1861614. Someone commented
it from code but didn't remove the actual rule. It resulted in running
_check_attachments multiple times (possibly messing up some counts?).
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 7724] [review] MIMEEval state not checked properly
Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7724
Bill Cole <bi...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |billcole@apache.org
--- Comment #2 from Bill Cole <bi...@apache.org> ---
+1
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 7724] [review] MIMEEval state not checked properly
Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7724
Giovanni Bechis <gi...@paclan.it> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |giovanni@paclan.it
--- Comment #3 from Giovanni Bechis <gi...@paclan.it> ---
+1
--
You are receiving this mail because:
You are the assignee for the bug.
[Bug 7724] [review] MIMEEval state not checked properly
Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7724
Henrik Krohns <he...@hege.li> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--- Comment #4 from Henrik Krohns <he...@hege.li> ---
Sending spamassassin-3.4/lib/Mail/SpamAssassin/Plugin/MIMEEval.pm
Sending trunk/lib/Mail/SpamAssassin/Plugin/MIMEEval.pm
Transmitting file data ..done
Committing transaction...
Committed revision 1861633.
--
You are receiving this mail because:
You are the assignee for the bug.