PDA

View Full Version : Upgrade SpamAssassin using CPAN?



j103c
04-01-2004, 09:24 PM
Hi,

I have checked out different posts here and Jalal's site, and I've seen rumors about just using CPAN to upgrade SpamAssassin, but has anyone actually done it this way? Most seem to do separate, parallel installs.

Is it possible to upgrade with CPAN? Is it easy? Are there any caveats given our VPS's (I am not a reseller)?

Thanks!

FZ
04-02-2004, 07:11 AM
Hi j103c,

It's not a rumour ;) The new version of SpamAssassin is a LOT better than the version you get with your Site Manager. Yes, you can use CPAN to install it, but as far as I know, you cannot actually upgrade your WestHost installation (not in the true sense anyway). The reason is that WestHost places some files in weird places, such as the SpamAssassin binary itself, in / instead of (insert default install location).

Initially, I did not use CPAN to install my new version, the reason being that via the "default" CPAN, you cannot upgrade various modules (because of the way WestHost set permissions on them, so you can't mess anything up). What that means is that you will first have to follow Jalal's method of setting up a much less restricted CPAN shell for yourself (which isn't very difficult, given the excellent guide - I did that and then was easily able to install the newest version of SpamAssassin), and then you will be able to install SpamAssassin. Now, by "true upgrade" what I meant was that you won't be able to replace/upgrade all files used by the WestHost install of SpamAssassin (weird locations being the reason). HOWEVER, you will still be able to keep your custom user_prefs, and your bayesian filters (if you were using them). So, in essense, you will have to do a "separate" install anyway, and have to modify some files manually (e.g. /etc/procmailrc) to reflect your changes.

Yes, it is really easy - and reversible since you can always go back to WestHost's version if you need to. I am not a reseller either, and I had no problems. As always, you can post any problems/questions you have on this forum, and a helpful soul will be at your command soon enough ;)

j103c
04-02-2004, 07:25 AM
Hey thanks for yet another reply FZ. :)

So if I modify CPAN according to Jalal's tips, and then install a new SpamAssassin installation via that method, will SpamAssassin still recognize the current site-wide preferences location (local.cf) as well as any custom preferences in the users' home directories?

Or do I need to look at either moving the local.cf or changing a reference to it? Would /etc/procmailrc be the only other file I would need to change to reflect the new SpamAssassin installation?

Thanks!

FZ
04-02-2004, 10:34 AM
No problem ;)

Yes, the first step would be to modify your CPAN to make it less restrictive: to allow you to install updated modules (required for the new version of SpamAssassin to run correctly). After this, you will be able to install SpamAssassin via your new CPAN - but you will still need to follow a special step or two, specifically you need to specify a PREFIX (i.e. "installation directory"). I'm not exactly sure (cannot remember) what other things need to be specified for correct installation to take place, but I am sure Jalal has mentioned them in his CPAN and/or SpamAssasin post(s).

Custom preferences located in home directories will be recognized without you needing to do anything, however, the local.cf file may not be recognized. Depending on how you install (i.e. what you specify PREFIX=, etc.) your new local.cf might be located in a different directory. My recommendation to you would be to back up your current local.cf, and then once your new installation is complete, overwrite the new version of local.cf with your old one.

As for editing files, as far as I can recall, /etc/procmailrc would be the only file you need to edit - but this is only the case if you want to enable SpamAssassin for all e-mail accounts on your account. If you are currently using SpamAssassin site-wide, opening up this file will reveal a couple of lines dedicated to your WestHost installation of SpamAssassin. Once you get your own install in, you'd just update the location to point to the new binary, and also change the flags used (I'd be happy to provide them to you once you get to this stage).

j103c
04-02-2004, 10:42 AM
Thanks FZ - I'll do some more research and maybe give some of those initial steps a shot tonight. Realizing that CPAN didn't upgrade the WestHost installed SpamAssassin helped clarify what would actually happen..

Thanks for your help!

FZ
04-02-2004, 10:48 AM
You're welcome. Let me know how it goes.

jalal
04-02-2004, 12:00 PM
Hey thanks for yet another reply FZ. :)

So if I modify CPAN according to Jalal's tips, and then install a new SpamAssassin installation via that method, will SpamAssassin still recognize the current site-wide preferences location (local.cf) as well as any custom preferences in the users' home directories?

Or do I need to look at either moving the local.cf or changing a reference to it? Would /etc/procmailrc be the only other file I would need to change to reflect the new SpamAssassin installation?

Thanks!

You don't need to change local.cf or user_prefs, the new spamassassin will recognize them.
If you replace the /spamassassin with a soft link to the new spamassassin then you don't even need to change procmailrc. You can back out of your changes just by removing the link.

I rewrote a lot of the instructions on my site about a two weeks ago, so if you have't looked since then, maybe go on over and have another look for some updated instructions.

HTH

j103c
04-02-2004, 05:04 PM
Okay - I have CPAN set up according to Jalal's site I believe. I also upgraded MakeMaker.

I got a little eager though, and went into CPAN and did "install Mail::SpamAssassin" without specifying an install directory, etc. Made it a large way through, now I'm stuck at a test:

spamd_hup.................ok 5/8

It just sits there. THEN I read about adding the extensions when making for the install directory and config directory. Woohoo. :(

So are there ways to clean up this half-installed CPAN installation of SpamAssassin? I think I will just install with the .tar file.

FZ
04-02-2004, 05:13 PM
Hmm, I'm just guessing here (not a *nix expert), but you might be able to go into the SpamAssassin directory (i.e. the CPAN SpamAssassin directory, where it downloaded the SpamAssassin files (NOT the directory where they were half-installed)), and type (via an SSH session) make uninstall or make distclean and press enter. If both of these fail, you can try make clean - hopefully, it will remove all files it created (otherwise you will have to manually remove them).

If done properly, installing via CPAN is the easiest method, and it tests it all for you in the process. I would recommend you give the CPAN method one more go (making sure to follow instructions this time ;)), and if all else fails, then do a .tar.gz install...

j103c
04-02-2004, 06:24 PM
How do I duplicate this step in CPAN since the installation is somewhat automatic?


perl Makefile.PL PREFIX=/sa SYSCONFDIR=/saconf

FZ
04-02-2004, 06:56 PM
Tricky :( I'm not aware of a way to specify that while doing it via CPAN. I just dug up my old post (from the time I "unrestricted" my CPAN with Jalal's help), and it seems like because of this same problem, I installed from the .tar.gz instead of CPAN. I apologise profusely :oops: You might want to wait until Jalal sees your question (he probably has an answer), or if you like you could get started on the "manual install".

j103c
04-02-2004, 06:59 PM
Thanks FZ :) No worries about the trickiness of CPAN. I went ahead and did the manual install based on prior posts.

When I run spamassassin -D --lint to check the install, it went fine, however I noticed it said Net::DNS::Resolver was not available, when I know that it is. Maybe that is a setting in local.cf I need to set up?

FZ
04-02-2004, 07:13 PM
Have you explicitly installed it via CPAN using the "command" install Net::DNS?

If you have done it, then it might not have installed properly. The other thing that comes to mind is if you had installed it with your new "unrestricted" CPAN, then it installed it to a "non-standard" location and so SpamAssassin cannot find it. The way to fix that is to set the PERL5LIB environmental variable as detailed in Jalal's CPAN post (i.e. place it in your .bashrc and have it point to the directory where your "new" CPAN installs the modules). Make sure to restart your SSH session after you have added the line to your .bashrc.

j103c
04-02-2004, 07:18 PM
Yep, I installed it through CPAN just like you wrote.

I have the perl5lib directory, and have this in my .bashrc file:


export PERL5LIB=/var/perl5lib/lib

Like I said, works fine in SA 2.5x, but 2.63 isn't picking it up yet.. Not sure.

j103c
04-02-2004, 07:21 PM
I did a force install of Net::DNS, retried SA 2.63 - still no luck.


debug: is Net::DNS::Resolver available? no
debug: is DNS available? 0

FZ
04-02-2004, 07:24 PM
Weird. Have you check in that directory to see if relevantly named files/folders exist? Maybe if you try the command again in CPAN?

I just checked and it looks like I did my Net::DNS install with my "old" CPAN, meaning it is in the "standard" location and is easily picked up. Maybe SpamAssassin needs additional tweaking to pick up non-standard locations?

j103c
04-02-2004, 07:26 PM
Hmm.. same as you. I don't see it in my new CPAN lib directory, however it is in:

/home/username/.cpan/build

FZ
04-02-2004, 07:32 PM
Did you close your SSH session and then start it again after adding PERL5LIB to your .bashrc?

j103c
04-02-2004, 07:33 PM
Yes - I did that a day or 2 ago.

I also did that after doing a force install of Net::DNS a little bit ago.

I should also add other packages I've added through CPAN lately have been going into the 'new' directory.

FZ
04-02-2004, 07:36 PM
Type perl -V and make sure your "non-standard" location appears under %ENV...

j103c
04-02-2004, 07:38 PM
Yep:


%ENV:
PERL5LIB="/var/perl5lib/lib"
@INC:
/var/perl5lib/lib/i686-linux
/var/perl5lib/lib
/usr/local/perl/lib/5.6.0/i686-linux
/usr/local/perl/lib/5.6.0
/usr/local/perl/lib/site_perl/5.6.0/i686-linux
/usr/local/perl/lib/site_perl/5.6.0
/usr/local/perl/lib/site_perl
.


I sure am getting a crash course in CPAN/Perl/environment.. :)

FZ
04-02-2004, 07:41 PM
Hmmph :$ What does the output of install Net::DNS look like? Maybe try it again and then copy and paste it all here.

j103c
04-02-2004, 07:46 PM
I'm getting what appear to be important parts, not the whole thing.. Let me know if you want to see more..


Removing previously used /home/<username>/.cpan/build/Net-DNS-0.46


Checking if your kit is complete...
Looks good
Writing Makefile for Net::DNS
cp lib/Net/DNS/RR/MG.pm blib/lib/Net/DNS/RR/MG.pm
cp lib/Net/DNS.pm blib/lib/Net/DNS.pm
cp lib/Net/DNS/RR/A.pm blib/lib/Net/DNS/RR/A.pm
cp lib/Net/DNS/RR/OPT.pm blib/lib/Net/DNS/RR/OPT.pm
cp lib/Net/DNS/RR/MX.pm blib/lib/Net/DNS/RR/MX.pm
cp lib/Net/DNS/RR/X25.pm blib/lib/Net/DNS/RR/X25.pm
cp lib/Net/DNS/Resolver/Recurse.pm blib/lib/Net/DNS/Resolver/Recurse.pm
cp lib/Net/DNS/RR/NSAP.pm blib/lib/Net/DNS/RR/NSAP.pm
cp lib/Net/DNS/RR/CNAME.pm blib/lib/Net/DNS/RR/CNAME.pm
cp lib/Net/DNS/RR/LOC.pm blib/lib/Net/DNS/RR/LOC.pm
cp lib/Net/DNS/RR/MINFO.pm blib/lib/Net/DNS/RR/MINFO.pm
cp lib/Net/DNS/Update.pm blib/lib/Net/DNS/Update.pm
cp lib/Net/DNS/RR/SOA.pm blib/lib/Net/DNS/RR/SOA.pm
cp lib/Net/DNS/RR/ISDN.pm blib/lib/Net/DNS/RR/ISDN.pm
cp lib/Net/DNS/RR/RT.pm blib/lib/Net/DNS/RR/RT.pm
cp lib/Net/DNS/Resolver.pm blib/lib/Net/DNS/Resolver.pm
cp lib/Net/DNS/RR/DNAME.pm blib/lib/Net/DNS/RR/DNAME.pm
cp lib/Net/DNS/Question.pm blib/lib/Net/DNS/Question.pm
cp lib/Net/DNS/RR/PX.pm blib/lib/Net/DNS/RR/PX.pm
cp lib/Net/DNS/RR/NIMLOC.pm blib/lib/Net/DNS/RR/NIMLOC.pm
cp lib/Net/DNS/Nameserver.pm blib/lib/Net/DNS/Nameserver.pm
cp lib/Net/DNS/RR/HINFO.pm blib/lib/Net/DNS/RR/HINFO.pm
cp lib/Net/DNS/FAQ.pod blib/lib/Net/DNS/FAQ.pod
cp lib/Net/DNS/Resolver/Win32.pm blib/lib/Net/DNS/Resolver/Win32.pm
cp lib/Net/DNS/RR/AAAA.pm blib/lib/Net/DNS/RR/AAAA.pm
cp lib/Net/DNS/Header.pm blib/lib/Net/DNS/Header.pm
cp lib/Net/DNS/RR/EID.pm blib/lib/Net/DNS/RR/EID.pm
cp lib/Net/DNS/Resolver/Base.pm blib/lib/Net/DNS/Resolver/Base.pm
cp lib/Net/DNS/RR.pm blib/lib/Net/DNS/RR.pm
cp lib/Net/DNS/RR/TXT.pm blib/lib/Net/DNS/RR/TXT.pm
cp lib/Net/DNS/RR/CERT.pm blib/lib/Net/DNS/RR/CERT.pm
cp lib/Net/DNS/Packet.pm blib/lib/Net/DNS/Packet.pm
cp lib/Net/DNS/Resolver/Cygwin.pm blib/lib/Net/DNS/Resolver/Cygwin.pm
cp lib/Net/DNS/RR/MB.pm blib/lib/Net/DNS/RR/MB.pm
cp lib/Net/DNS/RR/MR.pm blib/lib/Net/DNS/RR/MR.pm
cp lib/Net/DNS/RR/SRV.pm blib/lib/Net/DNS/RR/SRV.pm
cp lib/Net/DNS/Resolver/UNIX.pm blib/lib/Net/DNS/Resolver/UNIX.pm
cp lib/Net/DNS/RR/AFSDB.pm blib/lib/Net/DNS/RR/AFSDB.pm
cp lib/Net/DNS/RR/Unknown.pm blib/lib/Net/DNS/RR/Unknown.pm
cp lib/Net/DNS/RR/PTR.pm blib/lib/Net/DNS/RR/PTR.pm
cp lib/Net/DNS/RR/TSIG.pm blib/lib/Net/DNS/RR/TSIG.pm
cp lib/Net/DNS/RR/NS.pm blib/lib/Net/DNS/RR/NS.pm
cp lib/Net/DNS/RR/NAPTR.pm blib/lib/Net/DNS/RR/NAPTR.pm
cp lib/Net/DNS/RR/TKEY.pm blib/lib/Net/DNS/RR/TKEY.pm
cp lib/Net/DNS/RR/NULL.pm blib/lib/Net/DNS/RR/NULL.pm
cp lib/Net/DNS/RR/RP.pm blib/lib/Net/DNS/RR/RP.pm
/bin/perl /usr/local/perl/lib/5.6.0/ExtUtils/xsubpp -typemap /usr/local/perl/lib/5.6.0/ExtUtils/typemap DNS.xs > DNS.xsc && mv DNS.xsc DNS.c
gcc -c -fno-strict-aliasing -I/usr/local/include -O2 -DVERSION=\"0.46\" -DXS_VERSION=\"0.46\" -fpic "-I/usr/local/perl/lib/5.6.0/i686-linux/CORE" DNS.c
Running Mkbootstrap for Net::DNS ()
chmod 644 DNS.bs
rm -f blib/arch/auto/Net/DNS/DNS.so
LD_RUN_PATH="/lib" gcc -shared -L/usr/local/lib DNS.o -o blib/arch/auto/Net/DNS/DNS.so -lresolv
chmod 755 blib/arch/auto/Net/DNS/DNS.so
cp DNS.bs blib/arch/auto/Net/DNS/DNS.bs
chmod 644 blib/arch/auto/Net/DNS/DNS.bs
Manifying blib/man3/Net::DNS::RR::MG.3
Manifying blib/man3/Net::DNS::RR::A.3
Manifying blib/man3/Net::DNS.3
Manifying blib/man3/Net::DNS::RR::OPT.3
Manifying blib/man3/Net::DNS::RR::MX.3
Manifying blib/man3/Net::DNS::RR::X25.3
Manifying blib/man3/Net::DNS::Resolver::Recurse.3
Manifying blib/man3/Net::DNS::RR::LOC.3
Manifying blib/man3/Net::DNS::RR::CNAME.3
Manifying blib/man3/Net::DNS::RR::NSAP.3
Manifying blib/man3/Net::DNS::RR::MINFO.3
Manifying blib/man3/Net::DNS::RR::SOA.3
Manifying blib/man3/Net::DNS::Update.3
Manifying blib/man3/Net::DNS::RR::ISDN.3
Manifying blib/man3/Net::DNS::RR::RT.3
Manifying blib/man3/Net::DNS::Resolver.3
Manifying blib/man3/Net::DNS::RR::DNAME.3
Manifying blib/man3/Net::DNS::Question.3
Manifying blib/man3/Net::DNS::RR::PX.3
Manifying blib/man3/Net::DNS::RR::NIMLOC.3
Manifying blib/man3/Net::DNS::Nameserver.3
Manifying blib/man3/Net::DNS::RR::HINFO.3
Manifying blib/man3/Net::DNS::FAQ.3
Manifying blib/man3/Net::DNS::Resolver::Win32.3
Manifying blib/man3/Net::DNS::RR::AAAA.3
Manifying blib/man3/Net::DNS::Header.3
Manifying blib/man3/Net::DNS::RR::EID.3
Manifying blib/man3/Net::DNS::Resolver::Base.3
Manifying blib/man3/Net::DNS::RR.3
Manifying blib/man3/Net::DNS::RR::TXT.3
Manifying blib/man3/Net::DNS::RR::CERT.3
Manifying blib/man3/Net::DNS::Packet.3
Manifying blib/man3/Net::DNS::Resolver::Cygwin.3
Manifying blib/man3/Net::DNS::RR::MB.3
Manifying blib/man3/Net::DNS::RR::MR.3
Manifying blib/man3/Net::DNS::RR::SRV.3
Manifying blib/man3/Net::DNS::Resolver::UNIX.3
Manifying blib/man3/Net::DNS::RR::AFSDB.3
Manifying blib/man3/Net::DNS::RR::Unknown.3
Manifying blib/man3/Net::DNS::RR::NS.3
Manifying blib/man3/Net::DNS::RR::TSIG.3
Manifying blib/man3/Net::DNS::RR::PTR.3
Manifying blib/man3/Net::DNS::RR::NAPTR.3
Manifying blib/man3/Net::DNS::RR::TKEY.3
Manifying blib/man3/Net::DNS::RR::NULL.3
Manifying blib/man3/Net::DNS::RR::RP.3
/bin/make -- OK
Running make test
Running Mkbootstrap for Net::DNS ()
chmod 644 DNS.bs
rm -f blib/arch/auto/Net/DNS/DNS.so
LD_RUN_PATH="/lib" gcc -shared -L/usr/local/lib DNS.o -o blib/arch/auto/Net/DNS/DNS.so -lresolv
chmod 755 blib/arch/auto/Net/DNS/DNS.so
cp DNS.bs blib/arch/auto/Net/DNS/DNS.bs
chmod 644 blib/arch/auto/Net/DNS/DNS.bs
PERL_DL_NONLAZY=1 /bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-load................ok
t/00-pod.................skipped
all skipped: Test::Pod v0.95 required for testing POD
t/00-version.............ok
t/01-resolver-env........ok
t/01-resolver-file.......ok
t/01-resolver-opt........ok
t/01-resolver............ok
t/02-header..............ok
t/03-question............ok
t/04-packet..............ok
t/05-rr-txt..............ok
t/05-rr-unknown..........ok
t/05-rr..................ok
t/06-update-safe-push....ok
t/06-update..............ok
t/07-misc................ok
t/08-online..............ok
t/09-tkey................ok
t/10-recurse.............ok
All tests successful, 1 test skipped.
Files=19, Tests=766, 10 wallclock secs ( 3.15 cusr + 0.33 csys = 3.48 CPU)
/bin/make test -- OK
Running make install
Running Mkbootstrap for Net::DNS ()
chmod 644 DNS.bs
rm -f blib/arch/auto/Net/DNS/DNS.so
LD_RUN_PATH="/lib" gcc -shared -L/usr/local/lib DNS.o -o blib/arch/auto/Net/DNS/DNS.so -lresolv
chmod 755 blib/arch/auto/Net/DNS/DNS.so
cp DNS.bs blib/arch/auto/Net/DNS/DNS.bs
chmod 644 blib/arch/auto/Net/DNS/DNS.bs
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /var/perl5lib/man3/Net::DNS::RR::MG.3
Installing /var/perl5lib/man3/Net::DNS::RR::A.3
Installing /var/perl5lib/man3/Net::DNS.3
Installing /var/perl5lib/man3/Net::DNS::RR::OPT.3
Installing /var/perl5lib/man3/Net::DNS::RR::MX.3
Installing /var/perl5lib/man3/Net::DNS::RR::X25.3
Installing /var/perl5lib/man3/Net::DNS::Resolver::Recurse.3
Installing /var/perl5lib/man3/Net::DNS::RR::LOC.3
Installing /var/perl5lib/man3/Net::DNS::RR::CNAME.3
Installing /var/perl5lib/man3/Net::DNS::RR::NSAP.3
Installing /var/perl5lib/man3/Net::DNS::RR::MINFO.3
Installing /var/perl5lib/man3/Net::DNS::RR::SOA.3
Installing /var/perl5lib/man3/Net::DNS::Update.3
Installing /var/perl5lib/man3/Net::DNS::RR::ISDN.3
Installing /var/perl5lib/man3/Net::DNS::RR::RT.3
Installing /var/perl5lib/man3/Net::DNS::Resolver.3
Installing /var/perl5lib/man3/Net::DNS::RR::DNAME.3
Installing /var/perl5lib/man3/Net::DNS::Question.3
Installing /var/perl5lib/man3/Net::DNS::RR::PX.3
Installing /var/perl5lib/man3/Net::DNS::RR::NIMLOC.3
Installing /var/perl5lib/man3/Net::DNS::Nameserver.3
Installing /var/perl5lib/man3/Net::DNS::RR::HINFO.3
Installing /var/perl5lib/man3/Net::DNS::FAQ.3
Installing /var/perl5lib/man3/Net::DNS::Resolver::Win32.3
Installing /var/perl5lib/man3/Net::DNS::RR::AAAA.3
Installing /var/perl5lib/man3/Net::DNS::Header.3
Installing /var/perl5lib/man3/Net::DNS::RR::EID.3
Installing /var/perl5lib/man3/Net::DNS::Resolver::Base.3
Installing /var/perl5lib/man3/Net::DNS::RR.3
Installing /var/perl5lib/man3/Net::DNS::RR::TXT.3
Installing /var/perl5lib/man3/Net::DNS::RR::CERT.3
Installing /var/perl5lib/man3/Net::DNS::Packet.3
Installing /var/perl5lib/man3/Net::DNS::Resolver::Cygwin.3
Installing /var/perl5lib/man3/Net::DNS::RR::MB.3
Installing /var/perl5lib/man3/Net::DNS::RR::MR.3
Installing /var/perl5lib/man3/Net::DNS::RR::SRV.3
Installing /var/perl5lib/man3/Net::DNS::Resolver::UNIX.3
Installing /var/perl5lib/man3/Net::DNS::RR::AFSDB.3
Installing /var/perl5lib/man3/Net::DNS::RR::Unknown.3
Installing /var/perl5lib/man3/Net::DNS::RR::NS.3
Installing /var/perl5lib/man3/Net::DNS::RR::TSIG.3
Installing /var/perl5lib/man3/Net::DNS::RR::PTR.3
Installing /var/perl5lib/man3/Net::DNS::RR::NAPTR.3
Installing /var/perl5lib/man3/Net::DNS::RR::TKEY.3
Installing /var/perl5lib/man3/Net::DNS::RR::NULL.3
Installing /var/perl5lib/man3/Net::DNS::RR::RP.3
Writing /var/perl5lib/lib/i686-linux/auto/Net/DNS/.packlist
Appending installation info to /var/perl5lib/lib/i686-linux/perllocal.pod
/bin/make install -- OK

cpan>

j103c
04-02-2004, 07:48 PM
I notice its in /var/perl5lib/man3 and not /var/perl5lib/lib. Would that make a difference?

FZ
04-02-2004, 07:50 PM
Looks good. Try this (normal SSH prompt, not CPAN): perl -MNet::DNS -e 1 - tell me what you see.

j103c
04-02-2004, 07:52 PM
Nothing, I just return to a prompt.

FZ
04-02-2004, 07:54 PM
That means it is installed properly and is being picked up by Perl. At this point it looks like a SpamAssassin problem. Could you post what you get when you do a -D --lint?

j103c
04-02-2004, 07:56 PM
debug: Score set 0 chosen.
debug: running in taint mode? yes
debug: Running in taint mode, removing unsafe env vars, and resetting PATH
debug: PATH included '/bin', keeping.
debug: PATH included '/usr/local/bin', keeping.
debug: PATH included '/usr/bin', keeping.
debug: PATH included '.', which is not absolute, dropping.
debug: PATH included '/usr/local/apache/bin', keeping.
debug: Final PATH set to: /bin:/usr/local/bin:/usr/bin:/usr/local/apache/bin
debug: ignore: using a test message to lint rules
debug: using "/sa/share/spamassassin" for default rules dir
debug: using "/saconf/mail/spamassassin" for site rules dir
debug: using "/home/<username>/.spamassassin" for user state dir
debug: using "/home/<username>/.spamassassin/user_prefs" for user prefs file
debug: Score set 1 chosen.
debug: Initialising learner
debug: is Net::DNS::Resolver available? no
debug: is DNS available? 0
debug: running header regexp tests; score so far=0
debug: running body-text per-line regexp tests; score so far=1.27
debug: Razor2 is not available
debug: running raw-body-text per-line regexp tests; score so far=1.27
debug: running uri tests; score so far=1.27
debug: uri tests: Done uriRE
debug: running full-text regexp tests; score so far=1.27
debug: Razor2 is not available
debug: DCCifd is not available: no r/w dccifd socket found.
debug: Current PATH is: /bin:/usr/local/bin:/usr/bin:/usr/local/apache/bin
debug: DCC is not available: no executable dccproc found.
debug: Pyzor is not available: pyzor not found
debug: all '*From' addrs: ignore@compiling.spamassassin.taint.org
debug: all '*To' addrs:
debug: running meta tests; score so far=1.27
debug: is spam? score=1.27 required=6 tests=DATE_MISSING,NO_REAL_NAME


If I do the test with 2.52 version, it finds Net::DNS and does a test on some random MX.

j103c
04-02-2004, 07:59 PM
FYI - I grabbed the .tar file from spamassassin.org. I did not grab the package Jalal has on his server (noticed this later).

Would that make a difference?

FZ
04-02-2004, 08:06 PM
Alright well that didn't help either. If you have the time (and patience), I have one more thing you can try/test: remove your new SpamAssassin installation, and re-do it, except with PREFIX set to /usr/local/spamassassin (no need to set SYSCONFDIR). Then try again.

I won't be able to reply for a while now (going to bed, it's 5am here now!). Good luck!

j103c
04-02-2004, 08:08 PM
Alright - I might wait since I'm not sure of the 'clean' way to uninstall the new SpamAssassin installation.

Thanks for your help - Get some rest!! :)

FZ
04-02-2004, 08:09 PM
FYI - I grabbed the .tar file from spamassassin.org. I did not grab the package Jalal has on his server (noticed this later).

Would that make a difference?

I don't think it would, considering I have been able to get mine working 100% with the spamassassin.org version. However, since you cannot get it working properly in your case, there is no harm in trying his version.

FZ
04-02-2004, 08:21 PM
Not asleep yet ;) Have you tried make distclean /uninstall/clean in the .../.cpan/SpamAssassin directory?

j103c
04-02-2004, 08:24 PM
I tried make "make distclean /uninstall/clean" in the /src/Mail.. directory where I exploded the .tar file.

Went through some junk, then ended on:


make: *** No rule to make target `/uninstall/clean'. Stop.

FZ
04-02-2004, 08:25 PM
Oops, I meant each in turn:

make distclean

if that doesn't work:

make uninstall

if that doesn't work:

make clean

j103c
04-02-2004, 08:31 PM
Uh, I tried those but got odd results and the files are still in place. Not sure what is going on.. maybe we both need rest. 8)

FZ
04-02-2004, 08:32 PM
Yeah okay, never mind. I'm off for real this time, but do keep me updated.

Cheers.

j103c
04-02-2004, 10:14 PM
I realized I didn't have the WH1 utilities (like sort) installed from Jalal's site. I've uploaded them and trying to re-step through some prior attempts.

Update

I tried re-installing through CPAN, and had too many failures to continue.

I tried re-installing manually, using package from spamassassin.org, and install went fine, however Net::DNS::Resolver is still not detected.

:?

jalal
04-03-2004, 05:52 AM
Seems like I could give some input here... :) See the end for the practical stuff...

To clean out the cpan installs and such there is no problem with just doing 'rm -rf .cpan' to just nuke the lot of them and start afresh.

Having done a few SA upgrades I've come to the conclusion that the best way to go is:
1. use CPAN to install Net::DNS
2. get the spamassassin package from spamassassin.org and install that separately.

I've also noted that not all the Westhost sites are the same, what works on one, won't work on another...

Installing Net::DNS -- it will in fact install in the regular Perl library directory, so its possible that you won't need to use PERL5LIB to install it, nor the prefix stuff. In fact, it maybe simpler to do it that way.

Trying to install spamassassin through CPAN has only worked once for me and never again, so I've dropped the idea...

So, j103c (did your mother give you that name??), if you want to start afresh, here is what you can do:
remove the ~/.cpan directory completely
remove the /sa, /saconf and /perl5lib directories completely (assuming you have nothing else in the perl5lib directory apart from sa and Net::DNS).
make a back up of your /etc/mail/spamassassin/local.cf file
get the spamassassin-2.63.tar.gz file from spamassassin.org, unpack it, cd into that directory and run:
perl Makefile.PL PREFIX=/sa SYSCONFDIR=/etc
make
make install
(this will install spamassassin in /sa/bin, /sa/lib and point them towards /etc/mail/spamassassin/local.cf.)
run:
$ /sa/bin/spamassassin --lint -D
and check the output.
Have a cup of coffee, thats spamassassin taken care of.

Next for Net::DNS:
start cpan
> o conf makepl_arg '' (to remove the perl5lib setting if its there)
> install Net::DNS
....................
> quit
(this will install Net::DNS in the regular Perl library, which often seems to work).

Try '/sa/bin/spamassassin --lint -D' again and see if it finds the resolver.

If you are ready to change over to the new spamassassin, do this from the root directory:
$ mv spamassassin spamassassin-2.53
$ ln -s /sa/bin/spamassassin spamassassin
which will create link to the new spamassassin and everything will work as normal.

Let me know if this works for you and I'll replace all that complicated shit on my pages with a simpler program like above.

j103c
04-03-2004, 07:06 AM
Thanks Jalal - I'll try to do a fresh install of both SA and Net::DNS.

One thing I noticed, not sure if it makes a difference, SA 2.52 is not running in "taint" mode, while the new install of SA 2.63 was. Not sure if that would have an impact..

.. and no, my mother didn't give me my nickname, however she did influence it. ;)

Jess

j103c
04-03-2004, 07:40 AM
Jalal - that worked! I have SA 2.63 running and it detects Net::DNS::Resolver - awesome!

Yeah - definitely update your site with the details in your last post, I'm sure that will be very helpful to quite a few people.

My thanks go out to you and FZ (who stayed up late/early trying to help)! Much, much appreciated..

jalal
04-03-2004, 07:42 AM
Great news...

I'll put the simpler version up this weekend. I wasn't happy with all that complex stuff before.

thanks for trying it.

j103c
04-03-2004, 07:43 AM
thanks for trying it.

No problem, thanks for posting it. :)

FZ
04-03-2004, 07:45 AM
Glad to hear you got it working, Jess :D

denis
04-06-2004, 09:13 PM
Tim,

Thought I'd try following your instructions here to upgrade SA (hope you don't mind). I managed to upgrade CPAN and now I'm ready to move on to SA. I'm sweating buckets because last time I tried this all my mail vanished. WH & I decided to recreate my account from scratch because it would be faster than figuring out how I buggered up the server config ;-)

The question now is...do I FTP the file Mail-SpamAssassin-2.63.tar.gz in ASCII or binary? And does it matter what directory I FTP it to?

Thanks for the help.

Denis

FZ
04-06-2004, 09:28 PM
Well, I'm not Tim but I can offer some help:

It does not matter what directory you FTP to, but since you had a bad experience last time, I would recommend you FTP to a newly created directory with nothing else in it.

As for FTPing, I'm pretty sure uploading as Binary would be fine in this case. Also, if you are on a slow connection (pretty unlikely, I guess), you could just download SpamAssassin using SSH directly to your account (which would be A LOT faster than you uploading it, assuming you are on a slow connection). The command to use would be (at the "SSH command prompt"):

wget http://www.whatever.com/downloads/program.tar.gz

where you'd obviously replace the URL with the correct one. That will download the file in question to the directory you are working in at that point in time.

Also, as far as being more careful is concerned, I'd recommend you make backups of all files you modify while you do this (e.g. /etc/procmailrc, if you do modify it). Also make sure you know what each command that you execute does (silly/pretty obvious, but double checking won't do any harm!)

Hope that helps. Good luck.

denis
04-06-2004, 10:07 PM
Thanks Fayez,

SpamAssassin didn't complain too much, but I did get the following when trying to install Net::DNS::Resolver...

cpan> o conf makepl_arg ''
makepl_arg

cpan> install Net::DNS::Resolver
Going to read /home/mydomain/.cpan/sources/authors/01mailrc.txt.gz
CPAN: Compress::Zlib loaded ok
Going to read /home/mydomain/.cpan/sources/modules/02packages.details.txt.gz
Database was generated on Tue, 06 Apr 2004 05:51:16 GMT
CPAN: HTTP::Date loaded ok
Going to read /home/mydomain/.cpan/sources/modules/03modlist.data.gz
Warning: Cannot install Net::DNS::Resolver, don't know what it is.
Try the command

i /Net::DNS::Resolver/

to find objects with matching identifiers.

Anyone know what this means?

Thanks.

Denis

denis
04-06-2004, 10:18 PM
Never mind the last message. I just had to make it 'install Net::DNS' (without the '::Resolver').

Now when running:

$ /sa/bin/spamassassin --lint -D

I get one debugging error as follows:

debug: running body-text per-line regexp tests; score so far=1.27
Failed to compile body SpamAssassin tests, skipping:
(syntax error at /sa/share/spamassassin/20_porn.cf, rule PORN_GALLERIES, line 11, near "sub hurricane-"
Can't use global @_ in "my" at /sa/share/spamassassin/20_porn.cf, rule PORN_GALLERIES, line 13, near "( @_ "
syntax error at /etc/mail/spamassassin/local.cf, rule hurricane-map_SITE, line 9, near "}
}"
)


Is this something to be worried about?

Thanks again!

Denis

jalal
04-07-2004, 02:27 AM
Hi Denis

Glad to see Fayez has been working the night shift again. :)

I suspect the error is in your /etc/mail/spamassassin/local.cf file (although it mentions the other rules files). Comment out the lines in local.cf that mentions hurricane-map.

HTH

denis
04-07-2004, 06:55 AM
Here's are the lines from local.cf:



body hurricane-map_SITE /hurricane-map\.com/
describe hurricane-map_SITE Links to hurricane-map.com site.
score hurricane-map_SITE 10.0

Thanks a million for all the help!

Denis

jalal
04-07-2004, 07:34 AM
maybe it doesn't like the '-' in the tag, try using hurricane_map_SITE instead.
And escaping it in the regex, like: "hurricane\-map\.com"

HTH

jonvoss
06-10-2004, 12:39 PM
I've been reading through this thread and others regarding the upgrade to SpamAssassin 2.63. All of your notes have been immensely helpful.

I'm getting stuck early on in the process however, with Jalal's recommendation to add the perl5lib directory.

The main problem for me seems to be when I get into CPAN's configuration and try to use "o conf" to set up the makepl_arg, it saves the settings only until I exit CPAN. Once I get back in, there's nothing there.

Does anyone have any ideas on this?

Thanks, Jon

FZ
06-10-2004, 01:38 PM
You can edit the settings directly, or delete them all to give you a fresh start... See http://forums.westhost.com/phpBB2/viewtopic.php?p=9126#9126

jonvoss
06-10-2004, 03:28 PM
Thanks for the link Fayez. I gave it a fresh start and followed the direction to a T. Still no luck. When I make install MakeMaker through CPAN it still puts it in the .cpan build directory, and there are no changes to the perl5lib directory. SpamAssassin still complains about the MakeMaker and finally writes it with MakeMaker 5.41 rather than the latest 6.21 I just installed.

Any idea what I could be missing? Does it matter where the .cpan directory is?

FZ
06-10-2004, 03:35 PM
Weird... It should work if you have followed the entire process as in that thread. I don't think the location of .cpan matters, and I don't think you need to change that anyway... All you need to really change is the location that the Perl modules are installed to, as you do not have write privileges to the default ones. The only thing I can think of is that your perl5lib is not being picked up properly: have you added it to your .bashrc? Does typing "perl -V" (at an SSH "command prompt") reveal your custom perl5lib location?