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?

John Alamo

Re: procmail, spamassasin and 5.5
« Reply #15 on: July 21, 2002, 05:06:04 AM »
I tried the same thing (I think):

[root]# cat sample-spam.txt | /usr/bin/ifspamh username
spamc returned temporary failure

This is on a system where SpamAssassin is working properly.

Setup the .qmail and .qmail-isspam files in your user directory per the instructions and use the following command to test:

sendmail username < sample-spam.txt

chris meredith

Re: procmail, spamassasin and 5.5
« Reply #16 on: July 21, 2002, 07:39:14 PM »
My .qmail file looks like this:

|ifspamh meredith-isspam
./Maildir/

I also tried:

|/usr/bin/ifspamh meredith-isspam
~meredith/Maildir/


My .qmail-isspam looks like this:

./Maildir/

I also tried:

~meredith/Maildir/

I did a "sendmail meredith < sample-spam.txt" and "sendmail meredith < sample-nospam.txt" and sent myself a regular mail from my workstation.  All are in the mail queue if I do a qmail-qread, but they never get delivered.

If I change my .qmail to be:

|/usr/bin/spamc |/usr/bin/maildir ./Maildir

I get the message with all the X-Spam headers and all.  No check for error codes or anything that way, but it does work for me, so spamc seems to be able to connect to spamd and everything.

Since I am the only one posting about problems I am going to guess its just something weird in my config.  The box is fairly hacked up.  Thanks for all your help.

alex dworschak

Re: procmail, spamassasin and 5.5
« Reply #17 on: July 26, 2002, 02:23:13 AM »
I set up spamassassin as is described above and spamc spamd are running, but wenn I enable:  |ifspam user-isspam ./Maildir/
in the .qmail   -file NO mail is send to the user !!!!. wenn I comment it out again, EVERY mail is received again!

somebody got a hint for me ?

Rich

Re: procmail, spamassasin and 5.5
« Reply #18 on: August 15, 2002, 03:56:30 AM »
Has anyone been able to get this to work,

i get the error "/bin/sh:_/usr/ifspamh:_No_such_file_or_directory/" with .qmail set to

|ifspamh user-isspam
./Maildir/

If i change it to read

/usr/bin/ifspamh rm-isspam
./Maildir/

i get the error
/usr/bin/ifspamh:_tail:_command_not_found//usr/bin/ifspamh:_822field:_command_not_found//usr/bin/ifspamh:_sed:_command_not_found//usr/bin/ifspamh:_822field:_command_not_found//usr/bin/ifspamh:_wc:_command_not_found//usr/bin/ifspamh:_[:_-gt:_unary_operator_expected/spamc_returned_temporary_failure

Anyone got any ideas?

Rich

Arby Edi

Re: spamassasin and 5.1.2
« Reply #19 on: August 28, 2002, 05:33:37 AM »
wget http://cr.yp.to/software/mess822-0.58.tar.gz

I can't get to this server, any ideas or am I lame??

Also, I'm trying to set this up on 5.1.2.  Did this become successful for anybody?

John Alamo

Re: spamassasin and 5.1.2
« Reply #20 on: August 28, 2002, 06:58:20 AM »
I posted the file to another server. Hope this helps.  As far as 5.1.2 -- I think I heard several people were able to get it up and running successfully.

wget http://www.jumbographics.com/mess822-0.58.tar.gz

Arby Edi

Re: spamassasin and 5.1.2
« Reply #21 on: August 29, 2002, 06:28:58 AM »
Thanx John got it up and running fine and testing on a single user account but now I'm lost.  Leaving it with defaults, I sent an email from outlook express using the same domain as the server and the email didn't go through.....but it also didn't bounce back or go anywhere.   This is my question, and it may be a spamassassin.org question or RTFM answer, but what now and where are the rules?  I thought the message goes through and notifies that it is now considered spam or something liek that.

chris meredith

Re: spamassasin and 5.1.2
« Reply #22 on: September 02, 2002, 07:49:11 PM »
Sounds like you are having the same problem as me.  Check this post from earlier in the thread:

http://forums.contribs.org/index.php?topic=14458.msg55117#msg55117

Arby Edi

Re: spamassasin and 5.1.2
« Reply #23 on: September 02, 2002, 11:22:03 PM »
Ok checked the above thread messages and it looks like a few people are having the same issue without resolution.  Looks like i'll be heading for a different spam product....any ideas?

Jaco Bongers

Re: spamassasin and 5.1.2
« Reply #24 on: September 03, 2002, 12:33:30 AM »
Have you tried the spamassassin/procmail combination. I have successfully
implimented it on my server (SME 5.5).

Jaco

Arby Edi wrote:
>
> Ok checked the above thread messages and it looks like a few
> people are having the same issue without resolution.  Looks
> like i'll be heading for a different spam product....any ideas?

Arby Edi

Re: spamassasin and 5.1.2
« Reply #25 on: September 03, 2002, 12:43:02 AM »
No I haven't but i'm running 5.1.2 and would hate to screw something up. Besides the fact that i'm quite rough with Linux and SME still so unless there is a howto with details, I doubt I'd be able to even play with it much.

the3dman

Re: spamassasin and 5.1.2
« Reply #26 on: September 03, 2002, 10:44:55 PM »
So, what is the spamassassin/procmail combination? Would you mind posting the basics to get that method up and running? I also have read through everything here and a few other places. I get the same problems as Chris is having. NO mail is going through.
I was using procmail on 5.5, so this may be a better solution.

Jaco Bongers

Re: spamassasin and 5.1.2
« Reply #27 on: September 04, 2002, 02:51:00 PM »
see http://e-smith.caw.co.za/phorum/read.php?f=1&i=22&t=22

the3dman wrote:
>
> So, what is the spamassassin/procmail combination? Would you
> mind posting the basics to get that method up and running? I
> also have read through everything here and a few other
> places. I get the same problems as Chris is having. NO mail
> is going through.
> I was using procmail on 5.5, so this may be a better solution.

Jaco Bongers

Re: spamassasin and 5.1.2
« Reply #28 on: September 04, 2002, 02:57:45 PM »
Oops: make  that URL

http://www.caw.co.za/phorum/read.php?f=1&i=22&t=22

Jaco Bongers wrote:
>
> see http://e-smith.caw.co.za/phorum/read.php?f=1&i=22&t=22
>
> the3dman wrote:
> >
> > So, what is the spamassassin/procmail combination? Would you
> > mind posting the basics to get that method up and running? I
> > also have read through everything here and a few other
> > places. I get the same problems as Chris is having. NO mail
> > is going through.
> > I was using procmail on 5.5, so this may be a better
> solution.

brian read

Re: spamassasin and 5.1.2
« Reply #29 on: September 04, 2002, 02:58:10 PM »
That URL fails with a "unable to determine IP..." message.

Brian

chris meredith

Re: spamassasin and 5.1.2
« Reply #30 on: September 13, 2002, 09:43:39 AM »
I have been using:

|/usr/bin/spamc |/usr/bin/maildir ./Maildir

in my .qmail file for a while now and it seems to work fine.  I am running a hacked up 5.1.2.  

Make sure you have safecat (thats where the /usr/bin/maildir program comes from).

http://www.nb.net/~lbudney/linux/software/safecat.html

So far I am using Spamassassin to tag the mail, then the Outlook rules wizard to seperate it into folders (I pop all my mail, so IMAP folders with procmail isn't an option).  I am also using the .spamassassinrc file to setup per-user whitelists, and to change the score requirements.  Since I setup the whitelists for my distrobution lists and such I might be able to just delete anything tagged as spam.  I am not brave enough yet though.

I also have ipchains rules to reject connections on port 25 from the Asian IP block and Russia.  I am about as spam free as I expect I can get.

Steve Morris

Re: procmail, spamassasin and 5.5
« Reply #31 on: October 02, 2002, 03:04:13 AM »
Can i use Spamassasin and procmail together the reason i ask is that every time i set-up  a rule inthe user-manager front end it changes the .qmail file back to it default value of ./Maildir/ and removes the |ifspamh steve-isspam,
Is there anyway around this. i have followed the how to on this forum and I have managed to get it working without any problem except this one and the fact that as far as i can work out in the line      if($EmailForward eq "local");    in the     e-smithForward20 it does not like the ; at the end of it. the error message i get is     Program fragment delivered error syntax error at /etc/e-smith/templates-user-custom//.qmail/e-smithForward20 line 25, at EOF
syntax error at /etc/e-smith/templates-user-custom//.qmail/e-smithForward20 line 30, near "}
    elsif"''

Any help would be appreciated.

Steve

brian read

Re: spamassasin and 5.1.2
« Reply #32 on: October 17, 2002, 02:02:32 PM »
I have just tried this, and can't get past first post, i get:

error: failed dependencies:
perl(HTML::Parser) is needed by perl-Mail-SpamAssassin-2.42-3

when I try to install the spamassassin RPMs (this is on 5.5).

also tried 2.41 as well - same problem.

I tried to add HTML::Parser using CPAN, but that failed on a "make".  

Anyone got any ideas?

cheers

Brian

Lars Kjeldsen

Re: procmail, spamassasin and 5.5
« Reply #33 on: October 27, 2002, 11:40:16 PM »
Hi there.

I just tryed to download

http://www.gbnet.net/~jrg/qmail/ifspamh

But i'ts not possible:-(

Is there any one  there can mail me that file..Please..


Best regards

Lars Kjeldsen

Garrett Lindsay

Re: procmail, spamassasin and 5.5
« Reply #34 on: October 29, 2002, 01:37:50 AM »
John,
First of all - thank you for all this great info.  I have installed the latest version of spamassassin on my system and it is working GREAT!  

What I was wondering is if there is an easy way to make this run for all users so that I wouldn't have to modify each one of their .qmail files?

Thank you
Garrett Lindsay

brian read

Re: procmail, spamassasin and 5.5
« Reply #35 on: October 29, 2002, 12:26:11 PM »
Garrett

If you look here, then you wil find a Spamassassin howto that deals with this:

http://www.caw.co.za/phorum/read.php?f=1&i=22&t=22

but be sure to read all the messaages in the thread!

It is working fine for me (5.5).

Cheers

Brian

Lars Kjeldsen

Re: procmail, spamassasin and 5.5
« Reply #36 on: October 30, 2002, 12:34:09 AM »
Thanks to all who has send ifspamh to me.

Best regards
Lars Kjeldsen

nate

Re: procmail, spamassasin and 5.5
« Reply #37 on: December 18, 2002, 12:02:04 AM »
Me too...!
 
>Author: alex dworschak (dlex_AT_gmx.net)
>Date:   07-25-02 17:23

>I set up spamassassin as is described above and spamc spamd are running, but >wenn I enable: |ifspam user-isspam ./Maildir/
>in the .qmail -file NO mail is send to the user !!!!. wenn I comment it out again, >EVERY mail is received again!

>somebody got a hint for me ?
 
...Did you ever solve this???

David

Re: procmail, spamassasin and 5.5
« Reply #38 on: December 18, 2002, 12:42:06 AM »
Are you putting in the usersname....
|ifspam david-isspam
./Maildir/.    

Right?

I have been using it for about 6 to 8 months now.
I not too much of a pro on Linux, but it seems to work for me..