Re: [exim] "Beep" on incoming mail ?

Pàgina inicial
Delete this message
Reply to this message
Autor: Matthew Newton
Data:  
A: Mathieu CATTIN
CC: exim-users
Assumpte: Re: [exim] "Beep" on incoming mail ?
On Thu, Apr 21, 2005 at 02:46:44AM +0200, Mathieu CATTIN wrote:
> I have successfully installed exim 4.50, I have a small Linux
> distribution that serves as a router called FREESCO, see
> www.freesco.org.
> Now I would like to make it beep whenever it receives a message, the
> command is simple : "[root@freesco] beep" makes it beep.
> How is it possible ? I have tried to put the command in the exim
> system_filter file but nothing happens...I'm kind of lost.


I used to do the following:

beep.c:

---8<---
#include <stdio.h>

int main(void)
{
FILE *c;

  if ((c=fopen("/dev/console","wb"))==NULL) {
    exit(0);
  }
  fprintf(c, "\a");
  fclose(c);
}
---8<---


Compile this up, chown root:root, chmod 4755. I wasn't worrying
particularly about problems of setuidness as only I use that machine.

Then, in my ~/.forward file (which is an Exim filter), I used:

---8<---
unseen pipe "/usr/local/bin/beep"
---8<---

which worked nicely.

There is possibly a better way, but this works. Don't forget the
"unseen"...

Matthew


--
Matthew Newton <mcn4@???>

UNIX and e-mail Systems Administrator, Network Support Section,
Computer Centre, University of Leicester,
Leicester LE1 7RH, United Kingdom