On Wednesday 31 March 2004 16:49, Ricardo Kleemann wrote:
>         xfilter "/usr/bin/spamc"
>         if (/^X-Spam-Level: \*\*\*\*\*/)
>         {
>                 echo "Spam detected, message dumped"
>                 EXITCODE=77
>                 exit
>         }
> 
> But if spamd is not running, or experiencing problems then
> spamc simply returns, and then the spam is delivered
> normally. Is there a way I can detect a problem and defer
> delivery?

Does spamc has a specific exit code if it can't connect to the daemon?  (I 
don't run it so I'm not sure.)  If it does then you can use the $RETURNCODE 
variable to defer delivery.  So if spamc returns a -1 when it can't talk to 
the daemon then you could write something like this

     xfilter "/usr/bin/spamc"
     if ( $RETURNCODE == -1 )
     {
       EXITCODE = "1"
       exit
     }

I'm not sure if setting the EXITCODE is the "right" way to defer a message.  
Someone else should confirm that first.  

Jeff Jansen



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to