Re: postfix making too many queries to LDAP Mike Kenny wrote:
> I know I queried this a year ago and received some responses that explained
> what was happening (i.e. that extra queries were required to ensure that the
> mail address was not another alias and that different components of postfix
> require access to the same or related data) however these responses did not
> clarify some important points for me:
>
> 1. why do subsequent queries use different portions of the address (lhs and
> some combinations of the rhs), which cannot be valid addresses?
> 2. how do I turn off this 'feature'?
> 3. why should I not turn it off?
>
> If I can't achieve 2 then at least an answer to 1 and/or 3 may help me to
> justify this excess query traffic to our LDAP admins whose complaints are
> getting louder by the day.
>
> They are claiming that 80+% of queries to the LDAP are for entries that
> could not exist. e.g:
>
> (&(mail=.co.za)(mailAccountStatus=active))
> (&(mail=.za)(mailAccountStatus=active))
> (&(mail=.co.za)(mailAccountStatus=active))
> (&(mail=.za)(mailAccountStatus=active))
> (&(mail=.za)(mailAccountStatus=active))
> (&(mail=.co.za)(mailAccountStatus=active))
> (&(mail=mweb.co.za)(mailAccountStatus=active))
> (&(mail=webmail.co.za)(mailAccountStatus=active))
> (&(mail=.za)(mailAccountStatus=active))
> (&(mail=.co.za)(mailAccountStatus=active))
> (&(mail=.za)(mailAccountStatus=active))
> (&(mail=dc-tech.co.za)(mailAccountStatus=active))
>
> none of the above can be valid email addresses.

postfix lookups are not just for email addresses. read the "table 
format" and "search order" of the various lookups.

have a look at
    http://www.postfix.org/ldap_table.5.html
and see if the "domain" feature is what you want.

>  The only two query_filters
> configured for postfix are:
>
> (&(mailAlternateAddress=%s)(mailAccountStatus=active)) in ldap-alias.cf and
> (&(mail=%s)(mailAccountStatus=active)) in  ldap-mailbox.cf,
> ldap-sasl-password.cf, ldap-login_maps.cf,  ldap-mailhost.cf and
> ldap-valid-senders.cf
>
> help,
>
> mike
>
>


