Could someone confirm the basic format for the following pseudocode:
if (X) { set Y = X }
elseif (X2) { set Y = X2 }
elseif (X3) { set Y = X3 }
if (Y set) { do things }
else { do other things }
I have part of a template below, but I'm really uncertain about how
to finally check if A) any of the rules worked or (equivalently) B)
$SPAM is set to some value. Does the 'A' modifier check ANY of the
preceeding rules or just the last one?
# if
:0
* ^Subject: *SPAM:
{ SPAM="spam" }
# else if
:0 E
* ^Subject: Advert
{ SPAM="advert" }
# else if...
# if (Y set)
#XXX how to do this?
:0 A :
* if ($SPAM)
{
| $FORMAIL -A"X-Sorted: *** $SPAM ***" >> $SPAMFOLDER
}
# Else just reinject the mail.
:0
! -oi -f "$@"