this is a silly question, but somehow I can't get this working:
in my /etc/aliases I have a line like this:
fax: "|/test/myscript"
That's supposed to pipe mail sent to account fax to a bash script for processing.
In /test/myscript I have :
Code:
#!/bin/bash
cd /tmp
myresult="/tmp/`/test/unpack.py`"
echo $myresult
The line beginning with "myresult" is supposed to set this variable to contain "/tmp/" plus whatever is being output by a python script in /test/unpack.py
That unpack.py is supposed to receive incoming message on it's stdin, process it, sotre some data in a file in /tmp and give that file's name on it's stdout to be put in "myresult"
I can't figure out how to feed my e-mail through the bash script into the python script. I've checked my python script by cat myemaildump | unpack.py, works fine.
I checked silly stuff like paths, permissions, disabled sendmail's smrsh functionality to allow insecure scripts ( the machine sits on private network, not reachable from outside). /var/log/maillog indicates that the message was sent sucessfully to "|/test/myscript", but python script never sees the data.
What am I doing wrong?