Re: [Exim] exim robots

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Philip Hazel
Datum:  
To: Vadim Vygonets
CC: exim-users
Betreff: Re: [Exim] exim robots
On Mon, 29 Nov 1999, Vadim Vygonets wrote:

> Usually, it's done by making a program to receive mail from stdin
> and setting up a pipe transport.  A shell script can do it:
>    #!/bin/sh
>    cat > /var/mail/john
>    /usr/local/bin/do-stuff

>
> Other solutions are possible, but not advised.


Ooooh, Vadim, I must take you to task there. That solution is also not
advised! You have forgotten about locking. There will be disaster when
two messages arrive simultaneously. At the very least you should be
using the exim_lock utility on the file.

A better approach would be to file each message in a separate file,
possibly using the message id to make a unique name (it's in the
MESSAGE_ID) environment variable. Then (a) you don't have this problem
and (b) your "do-stuff" script has only one message to work on.


-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.