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