y2k10 bug in SpamAssassin

tristan

Verified User
Joined
Feb 11, 2005
Messages
706
Location
The Netherlands
Maybe interesting to read on this first day of 2010, there is a y2k10 bug in SpamAssassin in the FH_DATE_PAST_20XX rule, causing all mails getting an extra 3.4 points:

SA Bugzilla – Bug 6269

so if you're using this it might be wise to update this file by opening /usr/share/spamassassin/72_active.cf and change this line:

Code:
header   FH_DATE_PAST_20XX      Date =~ /20[[B]1[/B]-9][0-9]/ [if-unset: 2006]

into:

Code:
header   FH_DATE_PAST_20XX      Date =~ /20[[B]2[/B]-9][0-9]/ [if-unset: 2006]

and don't forget to restart Exim and to not run sa-update untill they move this fix to the stable version of course.
 
Last edited:
Hello,

Thanks for the update. For anyone who needs to do a lot of servers, this perl regex worked for me:
Code:
perl -pi -e 's#header   FH_DATE_PAST_20XX.*#header   FH_DATE_PAST_20XX      Date =~ /20[2-9][0-9]/ [if-unset: 2006]#' /usr/share/spamassassin/72_active.cf
Note that there are 3 spaces after the "header", which are all required (better to copy/paste/run it vs typing it).

Note that "sa-update" should in theory fix it, but on all the servers I ran it on, it hung and didn't respond. It's quite possible that their site is overloaded with requests, so for now, just update the 72_active.cf file and restart exim (which will restart spamd)

John
 
sa-update seems to have worked for me. At least, it changed the file /var/lib/spamassassin/3.002004/updates_spamassassin_org/72_active.cf. It didn't change /usr/share/spamassassin/72_active.cf though.
 
@twv:

Do you use something like:
Code:
#!/bin/sh
UPDATECMD="sa-update -D"
RESTARTCMD=`killall spamd; /usr/bin/spamd -d -c -m 5`

$UPDATECMD 2>/dev/null

if [ $? -eq 0 ]; then
echo "Updates where installed"
$RESTARTCMD
elif [ $? -eq 1 ]; then
echo "Already have the latest"
else
echo "Something went wrong"
fi

To update the rules? Because you need to restart SpamAssassin after sa-update ;)
 
I use
Code:
sa-update && /sbin/service exim restart
which seems to have worked. At least, I don't see any more FH_DATE_PAST_20XX in /var/log/maillog, and there were lots before I ran sa-update.
 
For SED users:
Code:
sed -i 's.\/20\[1.\/20\[2.g' /usr/share/spamassassin/72_active.cf
(easy to use with dsh if you have multiple servers)
 
All you have to do is add to local.cf

score FH_DATE_PAST_20XX 0.0
 
The bug has been fixed in the latest updates to SpamAssassin. Updating your rule sets should fix the problem.

Jeff
 
Updating your rule sets should fix the problem.

Jeff


How do we do the updating?



i also have error doing this

[root@svr1 admin]# sa-update
Can't locate Archive/Tar.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8) at /usr/bin/sa-update line 81.
BEGIN failed--compilation aborted at /usr/bin/sa-update line 81.
 
I don't suppose one of you guys knows what this mean? (and could explain a fix)

------------------------------------------------------

[root@da updatescript]# sa-update && /sbin/service exim restart
rules: failed to run __DC_IMG_TEXT_RATIO test, skipping:
(Can't locate object method "image_to_text_ratio" via package "Mail::SpamAssassin::perMsgStatus" at (eval 723) line 2419.
)
rules: failed to run __DC_IMG_HTML_RATIO test, skipping:
(Can't locate object method "image_to_text_ratio" via package "Mail::SpamAssassin::perMsgStatus" at (eval 768) line 19.
)
channel: lint check of update failed, channel failed
 
Hello,

I'm not too sure, but you can just remove that one rule by commenting it out.
I believe it's found in:
/usr/share/spamassassin/20_imageinfo.cf

It appears on 3 lines, so comment out those 3 lines.

John
 
Hi, thanks for the quick reply.

I'm sorry to say, that didn't actually work. But after much gnashing of teeth and rending of cloth, I discovered that there was a v320.pre and v320.pre.rpmnew in /etc/mail/spamassassin.

I found a reference to this in some random search. The file sizes were different so I swapped them and sa-update ran with no error. (infact, there was no information of anykind reported. so I'm not sure what exactly happened)

I'm not sure what's up with there being two v320.pre. /shrug ignorance is bliss, and I am very happy.
 
Note for everyone:

Whenever an rpm update gives you a file ending in .rpmnew, be sure to check the differences between the two files. You'll almost always need to either use the new one or make changes to the old one.

Jeff
 
Back
Top