For completeness, here are examples of my procmail rules and the script that
is called to play my mail for each mailbox.
It only plays sounds if i have a gdm session. So if i am logged in via
the windowing X11 stuff (runlevel 5). Not if i only telnet into my box.
Good luck.
jan
:0
* ^From.*@.*lucent\.com
{
:0c
| $HOME/bin/playmail $HOME/fun/sounds/zamfir2.au
:0:
lucent
}
:0
* ^TO_licq@ctr\.videotron\.com
{
:0c
| $HOME/bin/playmail $HOME/fun/sounds/xylophone.au
:0:
licq
}
:0
* ^TO_*@mutt\.org
{
:0c
| $HOME/bin/playmail $HOME/fun/sounds/firebird.au
:0:
mutt
}
:0
* ^TO_ppa\..*@listbot\.com
{
:0c
| $HOME/bin/playmail $HOME/fun/sounds/bark.au
:0:
ppa
}
:0
* ^TO_fetchmail-friends@ccil\.org
{
:0c
| $HOME/bin/playmail $HOME/fun/sounds/wolf.au
:0:
fetchmail-friends
}
:0
* ^TO_FETCHMAIL-DAEMON@.*\.nl
{
:0:
fetchmail-errors
}
:0
* ^Subject:.*fetchmail authentication failed
{
:0:
fetchmail-errors
}
:0 # all my other email only plays a sound; also create a copy which
# will fall through into my $MAIL
{
:0c
| $HOME/bin/playmail $HOME/fun/sounds/nmail_boer.wav
}
#!/bin/zsh
if [ -f /var/lock/console/$LOGNAME ]
then
# logged in via gdm; ok to play sounds
if [ "$1" != "" ]
then
esdplay $1
fi
fi