procmail
[Top] [All Lists]

Autoreply a program result

1999-10-04 09:30:59
Hi,

I have wrote the following recipe:

:0 c
* ^To: test(_at_)megapro(_dot_)com
* !^FROM_DAEMON
* !^FROM_MAILER
| /usr/sbin/runstat 

:0 h
* !^FROM_DAEMON
* ^TOtest(_at_)megapro(_dot_)com
| (formail -rt -I "From: info(_at_)megapro(_dot_)com" \
-I "Subject: Thank you";\
cat $HOME/logfile) | $SENDMAIL -oi -t


The shell script runstat runs, put "result" ("result" here I mean the
output  I see when I run it mannually: runstat)
in the procmail log file (defined by .procmailrc as $HOME/logfile)

I want send such result to the email sender.

The problem is: The result is autoreplied before the program runstat
finishes. So we get an empty result in reply.
The runstat program will take 1-2 minutes to finish. The autoreply is
almost instant.

My question is how to I autoreply a program "result" when it finishes.

I tried redirect: /usr/sbin/runstat > result.txt
 the file: result.txt is empty when the program runstat finishes.
 the result did show in the logfile.

Thanks in advance.

Regards,

Zhenhua
 

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