OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Policy Server Question(s)

From: Wietse Venema (wietseporcupine.org)
Date: Tue Apr 24 2007 - 12:32:05 CDT


Duane Hill:
>
> I'm setting up a policy server written in Perl. I am using the greylist.pl
> that comes with the source download as an example. Documented within it
> states in a round-about way max_idle and max_use govern how often the
> script is launced based on when Postfix starts an SMTP process.
>
> There are some end processing I need to do before the process is shut
> down.

The policy server may terminate at its pleasure. In the case of the
example server, it should terminate when the policy client disconnects.
If the example policy server does not terminate, the spawn server will
assume thatthe process is stuck, and will kill it.

        Wietse

> In other words, I would like to have a connection open to a MySQL
> table at start and close the connection down at finish. Is there any time
> to do such things? Or, once Postfix closes the STDIN channel everything
> should be finished (in a terminated state).
>
> I.e.:
>
> perform_opening_stuff();
>
> while (<STDIN>) {
>
> if (/([^=]+)=(.*)\n/) {
>
> } elsif ($_ eq "\n") {
>
> } else {
>
> }
>
> }
>
> perform_closing_stuff();
> 5B
>
>