procmail
[Top] [All Lists]

Re: non-delivering actions

1996-04-26 09:20:50
fox(_at_)gso(_dot_)SAIC(_dot_)COM (Warren "Caddy to the Dalai Lama" Fox) writes:
I'm sure there's a simple answer to this, but I don't see it
in the man pages.  I want to play an audio sound when mail arrives.
I'm currently using this recipe, which works, but I'm wondering if
there is a more efficient way to do this (I'm trying to pipe the
mail into rsh?).

# add sound to these senders,
# but still read from standard mailbox
:0
* ^From:.(tjs|bache)
{
   :0 c
   $ORGMAIL

   :0
   | rsh jarl "/bin/audioplay -v 60 ~/audio/splat.au"
}


As Guy Geens mentioned, you'll want the 'i' and 'h' flags on the rsh.
Other points to consider:

You probably meant to include a '*' in the condition, and the \< and \>
regexp token may be a good idea as well to delineate the names as words:

        * ^From:.*\<(ths|basche)\>


You may as well pass rsh the -n flag.  This saves a process (rsh has
to fork otherwise to handle both directions).  Beware: some rsh's
require you to place the -n *after* the hostname.

You may want to add "2>/dev/null" to the command line to avoid filling
your procmail log with "audioplay: unable to open /dev/audio:
permission denied" when you aren't logged in.


Why not just make the rsh action be non-delivering, and fall through
for the delivery to your mailbox?

To sum up:

:0 ich
* ^From:.*\<(tjs|basche)\>
|rsh -n jarl "/bin/audioplay -v 60 ~/audio/splat.au" 2>/dev/null


Philip Guenther

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