6 messages in net.sourceforge.lists.courier-maildropRE: [maildropl] if/else problems
FromSent OnAttachments
Charles J. BoeningMar 17, 2002 7:11 pm 
Charlie WattsMar 17, 2002 7:58 pm 
Charles J. BoeningMar 17, 2002 8:21 pm 
Charlie WattsMar 17, 2002 8:38 pm 
Charles J. BoeningMar 17, 2002 8:46 pm 
Mark WeinemMar 19, 2002 11:06 am 
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] if/else problemsActions...
From:Charles J. Boening (char@theboenings.com)
Date:Mar 17, 2002 8:46:41 pm
List:net.sourceforge.lists.courier-maildrop

Think I finally got it. Decided to use sqwebmail to generate the same rule and see what it did. I've stripped out the full path to the maildir and some of the comments.

Using your suggestion and not using an else seems to work as well. I take it that it's like have a default if nothing else happens rule.

Here's what I ended up with:

import EXT import HOST

if ($SIZE < 262144) { xfilter "/usr/bin/spamc -p 1783 -f -u $EXT@$HOST" }

if ((/^X-Spam-Flag:.*YES/)) { to "./Maildir/.SPAM/" }

to "./Maildir/"

Notice the extra parenthesis around the regex and the "." between the ":" and "*".

Anyway, it works.

Thanks for your help

Chrlie

-----Original Message----- From: cour@lists.sourceforge.net [mailto:cour@lists.sourceforge.net] On Behalf Of Charlie Watts Sent: Sunday, March 17, 2002 8:39 PM To: Charles J. Boening Cc: cour@lists.sourceforge.net Subject: Re: [maildropl] if/else problems

On Sun, 17 Mar 2002, Charles J. Boening wrote:

Maildrop appears to execute properly (spam gets tagged) with the following:

import EXT import HOST

xfilter "/usr/bin/spamc -p 1783 -f -u $EXT@$HOST" to "./Maildir/"

I want to add a test for "X-Spam-Flag: YES" in the header. That brings me to the following:

import EXT import HOST

if($SIZE < 262144) { xfilter "/usr/bin/spamc -p 1783 -f -u $EXT@$HOST" }

if ( /^X-Spam-Flag: YES/ ) { to "./Maildir/.SPAM/" } else { to "./Maildir/" }

What about replacing:

else { to "./Maildir/" }

With

to "./Maildir/"

? Just remove it from the else block, but leave the "to" line ? (I don't understand why it isn't working how you have it)