PDA

View Full Version : upgrading spamassassin using ftp



ccwebb
01-22-2004, 03:13 AM
I recently tried to upgrade spamassassin using instructions provided by jalal at http://www.gnomedia.com/cw/westhost/spamtips.php

The upgrade failed most likely caused by my unfamiliarity at doing unix commands thru SSH.

I am wondering if there is someone out there who could help me with an other approach.

First here is what I did. I tried doing the following commands from jalal's procedure:


$ mkdir src # if it doesn't exist
$ cd src
$ lynx www.spamassassin.org/downloads.html
$ # and download the latest file.
$ # After download
$ tar xzf Mail-SpamAssassin-2.60.tgz
$ cd Mail-SpamAssassin-2.60
$ perl Makefile.PL PREFIX=/sa SYSCONFDIR=/saconf
$ make
$ make install



I did this thru PUTTY. Along the way there were some strange things that happened - perhaps due to my inexperience with unix - but the bottom line was that when I was finished I logged on via ftp and there were no directories name src, sa, or saconf at the "/" level.

So - here is what I am wondering - can't I set up directories (via ftp) named sa, saconfig at the "/" level?

Then download spamassassin to my pc. Then unzip it. Then upload via ftp the unzipped files to /sa and /saconf? Don't I end up the same way as the unix procedure above?

Now the only problem is - is that I do not know which files should end up in /sa and which in /saconf?

I also realize that I must do more work with procmail to get it to point to the upgraded version of spamassassin.

Help anyone?

Charlie

jalal
01-22-2004, 04:03 AM
As far as I can tell, the main thing that the installation procedure takes care of above is the writing of the correct configuration into /sa/bin/spamassassin
The first dozen lines of that script setup where spamassassin finds its libraries and config files.
The bottom level of /sa contains:
drwxr-xr-x 2 mydomain vuser 4096 Dec 28 05:06 bin
drwxr-xr-x 4 mydomain vuser 4096 Nov 6 09:35 lib
drwxr-xr-x 4 mydomain vuser 4096 Nov 6 09:35 man
drwxr-xr-x 3 mydomain vuser 4096 Nov 6 09:35 share

and the /saconf contains:
/saconf/mail/spamassassin/local.cf

Otherwise, with the above caveats in mind, what you want to do should work.
I realized after I did my upgrade, that there many ways of doing it, yours being another possibility. It should also be possible to upgrade the installation using CPAN.
I noticed that CPAN has version 2.63 in there, so I may try upgrading using CPAN, as that would be simpler all round.
HTH

8)

ccwebb
01-23-2004, 09:31 AM
I went back and tried the procedure one more time and still was unable to end up with /sa and /saconf directories.

Below is the error message I am getting from the Makefile.PL part of the procedure. This was trying to install version 2.63. Originally I tried 2.61. Anyone with any thoughts?



[congregationalchurch][~/src/Mail-SpamAssassin-2.63]$ perl Makefile.PL PREFIX=/sa SYSCONFDIR=/saconf

************************************************** *********************
Your version of ExtUtils::MakeMaker does not support PM_FILTER.
The "make" process will almost certainly have many warnings and it is
very likely to fail.

You can use either the CPAN shell or go to
<http://search.cpan.org/search?module=ExtUtils::MakeMaker>
to get an up-to-date version.

Perl 5.6.1 and later versions also include recent versions by default.
************************************************** *********************

What email address or URL should be used in the suspected-spam report
text for users who want more information on your filter installation?
(In particular, ISPs should change this to a local Postmaster contact)
default text: [the administrator of that system]

Writing Makefile for Mail::SpamAssassin
Makefile written by ExtUtils::MakeMaker 5.45
[congregationalchurch][~/src/Mail-SpamAssassin-2.63]$



Charlie

jalal
01-23-2004, 10:27 AM
Did you try installing the latest ExtUtils::MakeMaker?

Otherwise, it sounds like so far you have success.
Now run make.

ccwebb
01-23-2004, 10:54 AM
Did you try installing the latest ExtUtils::MakeMaker?


I do not know how to do that



Now run make.

I did run make. and the next step. But I do not end up with /sa or /saconf.

Charlie

akirby
01-25-2004, 06:56 PM
I am having the same problem that Charlie is/did have.
How do I install MakeMaker. I can go to site using lynx but not sure where to put or how to download.

Thanks,

jalal
01-26-2004, 02:29 AM
Perl includes a tool for upgrading its modules. We call it CPAN (its a script really) and it can be used for installing and upgrading Perl modules such as SpamAssassin and MakeMaker (and hundreds of others).

A good starting place for learning about CPAN is the CPAN homepage found at: www.cpan.org. In particular, look at the FAQ pages for all your answers.

HTH

akirby
01-28-2004, 07:34 PM
OK Finally done! but not without challenges. After going to CPAN and figuring out how to install ExtUtils::MakeMaker it did not work. (had to do with permissions at the root directory) When I reported this to Westhost Tech they suggested I send the situation in writing. The tech promised to look for my message and add comments to it to try to get some action. Well that didn't happen before another tech replied "sorry" MOL. I called back again the next night. After some discussion, the tech promised to forward my situation up line and see what could be done. The next morning I got a reply that they had upgraded MakeMaker to the current version, and that my system should be capable of additional upgrades when necessary.

Tonight I finished the upgrade to SpamAssassin 2.63. Guess I'll know by tomorrow if there is much of an improvement.

At this point, to make changes in the settings, I'll need to do "mannually" rather than on the WestHost control panel I guess?
Thanks for your help jalal.

Alan

ccwebb
01-29-2004, 05:50 AM
Alan:

When Westhost host upgraded MakeMaker did they do that at the global level - so that it applied to all of us - or for just your copy of it?

After reading your post I tried to install 2.63 again and am still getting the message that ExtUtils::MakeMaker does not support PM_Filter and will probably fail...

Charlie

akirby
01-29-2004, 07:22 AM
If you got the "will probably fail" message you don't have it.

My reply from WestHost was "The ExtUtils perl module has been upgraded for you and you will be able to upgrade in the future as well if necessary. If you need anything further, please let us know.
Best regards, Chris Simiskey"

Hope that helps.

ccwebb
01-29-2004, 02:15 PM
Alan:

I was told by "chat" support (probably level 1) that westhost tried to do a global update last night but that it did not work.

They are going to try it again tonight.

Chat support told me that after the global update that I would have to do a webalizer update. I asked why and what does the update do? They had no idea but said that maybe you do (I quoted your message in the chat). Did you do anything with webalizer? I thought that it had to do with stats?

Anyway - I'll try to do the upgrade again tomorrow and then try to get to a higher level support person if it does not work.

Charlie

akirby
01-29-2004, 06:03 PM
I haven't been on WestHost that long, or that familiar with UNIX and Perl, but I rather doubt that webalizer has much to do with it. The issue has to do with a perl command (MakeMaker) that must be a current version to be capable of performing some of the variables on the command line "perl Makefile.PL PREFIX=/sa SYSCONFDIR=/saconf" The way my account was set up when I went to CPAN from within the PuTTy window, it would not allow the installation of the new version of MakeMaker because I did not have permission to access the root directory on the server. What WestHost did was upgrade the MakeMaker module from version 5.45 to 6.21, and said that they enabled me to do future upgrades (increased my permissions or moved files, I'm not sure which)

After 24 hours on the new version it is not perfect, but seems better for sure. I am going to try to figure out the best way to implement the user_prefs. I haven't seen yet where to add keywords or phrases, or if such is possible.


Best of luck.

ccwebb
01-29-2004, 07:09 PM
Alan:

Thanks for the info.

You should be able to add spassassin rules into local.cf which under this setup would be in saconf directory.

Charlie

jalal
01-30-2004, 06:32 AM
To check which files are being used you can, in the shell, type:
$ spamassassin -D --lint < /dev/null

akirby
02-01-2004, 03:31 PM
In order to run the test, you need to be in the current directory with spamassassin or use the line below if you are set up with the configuration in this post. (spamassassin in the /sa/bin directory)

/sa/bin/spamassassin -D --lint < /dev/null

This would be done with a shell such as PuTTy

ccwebb
02-07-2004, 08:11 AM
Last night westhost upgraded my perl module ExtUtils::MakeMaker. So I tried to do the upgrade procedure again this morning.

In summary - I am not ending up with the /sa or /saconf directories. Or if I am, I do not know where to find them.

I am posting my putty log - I apologize for its length - but perhaps someone can see what is happening - for instance there are errors in the logs but i do not know if they are fatal

First I picked up where I was previously getting the error message with ExtUtils and did the Makefile.PL step



[congregationalchurch][~/src/Mail-SpamAssassin-2.63]$ perl Makefile.PL PREFIX=/sa SYSCONFDIR=/saconf
What email address or URL should be used in the suspected-spam report
text for users who want more information on your filter installation?
(In particular, ISPs should change this to a local Postmaster contact)
default text: [the administrator of that system]

Writing Makefile for Mail::SpamAssassin
Makefile written by ExtUtils::MakeMaker 6.21


Then I did $make



[congregationalchurch][~/src/Mail-SpamAssassin-2.63]$ make
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/Replier.pm >blib/lib/Mail/SpamAssassin/Replier.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/Conf.pm >blib/lib/Mail/SpamAssassin/Conf.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/NetSet.pm >blib/lib/Mail/SpamAssassin/NetSet.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/ConfSourceSQL.pm >blib/lib/Mail/SpamAssassin/ConfSourceSQL.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/Bayes.pm >blib/lib/Mail/SpamAssassin/Bayes.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/DBBasedAddrList.pm >blib/lib/Mail/SpamAssassin/DBBasedAddrList.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin.pm >blib/lib/Mail/SpamAssassin.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/PerMsgStatus.pm >blib/lib/Mail/SpamAssassin/PerMsgStatus.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/Reporter.pm >blib/lib/Mail/SpamAssassin/Reporter.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/SHA1.pm >blib/lib/Mail/SpamAssassin/SHA1.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/AuditMessage.pm >blib/lib/Mail/SpamAssassin/AuditMessage.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/Locker.pm >blib/lib/Mail/SpamAssassin/Locker.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/MailingList.pm >blib/lib/Mail/SpamAssassin/MailingList.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/HTML.pm >blib/lib/Mail/SpamAssassin/HTML.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/Win32Locker.pm >blib/lib/Mail/SpamAssassin/Win32Locker.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/ArchiveIterator.pm >blib/lib/Mail/SpamAssassin/ArchiveIterator.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/CmdLearn.pm >blib/lib/Mail/SpamAssassin/CmdLearn.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/PerMsgLearner.pm >blib/lib/Mail/SpamAssassin/PerMsgLearner.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/EncappedMIME.pm >blib/lib/Mail/SpamAssassin/EncappedMIME.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/BayesStore.pm >blib/lib/Mail/SpamAssassin/BayesStore.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/NoMailAudit.pm >blib/lib/Mail/SpamAssassin/NoMailAudit.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/AutoWhitelist.pm >blib/lib/Mail/SpamAssassin/AutoWhitelist.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/PersistentAddrList.pm >blib/lib/Mail/SpamAssassin/PersistentAddrList.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/PhraseFreqs.pm >blib/lib/Mail/SpamAssassin/PhraseFreqs.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/Received.pm >blib/lib/Mail/SpamAssassin/Received.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/TextCat.pm >blib/lib/Mail/SpamAssassin/TextCat.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/Util.pm >blib/lib/Mail/SpamAssassin/Util.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/EncappedMessage.pm >blib/lib/Mail/SpamAssassin/EncappedMessage.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/UnixLocker.pm >blib/lib/Mail/SpamAssassin/UnixLocker.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/Dns.pm >blib/lib/Mail/SpamAssassin/Dns.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/Message.pm >blib/lib/Mail/SpamAssassin/Message.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/EvalTests.pm >blib/lib/Mail/SpamAssassin/EvalTests.pm
/bin/perl build/preprocessor -Mconditional -Mbytes -DPERL_VERSION="5.6.0" -Mvars -DVERSION="2.63" -DPREFIX="/sa" <lib/Mail/SpamAssassin/Locales.pm >blib/lib/Mail/SpamAssassin/Locales.pm
cp spamd/spamd blib/script/spamd
/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/spamd
cp sa-learn blib/script/sa-learn
/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/sa-learn
cd spamd; ./configure --prefix="/sa" --sysconfdir="/saconf" --datadir="/sa/share/spamassassin" --enable-ssl="no"
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
./configure: sort: command not found
./configure: sort: command not found
make: *** [spamd/binaries.mk] Error 1



Then I did the $make install



[congregationalchurch][~/src/Mail-SpamAssassin-2.63]$ make install
cp spamd/spamd blib/script/spamd
/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/spamd
cp sa-learn blib/script/sa-learn
/bin/perl "-MExtUtils::MY" -e "MY->fixin(shift)" blib/script/sa-learn
cd spamd; ./configure --prefix="/sa" --sysconfdir="/saconf" --datadir="/sa/share/spamassassin" --enable-ssl="no"
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
./configure: sort: command not found
./configure: sort: command not found
make: *** [spamd/binaries.mk] Error 1



At the end of this I logged on with CuteFTP and started looking for directories.

In usr/home/congregationalchurch I found the src directory and within it I found the Mail-SpamAssassin-2.63 directory.

But nowhere to be found is the sa or saconf directories. I expected to find them at the "/" level along with /etc and others.

Help!!!!!

Charlie

jalal
02-07-2004, 09:26 AM
You need to install 'sort'. Without it make fails.
You can pick up a copy at
http://www.gnomedia.com/cw/westhost/wh-utils.tgz
Install sort and then try again.

HTH

ccwebb
02-07-2004, 09:48 AM
jalal:

I downloaded wh-utils and unzipped it.

How/where do I install sort? Do I just copy it into /usr/bin as mentioned in your readme file?

Thanks

Charlie

jalal
02-07-2004, 10:11 AM
Just copy sort into /usr/bin or /usr/local/bin

8)

FZ
02-07-2004, 10:45 AM
checking for gcc... no
...
configure: error: no acceptable C compiler found in $PATH

This indicates that you also need to install GCC (GNU Compiler Collection) via your Site Manager: Site Applications > Development > GNU Compiler Collection. Do that, "install" sort as Tim (jalal) points out, and then give it another go, typing make clean before doing your perl Makefile.PL again. Also, you don't necessarily have to install it in /sa and /saconf - you could install it in /usr/local/spamassassin if you like - this will keep the number of folders in / to a minimum as well. Also, SYSCONFDIR isn't really necessary - if you don't specify it, the configuration files will be installed in the PREFIX directory - I find this as the better option since then all the SpamAssassin stuff is in one "location" (directory).

Good luck.

ccwebb
02-07-2004, 11:04 AM
Fayez:

Thanks for the help - I just installed the GNU collection - I have also uploaded sort.

I will start with a make clean!

Since I am not tech heavy I have been following jalal's procedure on his web site. I need "monkey see - monkey do" instructions.

I believe his intent is to do an install in separate directories so one could could easily back out of things if there was a problem.

Thanks again.

Charlie

jalal
02-07-2004, 11:42 AM
Charlie
You may also want to look at the thread under the Perl section on installing Perl modules. It may be simpler to do it that way.

ccwebb
02-07-2004, 11:55 AM
Jalal:

I just finished the update - sucessfully I believe.

I ran the step that lets you look at files that are being used etc. and have some questions there but for now I am investigating them.

I have not yet moved the old spamassassin out of the way.

I am also looking at user_prefs being in /.spamassassin. I know your procedure mentions that so I have to reread what the procedure said.

Thanks a bunch - I am getting there...

Charlie

FZ
02-07-2004, 03:35 PM
Glad you got it working. About the /.spamassassin, it does that because the default user (i.e. your default login name) has / as its home directory. I believe you can change this, either by editing .bashrc or /etc/passwd - I am not sure what negative effects could arise as a result of changing the latter one. Apart from that, I got around my problem - which was that I wanted to run sa-learn for a mail account that was NOT my primary/default - by editing SpamAssassin.pm's default userprefs path and user state directory (you can find the file in PREFIX/lib/site_perl/5.6.0/Mail). Let me know if you need help with that. The only problem with doing this is that you will be overriding the default option, which creates a separate .spamassassin folder (and config files) for each account in its respective home directory - effectively, you will be saying that there is only one place to pull settings from, so if you use SpamAssassin on other accounts, their settings will be pulled from the same place. Kind of defeats the purpose if multiple mail accounts for multiple people is what you intend to do...

ccwebb
02-07-2004, 04:12 PM
Fayez:

Thanks for the offer to help.

After several weeks of trying, I think I will quit while I am ahead.

I took care of some errors I had in local.cf so I believe everything is working and I will take some time and assess what I have done.

You are special and I really appreciate your help!

Charlie

jalal
02-07-2004, 04:12 PM
Glad you got it working. About the /.spamassassin, it does that because the default user (i.e. your default login name) has / as its home directory. I believe you can change this, either by editing .bashrc or /etc/passwd - I am not sure what negative effects could arise as a result of changing the latter one.

You'll find that in .bashrc the users home directory is already set to /home/username.
There are really two homes, the one before .bashrc is read (which is '/') and the one after .bashrc is read ('/home/username').
Play safe, put things like .spamassassin in the / directory.

:wink:

FZ
02-07-2004, 04:40 PM
You're welcome, Charlie - and thanks for the compliment ;)

Thanks for the info/input, Tim.