postfix-users October 2010 archive
Main Archive Page > Month Archives  > postfix-users archives
postfix-users: Newb question - simple script

Newb question - simple script

From: jimmy zoto <jimmy5804_at_nospam>
Date: Mon Oct 11 2010 - 21:07:20 GMT
To: postfix-users@postfix.org

I'm trying to copy all incoming mail to a local FIFO file for special purpose
processing by a Java program. I don't know the best way to do this.

I tried to modify the simple filter script example in the documentation to this
:

---- #!/bin/sh INSPECT_DIR=/var/spool/myFifoDir EX_TEMPFAIL=75 cd $INSPECT_DIR || { echo cannot cd to fifo dir; exit $EX_TEMPFAIL; } cat > myFifo || {echo cannot write to fifo file; exit $EX_TEMPFAIL; } exit $? ---- I can execute this successfully on the command line, but I haven't been able to run it successfully from Postfix. It doesn't matter whether the destination file is a normal file or a FIFO. Nothing shows up in the logs. I have no indication the script is running. I copied the script into the queue_directory and have it entered in master.cf as : pipefilter unix - n n - 1 pipe flags=Rq user=filteruser argv=pipefilter -vvv -- I've read through the man(5) master page and googled for examples unsuccessfully. I'm sure I'm doing something pathetically ignorant. The argv command line seems a good suspect, but I'm not knowledgeable enough to know how to fix it. I've spent more than a day working on this, so any suggestions as to how to make this work or a better way to accomplish the same thing (like writing it to a socket) would be very much appreciated. Thanks much,