procmail
[Top] [All Lists]

RE: Playing a .wav sound

2009-02-10 20:57:05
LuKreme wrote Wednesday, February 11, 2009 2:13:

The main difference in result between yours and his is that
his will eat (destroy, lose) the message.  If he put a
c-flag on the recipe, though, it would have the same
result as yours.

But his would needlessly pipe the message to the mplayer command.

What do you think the back-ticks do in yours that is so
different?  I'm not saying they are identical.  I'm saying
they're not so different.

Each one has subtle advantages and disadvantages.

 :0
 * conditions
 { DUMMY = `program` }

spawns a shell and leaves the whole message, head and body,
leaning against the input side of the shell.  Not that that's
such a biggie, but ...

 :0 hc
 * conditions
 | program

only runs the head through the pipe (note my new flag).
It spawns a new instance of procmail, though, to which it
shunts the whole message again.  It might or might
not need a subshell for any of this.  Maybe not.

 :0
 * conditions
 * ? program
 an_unrelated_action

might be the best of these.  We can deliver the message in
the same recipe.  I guess we are still spawning a subshell.
We're only knocking against it with the message header,
though.  (Conditions default to header-only parsing.)

Yet another way:

 :0 h
 * conditions
 DUMMY=| program

Now we don't need a c-flag.  No need to spawn a new procmail
instance.  We still need to deliver the message in a following
recipe, though.   (The last one above is not a delivering
recipe.)

The only disadvantage here is that there is a procmail bug
that eats memory with this sort of syntax.  It might eat
the wrong memory.  It sort of depends on your OS distro
and compilation and luck.  Usually people are not bothered.
If you were, would you know it?  Your message might disappear.
Something else weird and unwanted might happen.

There are patches out there.  The version I use is hand-
patched by a coder friend.

Dallman

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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