procmail
[Top] [All Lists]

Re: concurrent sendmails when forwarding

1998-08-15 10:38:47
Walter Haiding wrote,

| Is there some kind of "postprocess" rule/command with is run after all
| mails are processed by procmail? I do not remember reading of such at all.

That's what procmail's TRAP variable is for.  It says what procmail should do
on the way out after delivery.

| Yes. I'd like to have several sendmails processing a single mail on after
| the other. The only problem is that they're run concurrently.

I don't understand.  Why must the same exact message be sent separately to
all its forwardees?  Can't you use one recipe to send it to all of them and
thus invoke sendmail only once for each message that you forward?

If you need to run several recipes to determine exactly which people should
be sent the message, save the results in variables and then, at the end of
them, use one forwarding recipe.  For example,

  FORWARD JOE SHEILA MARTHA CRAIG

  :0 # plus condition-modifying flags
  * reasons to forward to Joe
  { JOE="Joe's address" FORWARD=yes }

  :0 # plus condition-modifying flags
  * reasons to forward to Sheila
  { SHEILA="Sheila's address" FORWARD=yes }

  :0 # plus condition-modifying flags
  * reasons to forward to Martha
  { MARTHA="Martha's address" FORWARD=yes }

  :0 # plus condition-modifying flags
  * reasons to forward to Craig
  { CRAIG="Craig's address" FORWARD=yes }

  :0 # add `c' flag to forward a copy and keep original 
  * FORWARD ?? yes
  ! $JOE $SHEILA $MARTHA $CRAIG