procmail
[Top] [All Lists]

Re: Playing a sound

2012-04-17 15:51:08
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.

____________________________________________________________
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>