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