procmail
[Top] [All Lists]

Re: Executing a program on reception of mail from someone

1998-01-12 12:25:18
You could try something like the following

 :0 ic
 * ^From: Peter S Galbraith <galbraith(_at_)mixing(_dot_)qc(_dot_)dfo(_dot_)ca>
 | cat > /dev/null; /usr/X11R6/bin/auplay /usr/lib/exmh/drip.au

 :0 
 * ^From: Peter S Galbraith <galbraith(_at_)mixing(_dot_)qc(_dot_)dfo(_dot_)ca>
 mailfile

The first recipe plays the sound, the second one files the message in 
mailfile. The initial `cat' in the first recipe dumps the copy of the 
mail message that would otherwise be piped to the auplay command.  
The option `i' ensures that procmail does not get upset when the 
audio device is unavailable (when it is still playing some earlier 
sound, for example).

No doubt there are more efficient ways of doing this that do not 
duplicate the expression matching.

Chris Fox


On Mon, 12 Jan 1998 12:18:41 EST, Peter S Galbraith wrote:
I'm trying to play a particular sound file when I get mail from
a particular person.

This rule does not work:

:0 c
* ^From: Peter S Galbraith <galbraith(_at_)mixing(_dot_)qc(_dot_)dfo(_dot_)ca>
| /usr/X11R6/bin/auplay /usr/lib/exmh/drip.au

However, this rule does redirect a copy of mail from me correctly:

:0 c
* ^From: Peter S Galbraith <galbraith(_at_)mixing(_dot_)qc(_dot_)dfo(_dot_)ca>
testfile

And this command in a shell does procude a sound:

cat anyfile | /usr/X11R6/bin/auplay /usr/lib/exmh/drip.au

Any hints?
-- 
Peter Galbraith, research scientist             
<galbraith(_at_)mixing(_dot_)qc(_dot_)
dfo.ca>
Maurice-Lamontagne Institute, Department of Fisheries and Oceans 
Canada
P.O. Box 1000, Mont-Joli Qc, G5H 3Z4 Canada  418-775-0852 - FAX 
418-775-0546


-- 
Dr. Chris Fox,  Dept. of Mathematical & Computing Sciences, Goldsmiths
College, New Cross, London SE14 6NW, UK.       Email: 
C(_dot_)Fox(_at_)gold(_dot_)ac(_dot_)uk
URL: http://www.gold.ac.uk/~mas01cjf, Tel/Fax: +44(0)171 919 7856/7853



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