| View previous topic :: View next topic |
| Author |
Message |
OverrideX n00b


Joined: 09 Jul 2002 Posts: 8
|
Posted: Tue Jul 09, 2002 11:31 am Post subject: Setting up Spamassassin with procmail |
|
|
Say you want to filter out your spam for your user, spamassassin is an excellent tool to do this, and here's how to do it on gentoo (assuming you already have local delivery working with sendmail):
| Quote: | emerge Mail-SpamAssassin procmail
mkdir /etc/smrsh
ln -s /usr/bin/procmail /etc/smrsh/procmail |
Now as your user...
edit ~/.forward and put in it:
| Quote: | | | /usr/bin/procmail |
edit ~/.procmailrc and put in it:
| Quote: | DEFAULT=$MAIL
:0fw
| /usr/bin/spamassassin -P -a
:0:
* ^X-Spam-Status: Yes
/dev/null |
Note that you might not want -a (autowhitelisting, this averages a email address's score so that people who don't usually get marked as spam don't get marked by accident if they swear a lot in one email or something) also you may want to change /dev/null to a filename, like 'caughtspam' (without the quotes) would make a file in your home directory with any caught spam messages named ~/caughtspam - this way you can make sure it's working as intended, then change it to /dev/null when you're satisfied. -Dan |
|
| Back to top |
|
 |
rphillips Retired Dev

Joined: 18 Apr 2002 Posts: 92
|
Posted: Tue Jul 09, 2002 9:21 pm Post subject: |
|
|
In addition, one can delete the .forward step and automatically
call procmail out of their MTA.
ie:
edit /etc/postfix/main.cf
set the variable mailbox_command = /usr/bin/procmail |
|
| Back to top |
|
 |
alec Apprentice


Joined: 19 Apr 2002 Posts: 270 Location: Here
|
Posted: Tue Jul 09, 2002 10:21 pm Post subject: |
|
|
| Dumb question: I see that there is an /etc/init.d/spamd - do I need to start that? |
|
| Back to top |
|
 |
rphillips Retired Dev

Joined: 18 Apr 2002 Posts: 92
|
Posted: Tue Jul 09, 2002 11:10 pm Post subject: |
|
|
| no need to if you use the procmail filter |
|
| Back to top |
|
 |
alan n00b

Joined: 24 Jun 2002 Posts: 8
|
Posted: Wed Jul 10, 2002 1:10 am Post subject: more on .forward |
|
|
| "|IFS=' ' && p=/usr/local/bin/procmail && test -f $p && exec $p -Yf- || exit 75 #`whoami`" |
|
| Back to top |
|
 |
OverrideX n00b


Joined: 09 Jul 2002 Posts: 8
|
Posted: Wed Jul 10, 2002 10:29 am Post subject: |
|
|
| rphillips wrote: | In addition, one can delete the .forward step and automatically
call procmail out of their MTA.
ie:
edit /etc/postfix/main.cf
set the variable mailbox_command = /usr/bin/procmail |
I'm guessing if you did this and used /etc/procmailrc instead of ~/.procmailrc you could effectively enable spamassassin for all users on your system? |
|
| Back to top |
|
 |
col l33t


Joined: 08 May 2002 Posts: 809 Location: Melbourne - Australia
|
Posted: Sun Jul 13, 2003 1:07 am Post subject: |
|
|
why cant it execute procmail ? I created the symlink ?
----- Transcript of session follows -----
smrsh: "procmail" not available for sendmail programs (stat failed)
554 5.0.0 Service unavailable |
|
| Back to top |
|
 |
SimianRage n00b


Joined: 03 Oct 2002 Posts: 29 Location: Indiana
|
Posted: Sun Jul 20, 2003 6:52 pm Post subject: |
|
|
| alec wrote: | | Dumb question: I see that there is an /etc/init.d/spamd - do I need to start that? |
Running spamd lets you use /usr/bin/spamc instead of /usr/bin/spamassassin - according to man page might be slightly faster to run SpamAssassin in daemonized mode |
|
| Back to top |
|
 |
|