procmail
[Top] [All Lists]

Re: multiple actions ---> the solution

2000-07-31 13:58:31
At 14:01 -0400 31 Jul 2000, jack wallen jr 
<jwallen(_at_)techrepublic(_dot_)com> wrote:
:0:   
* ^TO_\/.+procmail@
{
  procmail_list
  :0 A
  | cat >> /home/jwallen/mail/procmail_list ; play ~/sounds/kill.wav
}

There are several problems with that:

- There is no default name for the lockfile requested by the trailing
  colon on the first line, since the recipe opens a nested block.

- The condition is a bit bizarre.  Normally the address (or portion
  thereof) to be matched should immediately follow the "^TO_" macro,
  since the macro contains wildcards itself.  Also, it doesn't look like
  the value of $MATCH is used, so including "\/" doesn't make sense.

- The first line inside the braces (procmail_list) probably doesn't do
  what you're expecting.  It unsets a variable named "procmail_list".

- The "A" flag on the second recipe doesn't make any sense.  The
  procmailrc man page says this about the "A" flag:

    This recipe will not be executed unless the conditions on the last
    preceding recipe (on the current block-nesting level) without the
    `A' or `a' flag matched as well.  This allows you to chain actions
    that depend on a common condition.

  But there is no preceding recipe on the current level.

- No lockfile is used when writing to the mailfile.

A bit better recipe:

  :0: procmail_list$LOCKEXT
  * ^TO_procmail@
  | cat >> /home/jwallen/mail/procmail_list ; play ~/sounds/kill.wav

I'd prefer to do keep the actions separate so that procmail doesn't
think that the save failed if just playing the sound failed.  It would
also allow us to use the default lockfile name.  It's also a bit more
efficient since it doesn't have to run a shell and cat.

  :0ich
  * ^TO_procmail@
  | play ~/sounds/kill.wav

  :0A:
  /home/jwallen/mail/procmail_list

-- 
Aaron Schrab     aaron(_at_)schrab(_dot_)com      http://www.execpc.com/~aarons/
 Life is like sendmail: It's complicated and hard to understand,
 but it sure beats the alternative.     -- Paul Tomblin

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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