Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Postfix & spamassassin & procmail setup and theory
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
MacMasta
Guru
Guru


Joined: 18 Apr 2002
Posts: 545
Location: Anchorage, AK

PostPosted: Wed Jan 15, 2003 4:26 am    Post subject: Postfix & spamassassin & procmail setup and theory Reply with quote

I've done extensive google and forum searching on this, and it hasn't quite made sense yet, so here goes:

I've got a little machine that recieves and sends mail using postfix, and I want to set up spam filtering (using spamassassin) and folder re-direction and such (procmail).

The "pipeline" should look like this, as I understand it:

mail comes into system -> postfix -> procmail -> spamassassin -> procmail (for the rest of the filtering) -> ~/.maildir

I see that main.cf for postfix has a "mailbox_command" function that suggests procmail - and I know that I can call spamassassin from procmail very easily. However, every user should have their own ~/.procmailrc, right? How do I configure postfix's mailbox_command to make sure it uses the .procmailrc of the user who is receiving the mail?

I assume that I'll need to tell procmail to put things in pine's mail directory, not into directories in ~/.maildir - but that can't be too hard.

Is my understanding of the process sound? How do I correctly configure postfix?

Corollary(sp?) question: I'll be using an almost identical setup on another machine, but with fetchmail/getmail getting mail from pop3 accounts.
Does the order of events on that system look like:

1) getmail -> postfix -> procmail -> spamassassin -> procmail -> ~/.maildir
or does getmail/fetchmail bypass postix (which would require me to call procmail from .fetchmailrc or .getmailrc somehow), and result in:
2) getmail -> procmail -> spamassassin -> procmail -> ~/.maildir.
?


Thanks for the help!


~Mac~
Back to top
View user's profile Send private message
fyerk
Apprentice
Apprentice


Joined: 17 Sep 2002
Posts: 212
Location: Atlanta, GA

PostPosted: Wed Jan 15, 2003 12:21 pm    Post subject: Reply with quote

I think the easiest way to do this is to have procmail as the mailbox command and then pipe incoming email through SpamAssassin on a per user basis.

/etc/postfix/main.cf
Code:

mailbox_command = /usr/bin/procmail


$HOME/.procmailrc
Code:

# Procmail Recipie File

DEFAULT="$HOME/.maildir/"
MAILDIR="$HOME/.maildir/"

# Spam Detection
SPAM_FOLDER="$HOME/.maildir/.spam/"

:0 fw
| /usr/bin/spamc -f

:0
* X-Spam-Status: Yes
$SPAM_FOLDER


Note that this assumes you're using Maildir style mailboxes (e.g. Courier-IMAP).

This also requires SpamAssassin to be running as a daemon, so you'ld need to run the following commands to start it and make sure it starts on reboot.
Code:

# /etc/init.d/spamd start
# rc-update add spamd default

_________________
-David
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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