SpamAssassin 3.2.0 / Perl 5.8.8 Nightmare !!!!!!

rohit

Verified User
Joined
Mar 20, 2007
Messages
198
Location
Melbourne
Hi Guys,

I am just going to share my 4 hour experience trying to get SpamAssassin 3.2.0 installed with latest spam.sh (DA 1.2.96) and Perl 5.8.8

Firstly I am running RHEL3

Since SpamAssassin 3.2.0 required Perl 5.8.8 so my first step was to get Perl 5.8.8 installed. Since I didn't want to use the compiling by source method so I started looking at any RPM availables and didn't find any. Then I came across a website that mentioned that PERL 5.8.8 is shipped with RHEL5 and 5.8.5 with RHEL4. So I started looking for RPM from rpmfind and I found a RPM perl-5.8.8-10.src.rpm. I downloaded and tried to build it.
Code:
rpmbuild --rebuild perl-5.8.8-10.src.rpm
It took around 6 - 7 mins and it got compiled successfully and then I did this to install it
Code:
#rpm -Uvh /usr/src/redhat/RPMS/i386/perl-5.8.8-10.i386.rpm
#rpm -Uvh /usr/src/redhat/RPMS/i386/perl-suidperl-5.8.8-10.i386.rpm

and it all worked without any issues.
Code:
[root@server root]# perl -v

This is perl, v5.8.8 built for i386-linux-thread-multi

Now comes the trouble. I then thought of installing SpamAssassin using ./spam.sh under /usr/local/directadmin/scripts/

I tried to edit spam.sh to change the SpamAssassing from 3.1.8 to 3.2.0 using vi and vi then stopped to work :eek: . It started complaining about not been able to find some shared libraries libperl.so

I then started researching on how to fix it as vi was very important. Few websites mentioned about recompiling vi and then I came across a website that had a solution. Below are the steps to fix anything if you come across any shared library issue:

Code:
#which vi
#ldd /usr/bin/vim
....
libperl.so => not found
....
#rpm -ql perl | grep libperl.so
#ln -s <PATH TO LIBPERL.so> /lib/libperl.so

e.g /usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE/libperl.so

After doing this got vi working !!! ;)

Now I was then able to vi spam.sh to edit the SpamAssassin Version from 3.1.8 to 3.2.0 and run

Code:
#./spam.sh

It seems to worked but then there were alot of errors in /var/log/maillog when I restarted exim using /etc/rc.d/init.d/exim restart.

when I tried to run this from the command prompt, spamd started complaining about script version 3.0200 and modules version 3.0108 mismatch

Then again I started doing some research and after a long time and some thought found that having different versions of SpamAssassin in different versions of perl can cause issues then found out that spamd was trying to read some packages from /usr/lib/perl5/site_perl/5.8.0/Mail/SpamAssassin folder and I got to wonder why spamd is still referring to old version of perl. So I thought to remame /usr/lib/perl5/site_perl/5.8.0/Mail to /usr/lib/perl5/site_perl/5.8.0/Mail-removed as /usr/lib/perl5/site_perl/5.8.0/Mail was already there in /usr/lib/perl5/site_perl/5.8.8/Mail/ and this is where SpamAssassin was installed.

Bang!!!!!!! I restarted spamassassin by restarting exim and this time less errors.

Code:
[root@server Mail]# spamassassin -V
SpamAssassin version 3.2.0
  running on Perl version 5.8.8
#spamassassin -D --lint
the above command was helpful when testing spamassassin

SpamAssassin was then compailing about some parse issues in

/etc/mail/spamassassin/local.cf

Code:
[20971] warn: config: failed to parse line, skipping, in "/etc/mail/spamassassin/local.cf": rewrite_subject 1
[20971] warn: config: failed to parse line, skipping, in "/etc/mail/spamassassin/local.cf": subject_tag [SPAM]

So did some research again and found out that rewrite_subject and subject_tag are depricated and should be replaced with rewrite_header Subject ****SPAM(_SCORE_)****

so in my "/etc/mail/spamassassin/local.cf" I replaced those two directives with

rewrite_header Subject ****SPAM(_SCORE_)****

This is how it looks like currently

# These values can be overridden by editing ~/.spamassassin/user_prefs.cf
# (see spamassassin(1) for details)

# These should be safe assumptions and allow for simple visual sifting
# without risking lost emails.

required_hits 5
rewrite_header Subject ****SPAM(_SCORE_)****
report_safe 0

I then also checked the template used by DirectAdmin for a new user preference file and found that it is also using the directives that are depricated.

Code:
[root@server Mail]# cat /usr/local/directadmin/data/templates/user_prefs 
|?RW_HEADER_SUB=rewrite_header subject `subject_tag`|
|*if subject_tag=""|
|?RW_HEADER_SUB=|
|*endif|

|*if VERSION3="yes"|
required_score |required_hits|
|RW_HEADER_SUB|
|*else|

required_hits   |required_hits|
rewrite_subject |rewrite_subject|
subject_tag     |subject_tag|

|*endif|

report_safe     |report_safe|

|blacklist_from|
|whitelist_from|

So could JOHN please have a look at the documentation for SpamAssassin 3.2.x and any future releases they may not be able to understand these directive and get these changes accordingly in the new release of DirectAdmin

NOT TO MENTION THAT on startup spamd still gives this error, which I think is a known bug (i think) if you dont have razor, pyzor installed

[20971] dbg: rules: meta test DIGEST_MULTIPLE has undefined dependency 'DCC_CHECK'
[20971] info: rules: meta test HS_PHARMA_1 has dependency 'HS_SUBJ_ONLINE_PHARMACEUTICAL' with a zero score


I think I am in no mood to touch the server for the next couple of days now!!!!!!!!!!!!!!!!!!! :)

Thanks

Rohit
 
Last edited:
wow, you solved the issue it seems for getting an upgraded version of perl on the system!! Where did you find the SRC RPMS for Perl 5.8.8??? I may try this on my server this weekend!
 
Hello Rohit,

I have tried to follow your guide but without success.

I modified the spam.sh script to
#VERSION=3.2.0
#PERL=/usr/local/bin/perl (because this is where perl 5.8.8. is installed)

And ran it. When i start the deamon. (/usr/bin/spamd -d -c -m 5)
i dont get any error.

When i do
#perl -v

This is perl, v5.8.8 built for i686-linux

This looks fine. But when i do
#spamassassin -V

SpamAssassin version 3.2.0
running on Perl version 5.8.5

So i tried to rename the folder
/usr/lib/perl5/site_perl/5.8.0/Mail
But this directory doesnt exists.

Also the directory /usr/lib/perl5/site_perl/5.8.8 doesnt exists

So i tried to reinstall perl 5.8.8

After a while, i am stuck with building the RPM of perl 5.8.8

error: Failed build dependencies:
gdbm-devel is needed by perl-5.8.8-10.i386

so i downloaded gdbm-devel-1.8.0-20.i386.rpm and build it.

I tried again
#rpmbuild --rebuild perl-5.8.8-10.src.rpm
#rpm -Uvh /usr/src/redhat/RPMS/i386/perl-5.8.8-10.i386.rpm
#rpm -Uvh /usr/src/redhat/RPMS/i386/perl-suidperl-5.8.8-10.i386.rpm

Ran spam.sh and restarted exim

Then i did
#spamassassin -V

SpamAssassin version 3.2.0
running on Perl version 5.8.8

This looking promising!

But the following appears in the logfile /var/log/maillog
_____
May 30 15:32:14 grant spamd[20316]: Can't locate version.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /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.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /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/lib/perl5/site_perl/5.8.5/Mail/SPF.pm line 24.

____

I did the 'rename fix'

#rename /usr/lib/perl5/site_perl/5.8.0/Mail /usr/lib/perl5/site_perl/5.8.0/Mail-removed

Restarted exim
But again the error appears in the log :(

Do you have a suggestion ?
Thanks
 
at /usr/lib/perl5/site_perl/5.8.5/Mail/SPF.pm line 24

if you see, it seems like that SpamAssassin is still trying to load modules from perl 5.8.5

So u might also need to rename /usr/lib/perl5/site_perl/5.8.5/Mail to /usr/lib/perl5/site_perl/5.8.5/Mail-removed and restart exim
 
ok,
I renamed it. But he keeps complaining about version.pm
Only this time in the 5.8.8 directory

Is this a real file whats missing ?

/var/log/maillog

____
May 31 09:37:21 grant spamd[4932]: Can't locate version.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /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.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /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/lib/perl5/site_perl/5.8.8/Mail/SPF.pm line 24.
____
 
I think it cant find version.pm

do

#locate version.pm

there should be a file somewhere under this directory /usr/lib/perl5/site_perl/5.8.8/......

I think this file should have been installed with perl installation.
 
i already did a search for version.pm

#updatedb
#locate version.pm

no result...
 
Do this in the following order and you'll get Perl 5.8.8 installed and SpamAssassin 3.2.1 to work as expected on Redhat Ent 3,4 and CentOS 4.X

cd /root
wget http://www.perl.com/CPAN/src/stable.tar.gz
tar -xzvf stable.tar.gz
cd perl-5.8.8
./configure.gnu --prefix=/usr

make

make test

make install


perl -V

That installs perl 5.8.8 but then things like DBD::mysql don't work.

To install DBI and DBD:mysql from source, run the following:

cd /root
wget http://www.cpan.org/modules/by-module/DBD/DBI-1.48.tar.gz
tar xvzf DBI-1.48.tar.gz
cd DBI-1.48
unset LANG;
perl Makefile.PL
make
make install

cd ..
wget http://www.cpan.org/modules/by-module/DBD/DBD-mysql-3.0002.tar.gz
tar xvzf DBD-mysql-3.0002.tar.gz
cd DBD-mysql-3.0002
unset LANG;
perl Makefile.PL
make
make install

then upgrade Spam Assassin

cd /usr/local/directadmin/scripts
./spam.sh

killall -9 spamd

/usr/bin/spamd -d -c -m 5

spamassassin -V

service exim restart

That's it.


Then to clean up some dead space
Go to the /tmp or /root folder where you downloaded the initial tarball and remove the perl-5.8.8 folder it created as well as the stable.tar.gxz file.

rm -Rf perl-5.8.8/
rm stable.tar.gz

It will have installed itself in the /usr/local/lib/perl5 folder so you don't need that initial install stuff any more.
 
Last edited:
Back
Top