Posts Tagged ‘Spam’
SpamAssassin problem on Fedora 6
Posted by david | Filed under Linux
Yesterday I found that the RPM database on my Fedora Core 6 linux system’s were corrupted and that the regularly running update process was failing (without telling me, unfortunately).
After fixing the RPM database problem (rm -f /var/lib/rpm/__db.* && rpm -vv —rebuilddb) and running the update (yum update), I found that SpamAssassin’s update process wasn’t working anymore.
root@rivendell ~]# sa-update
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/Scalar/Util.pm line 30.
Apparently one of the updates that were applied in the mass update caused SpamAssassin to break.
The same problem occurred when I tried to test the SpamAssassin rules.
root@rivendell ~]# spamassassin —lint
Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/5.8.8/i386-linux-thread-multi/Scalar/Util.pm line 30.
A bit of research turned up this link.
Luckily the fix was fairly easy … just update the Scalar-List-Utils CPAN package …
perl -MCPAN -e 'install "G/GB/GBARR/Scalar-List-Utils-1.18.tar.gz"
… and everything worked fine again.
Clean up /tmp
Posted by david | Filed under Spam, Technical Tidbits
Recently I noticed that there’s a lot of temporary files in the /tmp directory on my mail server … all the files have spamassassin in the file name. I figured that in some cases, SpamAssassin (or programs it calls) isn’t cleaning up properly.
I whipped up this script that will clean up any spamassassin files & directories that are older than a set number of minutes (60 in my case)…
#!/bin/sh
AGE=60
if [ "$1" == "--test" ]
then
CMD="-exec echo"
echo "$0: test mode"
else
CMD="-exec"
fi
/usr/bin/find /tmp \
-mmin +$AGE \
-name spamassassin.ocr* \
$CMD /bin/rm -f '{}' \;
/usr/bin/find /tmp \
-maxdepth 1 \
-mmin +$AGE \
-type d \
-name .spamassassin\* \
$CMD /bin/rm -rf '{}' \;
If you run the script with a parameter of ‘–test’, it will just show the commands it would have executed.
I put the script in /etc/cron.hourly directory so it gets executed every hour.