OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Adding a header during a client restriction transaction

From: Wietse Venema (wietseporcupine.org)
Date: Fri Sep 14 2007 - 13:54:13 CDT


Wietse Venema:
> trent lacoye:
> > Hi,
> >
> > I have a policy server set up to do my smtpd_client_restrictions, and in
> > this server I would like to add a custom header so that another server
> > knows the mail was already checked. It seems, though, that you can't use
> > the 'prepend' action during client command restrictions. Does anybody
> > know if there is a way around that, without setting up another policy
> > server during recipient command restrictions. I'd like to only have
> > one policy server run at helo time.
>
> You can specify PREPEND only in the context of a mail transaction.
> At the CONNECT and HELO stages there is no mail transaction context,
> nor is there one after END-OF-DATA.
>
> You can use the same policy server at the RCPT stage and look at
> the protocol_state attribute: if it is the first RCPT after HELO
> or EHLO, send your PREPEND command (or send the PREPEND at the
> MAIL stage).
>
> One SMTP server process sends all its queries over the same policy
> connection, except when the policy daemon crashes.

The client may never send HELO or EHLO. In that case you need to
reset all state whenever the Postfix SMTP server process reports
a CONNECT event.

        Wietse