6 messages in net.sourceforge.lists.courier-maildrop[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:[maildropl] if/else problemsActions...
From:Charles J. Boening (char@theboenings.com)
Date:Mar 17, 2002 7:11:39 pm
List:net.sourceforge.lists.courier-maildrop

I'm trying to write a simple filter to move spam tagged by spamassassin to a special SPAM folder.

System config: Mandrake 8.1 qmail 1.03 (smtp-auth/qmail-queue patched) vpopmail 5.2 maildrop 1.3.7 qmail-scanner 1.10 spamassassin 2.11

I'm calling maildrop like this from my .qmail file: |preline maildrop mailfilter

And I've tried it like this as well: |maildrop mailfilter

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/" }

That generates the following error (message never delivered): delivery 5416: success: mailfilter(13):_Syntax_error./did_0+0+1/

Line 13 is the "else" statement.

If I take the else out and leave just the to "./Maildir/" everything goes to the to "./Maildir/.SPAM/" folder.

Any ideas are greatly appreciated.

Charles