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)