Sql based Spamassassin with sieve
Darron Froese
darron at froese.org
Mon Sep 15 11:24:41 EDT 2003
On Monday, September 15, 2003, at 01:53 AM, Joakim Ryden wrote:
>>> How about this?
>>> http://au2.spamassassin.org/full/2.5x/dist/sql/README
>>>
>>> works for me.
>>> --
>>> darron froese
>> I started from that page too. My actual problem is How Do I tell cyrus
>> ( or sieve ) to run spamassassin with the user name to whom the mail
>> is addressed
>
> As far as I have been able to understand you don't. You'll have to use
> procmail (or maildrop or whatever is your preference) as your
> LDA/intermediary ( IDA? :) - call SA from procmailrc the first thing
> you
> do and call deliver the last thing you do. But I may be missing
> something.
This is how I do it:
Start spamd so it's listening on localhost:
spamd -d -q -x -u cyrus
In postfix/main.cf:
mailbox_command = /usr/bin/procmail -t -a "$EXTENSION"
mailbox_transport = procmail
In postfix/master.cf:
procmail unix - n n - - pipe
flags=Ru user=cyrus argv=/usr/bin/procmail -t -m USER=${user}
EXTENSION=${extension} /etc/procmailrc
Then in my procmail recipe it sends the email via spamc:
DELIVERMAIL="/usr/lib/cyrus/deliver"
IMAP="$DELIVERMAIL -e -a $USER -m user.$USER"
SPAMIT="$DELIVERMAIL -e -a $USER -m user.$USER.spam"
DROPPRIVS=yes
:0fw
| /usr/bin/spamc -f -u $USER
:0
* ^X-Spam-Status: Yes
| $SPAMIT
# If it's got an extension - put it there.
:0 w
* EXTENSION ?? [^@]
| $IMAP.$EXTENSION
# If there's no extension - put it in the INBOX.
:0 w
| $IMAP
:0 w
{
EXITCODE=$?
HOST
}
That's how one of my boxes does it - it works pretty well.
--
darron froese
principal
nonfiction studios inc.
t 403.686.8887
c 403.819.7887
f 403.313.9233
w http://nonfiction.ca/
e darron at nonfiction.ca
More information about the Info-cyrus
mailing list