procmail
[Top] [All Lists]

Re: multiple actions for a procmail rule

2001-04-23 18:18:34
Thanks for the info. I've actually tried this out and it seems to work the
way i want it...

   
:0c
|/usr/local/bin/hypermail -i -u -p -c
/export/home/rptbd/hypermail_rules/other_undefined_reports


the above recipe is the last in the rc.maillists. hence the emails that
didn't get matched to the earlier recipies will be caught by this one. and
at the same time it will also got into my INBOX.


--- "David W. Tamkin" <dattier(_at_)ripco(_dot_)com> wrote:
Aaron asked,

| hi. is it possible for a procmail rule to execute multiple actions?

Generally, no; to do that one uses a `c' flag within braces or a `c'
flag and
an `A' flag; see the procmailrc(5) and procmailex(5) man pages.

| ie. send/forward to 2 email addresses?

That can be done in one action:

 :0 flags
 * conditions
 ! ad(_at_)dre(_dot_)ss1 ad(_at_)dre(_dot_)ss2

|     or having 2 pipes to 2 separate commands?

That requires two recipes, but with use of braces or an `A' flag the
conditions can be tested only once.  For examples,

 :0c other_flags
 * conditions1
 action1
  :0A action_related_flags
  action2

or

 :0 condition-related_flags
 * conditions
 {
  :0c other_action_related_flags
  action1

  :0 action_related_flags
  action2
 }

A lot of posts here are cases where people didn't read or ask first,
wrote
code like this,

 # THIS IS WRONG.  DO NOT DO THIS.
 :0
 * conditions
 action1
 action2

and were baffled that only action1 was carried out and that in some
cases
they also got an error in their logs from action2.



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
_______________________________________________
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>