Philip Guenther wrote:
Sergei Senin <ss(_at_)ee(_dot_)port(_dot_)ac(_dot_)uk> writes:
What I'm trying to do is 1)to save mail coming from a certain address
xx(_at_)domain into a folder 2)to execute a programme:
some_programme -infile yyy -outfile zzz, input file can't be read in any
other way than as with an option keyword 'infile' (i.e, one can't cat and
pipe it to 'some_programme')
# Matching on Return-Path: may be better.
:0 c:
* From: (_dot_)*xxx(_at_)domain
folder
# You probably need a local lockfile
:0 A:/tmp/lock.some_programme
|cat >/tmp/tmp.$$.; some_programme -infile /tmp/tmp.$$. -outfile whatever; \
rm /tmp/tmp.$$.; \
echo "Fix your stupid program" | Mail -s "bug report"
support(_at_)whereever
Wouldn't something like the following work? I've used the "tee"
trick to save input while debugging an auto-reply game, although
its output went into a pipe to a shell script:
# Matching on Return-Path: may be better.
# (ok, why? :)
:0: some-lock-file
* From: (_dot_)*xxx(_at_)domain
|tee -a folder >/tmp/tmp.$$.; \
some_programme -infile /tmp/tmp.$$. -outfile whatever; \
rm /tmp/tmp.$$.; \
echo "Fix your stupid program" | Mail -s "bug report"
support(_at_)whereever
(Not sure how the bug report fits in with the original request, but
I left it there. Oh, wait a minute, I think it's humor... well,
sometimes people can't fix the software they're forced to use.)
Cheers,
Stan Ryckman (stanr(_at_)tiac(_dot_)net)