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] Feed myhostname attribute to policy servers

From: Luc Pardon (lucpskopos.be)
Date: Sun Oct 17 2004 - 14:40:25 CDT


Wietse Venema wrote:

> > 1) Would you mind if I left the "<policy>_myhostname" parameter in
> > place (in addition to "<policy>_attributes") ?
>
> If you don't ript it out then I will.

  Now that's clear and unambiguous <g>.

  The new version of the patch is at:

  
http://www.skopos.be/downloads/postfix/postfix-policy-attributes.patch.txt
  
http://www.skopos.be/downloads/postfix/postfix-policy-attributes.patch.tar.gz

  I retracted the original.

  Some notes:

  1) The first version of the patch added a get_mail_conf_str2(name1,
name2,..) function, but that does a mail_conf_lookup_eval() on the
parameter value, i.e. on all attribute name/value pairs as a whole. This
is bad (try foo=$smtpd_recipient_restrictions <g>). I coded similar
functionality (without the '_eval' expansion on the whole string and
expansion only on the individual attribute values) straight into
smtpd_check.c. Therefore get_mail_conf_str2() is no longer needed for
this and I left it out of the patch.

  2) This thing could use some syntax checking on the name=value pairs.
I'd be happy to add it, but at some point it must be quicker for you to
recode from scratch than to review other people's code. If we're not
past that point yet, let me know.

  3) Even if you decide not to use the patch, please note the buglet in
util/attr_clnt.c at the end of the patch file (it skips two args instead
of one for an ATTR_TYPE_HASH).

  4) I couldn't easily find where the original ATTR_CLNT structs in the
policy_clnt_table are explicitly freed. So I added a
policy_client_free() function that is never called, hoping that you'd
know what to do with it.

  5) The default value is still:

       <policy>_attributes = myhostname=$myhostname

   Hope this is useful somehow,

   Luc Pardon
   Skopos Consulting
   Belgium