OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Custom pipe script failure code

From: Alan Fullmer (lists-alanxnote.com)
Date: Tue Oct 02 2007 - 13:03:14 CDT


Ralf Hildebrandt wrote:
> * Alan Fullmer <lists-alanxnote.com>:
>
>> Hello,
>>
>> I have a quick question regarding the pipe function in Postfix and the use
>> of PHP as a mail sorter/parser. I've looked around and see many people
>> have used PHP as a quick and dirty solution for putting mail data into a
>> database.
>>
>> I am taking all incoming mail, parsing out headers and putting the mail into
>> a MySQL database. The problem I have is, if the script cannot connect to
>> the database, the script fails. What I want is to have this message return
>> back into the normal mail queue with a temporary failure or something so it
>> can retry at a later time without disappearing into never never land. The
>> reason for this, is if there is a connection failure, or the database stops
>> for some reason, I don't want these messages to be lost due to a script
>> failure.
>>
>
> exit 75
>
>
this is what I have and it wasn't working. That's why I ask :/

        $dbc = mysql_connect (
                        $host ,
                        $name ,
                        $pass
                                ) or exit(75);