Koozali.org: home of the SME Server

procmail, spamassasin and 5.5

Len

procmail, spamassasin and 5.5
« on: July 12, 2002, 09:54:10 PM »
does 5.5 use procmail at all?  i want to setup spamassasin and am confused about esmith email system..

John Alamo

Re: procmail, spamassasin and 5.5
« Reply #1 on: July 13, 2002, 04:15:27 AM »
Earlier this week I setup spamassassin/rav/5.5 -- here is what I ended up doing:

1. Install & compile Spam Assassin (I'm assuming you already did this)

2. Instead of using procmail, I used a script called ifspamh (http://www.gbnet.net/~jrg/qmail/ifspamh)

To use this script, you will need to install 822field from the mess822 (http://cr.yp.to/mess822.html)

3. In the user's .qmail file, add the following before ./Maildir/ -->

|ifspamh username-isspam

This will inject the spam mail to username-isspam -- if it isn't spam, it will mail to ./Maildir/

4. You will need to create another .qmail file called .qmail-isspam in the user directory ..

In this file, I simply direct spam mail to ./Maildir/ (infact, I simply copied the original .qmail to .qmail-isspam) -- this way, end users will still get the mail and can filter based on the SPAM tag...

In addition to this, I modified the .qmail template and the user directory skeleton to reflect these changes to automatically apply them to new users...

So far this works fine -- since it does reinject the spam mail to qmail, it runs spam through spamassassin, RAV, etc twice -- on the server I set it up on, this isn't a problem -- for other servers, another solution might be more appropriate..

Daley

Re: procmail, spamassasin and 5.5
« Reply #2 on: July 14, 2002, 08:46:10 PM »
Hi John,

Can u guide me howto install spamassasin on SME 512 box? Thanks so much in advance.

Regards,
Daley

John Alamo

Re: procmail, spamassasin and 5.5
« Reply #3 on: July 15, 2002, 12:03:45 AM »
Here is the method I used to install Spam Assassin on 5.5 (I would assume the same method would apply to 5.1.2) -- I am not making any guarantees that this will work for you or anyone else who reads this and will not be held responsible for any downtime/damage/medical problem/etc..  that is caused directly or indirectly from following these instructions.. And with that said, here is the routine I used..

Access the server command line (login as root) -- Issue the following commands:

mkdir sa
cd sa
wget http://www.spamassassin.org/released/Mail-SpamAssassin-2.31.tar.gz
wget http://www.geckohost.com/spamassassin
wget http://www.gbnet.net/~jrg/qmail/ifspamh
wget http://cr.yp.to/software/mess822-0.58.tar.gz

If you do not have make & gcc -- get them using the following ..

wget http://www.myezserver.com/downloads/mitel/contrib/dev-tools/cpp-2.96-85.i386.rpm
wget http://www.myezserver.com/downloads/mitel/contrib/dev-tools/gcc-2.96-85.i386.rpm
wget http://www.myezserver.com/downloads/mitel/contrib/dev-tools/make-3.79.1-5.i386.rpm
wget http://www.myezserver.com/downloads/mitel/contrib/dev-tools/kernel-headers-2.2.19-7.0.8.i386.rpm
wget http://www.myezserver.com/downloads/mitel/contrib/dev-tools/glibc-devel-2.2.4-19.i386.rpm

These should be in the correct order ..

rpm -ivh make-3.79.1-5.i386.rpm
rpm -ivh kernel-headers-2.2.19-7.0.8.i386.rpm
rpm -ivh glibc-devel-2.2.4-19.i386.rpm
rpm -ivh cpp-2.96-85.i386.rpm
rpm -ivh gcc-2.96-85.i386.rpm

Unzip/tar Spam Assassin / mess822 ...

gunzip Mail-SpamAssassin-2.31.tar.gz
tar -xf Mail-SpamAssassin-2.31.tar.gz
gunzip mess822-0.58.tar.gz
tar -xf mess822-0.58.tar.gz

Go into the Spam Assassin folder ..

cd Mail-SpamAssassin-2.31

Compile Spam Assassin...

perl Makefile.PL
make
make install

Go into the Mess822 folder ..

cd ../mess822-0.58
make
make setup check

Install ifspamh (There should be no need to configure this)

cd ..
chmod 755 ifspamh
cp ifspamh /usr/bin

Install the startup script ..
chmod 755 spamassassin
cp spamassassin /etc/rc.d/init.d
ln -s /etc/rc.d/rc7.d/S99spamassassin /etc/rc.d/init.d/spamassassin
ln -s /etc/rc.d/rc6.d/K40spamassassin /etc/rc.d/init.d/spamassassin

At this point, Spam Assassin is installed -- to run the daemon issue the command:  

/etc/rc.d/init.d/spamassassin start

However, at this point in time, there are no users setup to use SpamAssassin's services --- If you want to only setup individual users, go to their home folders (under /home/e-smith/files/users/username (username = user account name)) and issue the following:

cp .qmail .qmail-isspam
pico .qmail  (or your favorite text editor)
change ./Maildir/ to say the following:

|ifspamh username-isspam   (username = user account name)
./Maildir/

Now when mail is received on that account, it will run through Spam Assassin..

If you want to automatically enable Spam Assassin on new accounts, you will need to do the following (NOTE: I would imagine there is a much better way to accomplish this, but this does work)

cp /home/e-smith/files/users/username/.qmail-isspam /etc/e-smith/skel/user/
mkdir /etc/e-smith/templates-user-custom/.qmail
cp /etc/e-smith/templates-user/.qmail/. /etc/e-smith/templates-user-custom/.qmail/
pico /etc/e-smith/templates-user-custom/.qmail/e-smithForward20

Modify the first if clause:

Original:

if ($EmailForward eq "local")
{
       $OUT = "./Maildir/\n";
}

Modified:

if($EmailForward eq "local");
{
       $OUT = "|ifspamh " . $USERNAME . "-isspam\n";
       $OUT .= "./Maildir/\n";
}

NOTE: Notice the period after the second $OUT ....

Save the changes to the file ..

Spam Assassin should now be installed on the system, automatically starting the daemon when the server boots and automatically enabling on new accounts.. I am currently using it with RAV Antivirus installed and everything is coexisting rather nicely.. :) Hope this helps.

Daley Lay

Re: procmail, spamassasin and 5.5
« Reply #4 on: July 15, 2002, 06:46:16 AM »
Hi John,

Thanks so much. if i understand the sme correctly, the sme already has its own message header, are we upgrade / replace the current msg header handler? if yes, what is the current msg header?

Regards,
Daley

calvin

Re: procmail, spamassasin and 5.5
« Reply #5 on: July 16, 2002, 05:26:35 PM »
Install the startup script ..
chmod 755 spamassassin
cp spamassassin /etc/rc.d/init.d

excuse-me , I think that is as follow :
ln -s  /etc/rc.d/init.d/spamassassin /etc/rc.d/rc7.d/S99spamassassin
ln -s  /etc/rc.d/init.d/spamassassin /etc/rc.d/rc6.d/K40spamassassin
and worked!!!


I tested spamasssasin and I received an error :

delivery 93: deferral: /usr/bin/ifspamh:_/usr/local/bin/spamc:_No_such_file_or_dire
ctory/spamc_returned_temporary_failure/

I try to find what happened .


Calvin

John Alamo

Re: procmail, spamassasin and 5.5
« Reply #6 on: July 16, 2002, 08:09:45 PM »
Try modifying ifspamh:

pico /usr/bin/ifspamh

and changing the line "SPAMC=/usr/local/bin/spamc" to SPAMC=/usr/bin/spamc

This was another error in my instructions.

Joe

david

Re: procmail, spamassasin and 5.5
« Reply #7 on: July 17, 2002, 10:14:16 PM »
I been following this thread.. But.  Help any one

The last statement.
/etc/rc.d/init.d/spamassassin start

display the following error.

bash:  /etc/rc.d/init.d/spamassassin: bad interpreter: No such file or directory

if I go to that dir and type spamassassin start
the program wait for my input and takes anything till I type ^z or ^c.

Thanks
David Fox

david

Re: procmail, spamassasin and 5.5
« Reply #8 on: July 17, 2002, 10:14:39 PM »
I been following this thread.. But.  Help any one

The last statement.
/etc/rc.d/init.d/spamassassin start

display the following error.

bash:  /etc/rc.d/init.d/spamassassin: bad interpreter: No such file or directory

if I go to that dir and type spamassassin start
the program wait for my input and takes anything till I type ^z or ^c.

Thanks
David Fox

John Alamo

Re: procmail, spamassasin and 5.5
« Reply #9 on: July 18, 2002, 03:06:26 AM »
David -- make sure the spamassassin script is in the correct directory:

ls /etc/rc.d/init.d/spamassassin

should return:

/etc/rc.d/init.d/spamassassin

If it exists, make sure the permissions are set correctly:

chmod 755 /etc/rc.d/init.d/spamassassin

and if all else fails, try re-downloading the spamassassin script (possible corruption, etc..)

david

Re: procmail, spamassasin and 5.5
« Reply #10 on: July 18, 2002, 03:20:15 AM »
I try-ed everything from your last msg. and still get the same errors

I also found in maillog file the following.

Jul 17 17:14:47 mitel spamc[1567]: connect() to spamd failed: Connection refused

I'll re-download everything again tonight and see what happens..

Thanks for the help
David F.

david

Re: procmail, spamassasin and 5.5
« Reply #11 on: July 19, 2002, 01:10:57 AM »
John,
I dump the hard drive and re-loaded e-smith 5.5 from step 1.
I created one mail account called david
I cut and paste each part of your how-to.

Still get the same error..

Oh well, Unless I fig. this error out, the spam keep coming..
Does someone wants to go remote and take a look?

Again thanks
David

alex dworschak

Re: procmail, spamassasin and 5.5
« Reply #12 on: July 20, 2002, 03:18:33 PM »
same here,

any positive news ???

John Alamo

Re: procmail, spamassasin and 5.5
« Reply #13 on: July 20, 2002, 06:08:20 PM »
There was an error with the spamassassin startup script -- it is corrected now .. grab it again:

wget http://www.geckohost.com/spamassassin

and copy it to the init.d directory and everything should work..

chris meredith

Re: procmail, spamassasin and 5.5
« Reply #14 on: July 21, 2002, 02:18:43 AM »
I am trying this out on 5.1.2, and am not sure what I am doing  wrong.  I compiled and installed everything.  I started Spamassassin.  I ran spamc with the sample messages included with Spamassassin and it works.  I can also cat a message from my Maildir to spamc and it works.  If I cat a message to the ifspamh I get:

"spamc returned temporary failure"

Any ideas?