Playing sounds when mail arrives

From JoatWiki

Jump to: navigation, search

Following has been tested on a Mandrake 8.x install.


How to play a sound when mail from a specific person arrives:

Add the following to your Procmail recipes:

  :0 hwic
  * ^From:.*joat@757.org
  | cat > /dev/null; /usr/bin/esdplay /usr/share/sounds/gaim/RedAlert.au

Explanation:

  • The "h" flag in the first line causes only the header to be fed to the command line.
  • The "w" flag in the first line delays removal of the lock file until the sound has finished playing
  • The "i" flag in the first line suppresses error checking for playing the sound.
  • The "c" flag in the first line means to process a copy of the incoming messae. (You want it to play the sound and file the message, not play the sound and lose the message!)
  • The second line is who you're watching for. Note the ".*" just in front of the mailing address. This allows the filter to match the e-mail address and ignore the username data preceding it.
  • The third line copies the header to /dev/null (you have to do something with the header) and then plays the sound file (substitute your favorite player and sound here)(milage may vary, see PM-Tips for a similar method using an audio server).

How to store an incoming message in the INFOSEC folder and play a sound:

This trick requires nesting. Add the following to your Procmail recipes:

  :0c
  * ^From:.*joat@757.org
  {
  	:0ci
  	|/usr/bin/esdplay /usr/share/sounds/gaim/RedAlert.au

  	:0
  	INFOSEC
  }

| | Add this to Del.icio.us! | Digg this!

Personal tools