OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: [PATCH] Add recipient count into policy checking

From: Wietse Venema (wietseporcupine.org)
Date: Thu Jan 19 2006 - 15:16:34 CST


Guo Black:
[ Charset ISO-8859-1 unsupported, converting... ]
> Hi,
>
> On 1/20/06, Victor Duchovni <Victor.Duchovnimorganstanley.com> wrote:
> > At what phase in the conversation are you applying the policy check?
> > If in smtpd_recipient_checks, the count will only be correct when you
> > reach the last recipient (but you won't know which one is last until
> > later).
>
> It was "DATA" (smtpd_data_restrictions), as state->recipient is
> cleared in DATA and END-OF-DATA phases.
>
> Since the rcpt count is not quite meaningful in earlier stages,
> perhaps the following would be better? (Or state->act_size > 0, but
> semantically we should already know rcpt_count in the DATA phase)
>
> --- smtpd_check.c.orig Thu Dec 22 23:46:36 2005
> +++ smtpd_check.c Fri Jan 20 05:02:00 2006
> -3273,6 +3273,10
> state->sender ? state->sender : "",
> ATTR_TYPE_STR, MAIL_ATTR_RECIP,
> state->recipient ? state->recipient : "",
> + ATTR_TYPE_LONG, MAIL_ATTR_RCPT_COUNT,
> + ((strcasecmp(state->where, "DATA") != 0) ||
> + (strcasecmp(state->where, "END-OF-DATA") != 0)) ?
> + state->rcpt_count : 0,
> ATTR_TYPE_STR, MAIL_ATTR_QUEUEID,
> state->queue_id ? state->queue_id : "",
> ATTR_TYPE_STR, MAIL_ATTR_INSTANCE,

Yup, that would make sense. You also have a patch for the
documentation? :-)

        Wietse