OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Problem using Postfix to pipe to a script

From: mouss (mlist.onlyfree.fr)
Date: Wed Jan 02 2008 - 17:37:02 CST


Loïc Foucault wrote:
> I there,
>
>
> I know this was covered many times but I searched and not found why I got
> this problem.
>
> I'm trying to pipe email to a bash script and the pipe command doesn't send
> me the email.
>
> I tried 2 way ( with aliases and with the master.cf file)
>
> Here my configurations:
> My script /test

don't clutter the / of your system...

> #!/bin/bash

replace this with
#!/bin/sh

don't use /bin/bash unless your script needs bash extensions.

>
> echo "-------------------------------------------------" >> /tmp.log
> echo `date` >> /tmp.log
> echo "$1" >> /tmp.log

The mail is passed as stdin, not as $1. replace the last line with

cat >> /tmp.log

>
> [snip]