17 Apr 2012 21:27
17 Apr 2012 21:54
Re: Playing a sound
Andrew Edelstein <andrew <at> pure-chaos.com>
2012-04-17 19:54:42 GMT
2012-04-17 19:54:42 GMT
On 04/17/2012 02:27 PM, Danny wrote: > Is it possible to play a soundfile when procmail encounters mail from a certain > e-mail address? That depends on your operating system, is your mailbox server also your workstation, etc. Generally, assuming your workstation is the same machine where Procmail is running, this is fairly trivial. You just need the "action" of your procmail recipe to include calling your sound player program, presumably telling it what sound file to play. You may have to monkey around with user/permissions a bit so that the user that's running the procmail script has permission to access your sound device. Presumably if procmail is being run as you, and you are logged into X windows, this is a non-issue as you will have permission to access the sound device. -- -- Andrew Edelstein - andrew <at> pure-chaos.com https://andrew.pure-chaos.com/
17 Apr 2012 22:02
Re: Playing a sound
Danny <dannydebont <at> gmail.com>
2012-04-17 20:02:00 GMT
2012-04-17 20:02:00 GMT
Hi, I am running Debian ... I think I know how to do it now ... Thank You Danny >On Apr 17 12, Andrew Edelstein : > To: procmail <at> lists.RWTH-Aachen.de > Date: Tue, 17 Apr 2012 14:54:42 -0500 > From: Andrew Edelstein <andrew <at> pure-chaos.com> > Subject: Re: Playing a sound > User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 > Thunderbird/11.0.1 > X-BeenThere: procmail <at> lists.RWTH-Aachen.de > > On 04/17/2012 02:27 PM, Danny wrote: >> Is it possible to play a soundfile when procmail encounters mail from a certain >> e-mail address? > That depends on your operating system, is your mailbox server also your > workstation, etc. > Generally, assuming your workstation is the same machine where Procmail > is running, this is fairly trivial. You just need the "action" of your > procmail recipe to include calling your sound player program, presumably > telling it what sound file to play. You may have to monkey around with > user/permissions a bit so that the user that's running the procmail > script has permission to access your sound device. Presumably if > procmail is being run as you, and you are logged into X windows, this is > a non-issue as you will have permission to access the sound device.(Continue reading)
17 Apr 2012 21:57
Re: Playing a sound
Professional Software Engineering <PSE-L <at> mail.professional.org>
2012-04-17 19:57:47 GMT
2012-04-17 19:57:47 GMT
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 <at> 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 <at> domain\.tld
| path/to/some/sound/player soundfile
YOU need to find a suitable audio player. It's an exercise for you
(Continue reading)
18 Apr 2012 05:45
Re: Playing a sound
Robert Bonomi <bonomi <at> mail.r-bonomi.com>
2012-04-18 03:45:58 GMT
2012-04-18 03:45:58 GMT
` > Date: Tue, 17 Apr 2012 21:27:32 +0200 > From: Danny <dannydebont <at> gmail.com> > Subject: Playing a sound > > Hi guys, > > Is it possible to play a soundfile when procmail encounters mail from a certain > e-mail address? Yes, procmail is -(Continue reading)capable- of doing it. To wit; :0 c: * ^From:.*${ADDRESS} | ${PLAYSOUND} However _system_ restrictions may prohibit it. e.g. system-enforced access controls may allow only the user logged in on the 'console' to access the audio device. More than two decades ago, in a _production_ business environment, I deployed a routine on user workstations that submitted a job to a remote mainframe. when the 'completion status' mail came back one of two sound- effects would play, depending on whether the job completed sucessfully or failed. Picked from the 'standard' samples that came with the O/S release, they were a 'gong' for a successful run, and a 'toilet flushing' for the other case. One day, a new user got the submitted data wrong for something like 20 consecutive attempts. When he -finally- got the 'gong', he got a round of applause from everybody within earshot. *GRIN*
18 Apr 2012 06:34
Re: Playing a sound
LuKreme <kremels <at> kreme.com>
2012-04-18 04:34:03 GMT
2012-04-18 04:34:03 GMT
Danny squawked out on Tuesday 17-Apr-2012 <at> 13:27:32
> Hi guys,
>
> Is it possible to play a soundfile when procmail encounters mail from a certain
> e-mail address?
Yep, it's quite easy. On the tried period of time that I was running postfix/procmail on my OIS System I had a
recipe that looked something like this on my personal account. I set UNAME by indexing the CLEANFROM
against a whitelist local file.
user <at> domain.tld Fred Smith
# This is a non-delivery recipe
:0
* CLEANFROM ?? $UNAME
{ DUMMY=`/usr/bin/say "New mail has arrived from $UNAME" -v Alex -r 255` }
Of course, the command that you use will vary by OS, but it really is that simple. The hard part was building
UNAME, which I did with a local file that I edited manually when I wanted notifications from a person.
But the experiment of running postfix and procmail on OS X was short-lived, and my servers are miles away, so
sound playing would be rather silly at this point.
You can do pretty much anything you want in a recipe, and executing it from a fake variable assignment avoids
a lot of issues.
--
--
I DO NOT HAVE DIPLOMATIC IMMUNITY Bart chalkboard Ep. 9F20
18 Apr 2012 19:25
Re: Playing a sound
Alan Clifford <lists <at> clifford.ac>
2012-04-18 17:25:07 GMT
2012-04-18 17:25:07 GMT
Danny wrote (at 21:27 (+0200) on Tuesday, 17th April, 2012):
> Hi guys,
>
> Is it possible to play a soundfile when procmail encounters mail from a certain
> e-mail address?
>
> Thank You
>
> Danny
I remember trying this and I still have the recipe commented out in my
procmail files:
FROMHEADER=`formail -c -rtz -x To:`
# play sound
# DUMMY=`test -f "${PMDIR}/mailsounds/${FROMHEADER}.wav" \
# && play "${PMDIR}/mailsounds/${FROMHEADER}.wav" > /dev/null &`
I had a directory with sounds:
alan <at> malander:~$ ls ~/.procmail/mailsounds/
alanclifford\ <at> gmail.com.wav test2\ <at> clifford.ac.wav test\ <at> clifford.ac.wav
I don't sit at that computer any more since I got a laptop.
Alan
( Please address personal email to alan+1 <at> as email to lists <at>
is only read from my subscribed lists. )
(Continue reading)
18 Apr 2012 19:46
Re: Playing a sound
Danny <dannydebont <at> gmail.com>
2012-04-18 17:46:02 GMT
2012-04-18 17:46:02 GMT
Thank you all guys ... appreciated ... I now know more or less what to do ... Danny >On Apr 17 12, Danny : > To: procmail <at> lists.RWTH-Aachen.de > Date: Tue, 17 Apr 2012 21:27:32 +0200 > From: Danny <dannydebont <at> gmail.com> > Subject: Playing a sound > User-Agent: Mutt/1.5.18 (2008-05-17) > > Hi guys, > > Is it possible to play a soundfile when procmail encounters mail from a certain > e-mail address? > > Thank You > > Danny
RSS Feed