# Spamassassin :/

## Sephiroth81

I know that there are plenty of guides showing how to install Spamassassin. But in my case I don't want to run any antivirus. I need only spamassassin. I run postfix+courier-imap. The problem is that my server is already working and I don't want to ruin everything by checking tons of howtos and see if they run or not. Could any of You write a simple guide how to install spamassin only. Please  :Sad: 

----------

## magic919

Installing SpamAssassin is as easy as

```

emerge spamassassin

```

last time I checked.

Next you have to invoke it.

Are your users real local users?  Do you drop email into maildirs in their $HOME dirs?

You usually have maildrop on these Courier based servers.  Check postconf mailbox_command.  You'll want this to be the path to maildrop.

Create a user called filter to do the spam filtering.

Edit /etc/maildroprc

```

xfilter "/usr/bin/spamc -u filter"

if (/^X-Spam-Status: Yes.*$/)

{

        to "/dev/null"

}

to ".maildir"

```

This will pass email through SA and anything marked as spam goes in the bin.  You can cut that bit out if you are concerned.

Make sure you've started SA.

```

/etc/init.d/spamd start

```

That'll get you started and is the least invasive method.  I could show you how to install under Postfix as a content_filter but I'm not sure that would be for you.  You can start tweaking SA later...

----------

## Sephiroth81

Yes my users are real local users and I drop their mail into maildirs in their $HOME dirs.

 I don't want any spamassassin autolearning. I'd like to add all rules manualy.

I've emerged spamassassin. 

My mailbox_command is empty. I don't have maildrop. Maybe I should use procmail instead or emerge maildrop?

----------

## magic919

I've used Procmail and Maildrop.  Either will do a fine job.  Slightly different syntax, that's all really.

----------

## k00ma

This is very simple setup which I followed, but how about the razor2? There's this guide in the Gentoo site http://www.gentoo.org/doc/en/mailfilter-guide.xml, 

which says:

```

# emerge razor

(Temporarily set amavis' shell to bash)

# usermod -s /bin/bash amavis

# su - amavis

$ razor-admin -create

$ exit

(Reset the shell to /bin/false)

# usermod -s /bin/false amavis
```

But I don't have amavis, so should I use:

```
su - filter

razor-admin -create 

exit
```

and finally enable razor2, dcc, pyzor etc. in spamassassin config or what?

----------

## magic919

Sounds fine.  But you can use 

su - username -c command

for greater efficiency of effort  :Smile: 

And yes.

----------

## k00ma

Can I use this in my /etc/mail/aliases:

```

spam:      "|/usr/bin/sa-learn --spam --user=filter"

ham:        "|/usr/bin/sa-learn --ham --user=filter"

```

----------

## magic919

That sounds fine.

However, SA is not good at learning.  Also I'm not sure it successfully makes the change to user filter when you do this.

----------

