# spamassassin don't work (spamd)

## Mala Zaba

I wont to start spamassassin in daemon mode (spamd)... but i don't no if me... it's don't work.  I send the spam example and I receive in my box.  To start spamd, I type spamd -a -c -d   I need other think?    :Mad: 

----------

## Damasz

You also have to invoke the client (spamc) for incoming mail. There are several ways of doing this, take a look at this site:

http://spamassassin.org/sitewide.html

I would suggest the procmail version.

I've installed spamassassin on our company mailserver about 6 months ago, and it's working great! It filters more than 95% of our spam messages, we like it a lot!   :Very Happy: 

Good luck!

----------

## rphillips

I also use the procmail version... I concur; it works like a charm.

----------

## Mala Zaba

ok... I need help....

My mail system run on postfix, courier-imap, squirrelmail

Now, I make this:

I start my spamd with a script:

cat /etc/init.d/spamassassin

#!/sbin/runscript

depend() {

        need net

}

start() {

        ebegin "Starting spamd"

        /usr/bin/spamd -a -c -d -F 0

        eend $?

}

stop() {

        ebegin "Stopping spamd"

        /usr/bin/pkill -9 -x -u 0 spamd

        eend $?

}

I make a /etc/procmailrc

cat /etc/procmailrc

:0fw

| spamc

And i put this in /etc/mail/spamassassin/local.cf

cat /etc/mail/spamassassin/local.cf

skip_rbl_checks 1

required_hits 5

auto_report_threshold 30

rewrite_subject 0

report_header 1

use_terse_report 1

defang_mime 0

And when I send the spam example... I receive in my mail box

What I forgot?

Thanks for your help

----------

## leej

I'm using Postfix, Procmail, Fetchmail & Mutt.  A five line recipe in procmail is all it takes to get SpamAssassin working:

```

:0fw

| spamassassin -P

:0

* ^X-Spam-Status: Yes

spam/

```

That's for Maildir delivery.  For mbox delivery, you'd remove the trailing slash off the final 'spam' line.

I wonder how long it will be before a Vipul Razor ebuild comes along?  Spam Assassin is a lot more powerful with it and you can use a keybinding in Mutt to automatically report anything that slips past the net.  I really need to take some time to learn how to make ebuilds so I can do this myself.  It would beat the downloading of the tarball, untarring, compiling and installing which all seems a bit sloppy and disorganized when you have tools like Portage.  :Wink: 

----------

## Mala Zaba

 *leej wrote:*   

> I'm using Postfix, Procmail, Fetchmail & Mutt.  A five line recipe in procmail is all it takes to get SpamAssassin working:
> 
> ```
> 
> :0fw
> ...

 

This code run with spamd?   I put this code in my /etc/procmailrc... but when i send the spam example... I have this message in my mailbox.  Are you the single user on your box... because, i would like use spamassassin on a mini sever 10-15 users)... and i don't found any information on spamassassin whith spamd for a server system

----------

## leej

 *Quote:*   

> This code run with spamd?

 

No.  Fetchmail gets the mail, Postfix delivers it -> to -> Procmail which filters then delivers it on a per user basis.  The procmail recipe goes in the users ~/.procmailrc (with their other recipes) not.....

```
I put this code in my /etc/procmailrc...
```

....absolutely not in the global file!  Be careful with procmail!  :Wink:   I got that per user recipe from the Spam Assassin website in my pre-gentoo days btw.  Recommended by them.

----------

## Mala Zaba

 *leej wrote:*   

> No.  Fetchmail gets the mail, Postfix delivers it -> to -> Procmail which filters then delivers it on a per user basis.  The procmail recipe goes in the users ~/.procmailrc (with their other recipes) not.....

 

Ok, I start to understand... I miss a prog or i have the wrong prog.

 Procmail is equivalent to courier-imap?

And how you start your spamassassin, with the daemon or when you are loggin, you start it by command

----------

## Damasz

 *Quote:*   

> 
> 
> Ok, I start to understand... I miss a prog or i have the wrong prog.
> 
>  Procmail is equivalent to courier-imap?

 

No, procmail is a tool that sits in between postfix and courier-imap. You can use it to perform various tasks on your mail. For instance, you can put incoming mail in a seperate folder based on the sender. And you can make spamassassin evaluate all your mail.

So, first thing you have to do is emerge procmail.

If you want to use spamassassin for all your users, put the spamc section in your /etc/procmailrc. Or, if you want to activate it on a per-user basis, put it in the ~/.procmailrc of the users.

If you want to test if spamassassin works, test it like this:

```

spamassassin -t < sample-nonspam.txt > nonspam.out

spamassassin -t < sample-spam.txt > spam.out

```

Check the *.out files to see if spamassassin detected the spam.

After that, you can test procmail by sending yourself some spam email.

----------

## Mala Zaba

 :Very Happy:   :Surprised:   :Razz:   :Smile:   Thanks leej and damasz... 

spamassassin work in per-user mode...  What difference between per-user mode and site-wide.  I don't have much users...  I think it's better in per-user mode, it's more flexible than site-wide....

When I have a time... I try site-wide with spamd....

thanks !  :Wink: 

----------

