procmail
[Top] [All Lists]

Running an executable after delivery?

2001-11-03 17:12:22
Hi all

This might be an annoying newbie question but is it possible to deliver
to a mailbox and then run an executable? 

I'm doing something with PHP (its the only Unix language I really know
right now). I basically want to do an http request with wget when a new
message is written to a maildir mailbox. I'm trying this sort of thing:

:0c
*
in-testing/
:0:
*
|/mypath/wget -q http://mydomain.com/myscript.php

The log says procmail: Couldn't determine implicit lockfile from
"/mypath/wget". 

The opposite order like this works without error:
:0c
*
|/mypath/wget -q http://mydomain.com/myscript.php
:0:
*
in-testing/

but its in the wrong order. I want the script to run when I know its
safe to read the new file written in /in-testing/new.

Is this possible? Is there a better way?

I can almost get the result I want by changing my .forward file which
runs Procmail. I run wget after Procmail. That runs it for all messages
which I can cope with but is not ideal. Is that a safe arrangement in
terms of seeing all messages with the PHP script or are there
multithreading issues I'm naively missing?

A related question: Is it possible to know the name of the new message
file in a maildir mailbox? This would be useful to pass to the script.

Any suggestions would be appreciated.

Thanks
Ross



__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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