On Tue, 2 Sep 2003, Larry Gilson wrote:

> > > :0fw
> > > * !^Subject:.*SAtalk
> > > | spamc -u "$LOGNAME"
> > > 
> > > SCANNED=$?
> > > 
> > > :0 Efw
> > > * SCANNED ?? ^^0^^
> > > | spamassassin -a
> > 
> > I'm pretty sure that wouldn't work.  The E causes the second 
> > to always be skipped unless the first didn't execute - like 
> > for mail to the SA list.
> 
> I agree.  I only mentioned it because Gunther wrote it.  I was wondering
> if I misunderstood the context.

You misunderstood the context.

The original example was something like

------
:0fw
* ? ONE external program runs here
| TWO external program runs here

STATUS=$?
------

At this point, you don't know whether STATUS is that of ONE or TWO.

However, the flags of the next recipe can differentiate:

E       execute only if ONE failed; STATUS is from ONE.
A       execute if ONE succeeded; STATUS is from TWO.
a       execute if both ONE and TWO succeeded; STATUS is from TWO.
e       execute if ONE succeeded but TWO failed; STATUS is from TWO.

In _your_ first example above, there is only one external program (the
pipe to spamc) so SCANNED must either be from spamc or from some other
earlier recipe that we don't care about.  So in your case you want 
somthing like

:0 Afw
* ! SCANNED ?? ^^0^^
| spamassassin -a

That is, if the subject did not mention SAtalk but the exit status of
spamc was not zero, scan again with spamassassin.

This assumes that spamc exits with a zero status any time it filters,
whether the message was tagged spam or not.  I'm not entirely sure that's 
the case.

However, unless you want to do different actions for different non-zero
values of STATUS (that is, unless it's not a simple boolean), you might
just as well do

:0 e
| spamassassin -a

as was suggested elsewhere in the thread.



-------------------------------------------------------
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