Re: Playing a sound

[email protected] (Professional Software Engineering)
Newsgroups gmane.mail.procmail
Organization Professional Software Engineering
Message-ID <[email protected]>
At 12:27 2012-04-17, Danny wrote:
>Hi guys,
>
>Is it possible to play a soundfile when procmail encounters mail 
>from a certain
>e-mail address?

:0
* ^From:.*\<some_address@domain\.tld
{
         # c - make a copy for purpose of invoking a sound processor
         # i - ignore write errors (say, because your invoked program doesn't
         # give a hoot about stuff on stdin)
         :0ci
         | path/to/some/sound/player soundfile

         # original processing continues here (say you want to file it special
}


The \< isn't literal open bracket, it's regexp for "character before 
or after a word, and of course, the above could be simplified to more 
specifically what you asked for:

# this doesn't copy the message, so it effectively gets tosssed when invoking
# the sound player.
:0i
* ^From:.*\<some_address@domain\.tld
| path/to/some/sound/player soundfile


YOU need to find a suitable audio player.  It's an exercise for you 
to resolve hardware permissions (can your user account play sound, or 
only root?)

---
  Sean B. Straw / Professional Software Engineering

  Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
  Please DO NOT carbon me on list replies.  I'll get my copy from the list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.