Hi Louis,

Please forgive the delay in responding.  I was out of touch for a period of
time.


> -----Original Message-----
> From: Louis LeBlanc

> After rereading a lot of procmail docs, I've found that the exitcode
> is saved when the 'w' flag is used in the procmail recipe as follows:

I was moving in this very same direction.


> :0fw
> * !^Subject:.*SAtalk
> | spamc -u "$LOGNAME"
> 
> Also, the $? variable should hold that exitcode, so following that
> recipe with
> 
> SCANNED=$?
> 
> *should* (meaning untested so far :) cause the following recipe to
> work only if spamc failed to connect to spamd:
> 
> :0fw
> * ? test ! $SCANNED
> | spamassassin -a
> 
> That assumes I've gotten the syntax of this last recipe correct -
> particularly the second line.

I follow you to the end.  However, I found references by Philip Guenther
(Procmail list maintainer) to suggest the following:


        :0 w
        * ? progname
        | do this if exitcode == 0

        # save the return code in a testable variable
        ret = $?

        # Need the 'E' here as ret will contain the return code of
        # the action instead of 'progname' if 'progname' succeeded.
        :0 E
        * ret ?? ^^1^^
        | do this if exitcode == 1

        :0 E
        * ret ?? ^^2^^
        | do this if exitcode == 2

        :0 E
        | otherwise, do this


If we use that strategy, we might be able to experiment with code as
follows:

:0fw
* !^Subject:.*SAtalk
| spamc -u "$LOGNAME"

SCANNED=$?

:0 Efw
* SCANNED ?? ^^0^^
| spamassassin -a


I was wondering why we could not do the following:

:0
* !^Subject:.*Satalk
{
   :0fw: spamassassin.lock
   * < 256000
   | spamc

   :0 efw: spamassassin.lock
   * < 256000
   | spamassassin -a
}

Shouldn't the e mean execute if the previous recipe's condition(s) matched
but there was an error in the action?  What do you think?

By the way, the SA FAQ suggests using a lock.  I don't know if spamc
benefits from the lock but I use it anyway.
  # The lock file ensures that only 1 spamassassin invocation happens
  # at 1 time, to keep the load down.
  #
  :0fw: spamassassin.lock
  * < 256000
  | spamassassin

--Larry



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to