Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Setting up Spamassassin with procmail
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
OverrideX
n00b
n00b


Joined: 09 Jul 2002
Posts: 8

PostPosted: Tue Jul 09, 2002 11:31 am    Post subject: Setting up Spamassassin with procmail Reply with quote

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
View user's profile Send private message
rphillips
Retired Dev
Retired Dev


Joined: 18 Apr 2002
Posts: 92

PostPosted: Tue Jul 09, 2002 9:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
alec
Apprentice
Apprentice


Joined: 19 Apr 2002
Posts: 270
Location: Here

PostPosted: Tue Jul 09, 2002 10:21 pm    Post subject: Reply with quote

Dumb question: I see that there is an /etc/init.d/spamd - do I need to start that?
Back to top
View user's profile Send private message
rphillips
Retired Dev
Retired Dev


Joined: 18 Apr 2002
Posts: 92

PostPosted: Tue Jul 09, 2002 11:10 pm    Post subject: Reply with quote

no need to if you use the procmail filter
Back to top
View user's profile Send private message
alan
n00b
n00b


Joined: 24 Jun 2002
Posts: 8

PostPosted: Wed Jul 10, 2002 1:10 am    Post subject: more on .forward Reply with quote

"|IFS=' ' && p=/usr/local/bin/procmail && test -f $p && exec $p -Yf- || exit 75 #`whoami`"
Back to top
View user's profile Send private message
OverrideX
n00b
n00b


Joined: 09 Jul 2002
Posts: 8

PostPosted: Wed Jul 10, 2002 10:29 am    Post subject: Reply with quote

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
View user's profile Send private message
col
l33t
l33t


Joined: 08 May 2002
Posts: 820
Location: Melbourne - Australia

PostPosted: Sun Jul 13, 2003 1:07 am    Post subject: Reply with quote

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
View user's profile Send private message
SimianRage
n00b
n00b


Joined: 03 Oct 2002
Posts: 30
Location: Indiana

PostPosted: Sun Jul 20, 2003 6:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum