4 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] Overridable default b...
FromSent OnAttachments
William PietriJul 25, 2002 8:24 pm 
William PietriJul 25, 2002 8:37 pm 
Sam VarshavchikJul 25, 2002 9:23 pm 
William PietriJul 27, 2002 5:25 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [maildropl] Overridable default behavior in mailfilterrc?Actions...
From:Sam Varshavchik (mrs@courier-mta.com)
Date:Jul 25, 2002 9:23:41 pm
List:net.sourceforge.lists.courier-maildrop

On Thu, Jul 25, 2002 at 08:25:08PM -0700, William Pietri wrote:

I'm now at the point where I'd like to add Spamassassin into the mix. It works fine in my own .mailfilter recipies, happily noticing spam and putting it in a Maildir folder like this:

if (/^X-Spam-Flag: *YES/) to .Spam

The next stage is presumably to put it in /etc/mailfilterrc, making it work for everybody. But what if they don't want to use it? I'd like for them to be able to put something in their .mailfilter to override my magic, but I don't quite see how to do elegantly.

Any suggestions?

You can't. /etc/maildroprc is read before .mailfilter.

Well, appending the following to /etc/maildroprc might work:

SPAMFILTER=1

exception { include "$HOME/.mailfilter" }

if ($SPAMFILTER == 1) { if (/^X-Spam-Flag: *YES/) to .Spam }

to $DEFAULT

This should duplicate the default processing of $HOME/.mailfilter manually, and if $HOME/.mailfilter does not deliver the mail it will go to $DEFAULT, after checking for X-Spam-Flag, which can now be bypassed by resetting SPAMFILTER=0 in .mailfilter.