5 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] need help with 'to' i...
FromSent OnAttachments
Dmitriy MiksIrNov 21, 2005 3:33 am 
Jay LeeNov 21, 2005 7:05 am 
Dmitriy MiksIrNov 21, 2005 8:11 am 
Jay LeeNov 21, 2005 8:32 am 
Dmitriy MiksIrNov 22, 2005 11:52 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] need help with 'to' in 'include'Actions...
From:Jay Lee (jl@pbu.edu)
Date:Nov 21, 2005 7:05:39 am
List:net.sourceforge.lists.courier-maildrop

Dmitriy MiksIr said:

Look my maildroprc, please (maildrop started as 'maildrop maildroprc`):

import HOST ... other imports import USER_MAILDIR

DEFAULT = $USER_MAILDIR

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

exception { include "${DEFAULT}../.maildrop" }

to $DEFAULT

Now, if user's .maildrop exists with 'to`, message deliver twice - in included file and in maildroprc. What i need say for use deliver in maildroprc only if user's .maildrop not exists, or exists without 'to`?

First, spamc does it's own size checking. The default size is 250k so you can save a little by removing the if $size statement and adding -s 100000 to the spamc line.

Now regarding your main issue, try using a little bash test to see if the file exists or not:

if ( `test -f ../.maildrop` ) { exception { include "../.maildrop" } } else { to $DEFAULT }

This way, only one either the include statement is executed or the "to $DEFAULT" is executed but there's no chance both will be executed. You might need to fiddle with it a little but the general idea should be good.

Jay