procmail
[Top] [All Lists]

if/else question

1999-07-07 16:20:13
This is surely elementary, and I have read the man pages, but I'm a
little bit of a dolt when it comes to understanding them.  So about
every year or so I emerge from the shadows, hat in hand, and beseech
you fine people for some help.  Here it is.

I've set up a couple recipes to provide pseudo-mail for one of my
children.  If mail comes in with a certain tag in the Subject: line,
and the sender is found in his "white list", it gets delivered to a
file in my home directory at the ISP.  I run a nightly cron job from
home that ftps the file home and appends it to his spool file.  Then,
if there was any mail received for him, a message is sent to trigger
the following recipe.  It's an ugly kludge, but he's not quite old
enough for free reign and this gives me some parental control.

   :0
   * three conditions here that adequately identify
   * any messages that trigger this recipe actually
   * come from me.
   {
      :0
      * ? test -f $HOME/.../his_mbox
      {
         LOG=">>>>>>>>> $RCFILE: suitable message $NL"
         :0 ic
         | rm -f $HOME/.../his_mbox

         :0
         /dev/null
      }
      :0 E
      /dev/null
   }

It's probably unnecessarily anal to check for the file's existence
here, but what the hey.  If the file exists I want to write the
LOG msg, rm the file, and bit bucket the message which triggered
the process.  If the file doesn't exist, which arguably should never
happen, the incoming message should just be zapped.  Are the two
recipes in the inner block necessary, or will procmail consider the
message delivered and drop it with the first action, even though
it hasn't actually been delivered anywhere?  And do I have the
second recipe in the outer block correct with the 'E' flag?

Thanks for your help.

 - Don



<Prev in Thread] Current Thread [Next in Thread>