Bug 7667 - division by zero possible in latest update
Summary: division by zero possible in latest update
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Rules (show other bugs)
Version: 3.3.2
Hardware: PC Linux
: P2 normal
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-09 18:43 UTC by nerijus
Modified: 2018-12-10 22:39 UTC (History)
4 users (show)



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 nerijus 2018-12-09 18:43:30 UTC
CentOS 5, the latest update cannot be installed:
/etc/cron.daily/sa_update:

config: invalid expression for rule T_MIXED_ES: "( __LOWER_E > 20 ) && ( __E_LIKE_LETTER > ( (__LOWER_E * 14 ) / 10) ) && ( ( __E_LIKE_LETTER / __LOWER_E ) < 10 )": division by zero possible

I assume it is because of __E_LIKE_LETTER / __LOWER_E. Is it possible to rewrite it, or is the perl version too old in CentOS 5?
Comment 1 Bill Cole 2018-12-09 20:33:57 UTC
We don't have a deep analysis of this bug, but it has only been reported with obsolete unsupported versions of SpamAssassin (3.3.x) which would be consistent with CentOS 5.x or any other EL5-family distribution. The specific error message is generated by SpamAssassin, not Perl itself. The relevant code (in Mail::SpamAssassin::Conf::Parser) has undergone extensive revision between 3.3.2 and 3.4.2..

You may be able to upgrade SA to v3.4.2 using CPAN, because in principle SA v3.4.2 supports Perl v5.8.1 or newer. If you do so and still encounter this issue, please reopen this bug.
Comment 2 Kevin A. McGrail 2018-12-09 21:39:01 UTC
What version of spamassassin is on the system? We can at least add a version conditional to the rule.

Regards,
KAM
Comment 3 nerijus 2018-12-09 21:44:46 UTC
Version 3.3.2 (spamassassin-3.3.2-56.el5). But the interesting thing is, that on CentOS 6 I have spamassassin-3.3.1-3.el6, and update worked there, there is T_MIXED_ES rule in /var/lib/spamassassin/3.003001/72_active.cf.
I will try to build 3.4.2.
Comment 4 RW 2018-12-09 22:05:30 UTC
Why not just rewrite it as

 ... && (__E_LIKE_LETTER  <  10*__LOWER_E )

and have done with it.
Comment 5 Bill Cole 2018-12-10 03:12:06 UTC
(In reply to RW from comment #4)
> Why not just rewrite it as
> 
>  ... && (__E_LIKE_LETTER  <  10*__LOWER_E )
> 
> and have done with it.

Good idea.

Done.
Comment 6 nerijus 2018-12-10 22:39:27 UTC
I built and installed 3.4.2, but still get the same error on CentOS 5:

# sa-update 
config: invalid expression for rule T_MIXED_ES: "( __LOWER_E > 20 ) && ( __E_LIKE_LETTER > ( (__LOWER_E * 14 ) / 10) ) && ( ( __E_LIKE_LETTER / __LOWER_E ) < 10 )": division by zero possible