OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: 2 ldap lookups instead of 1

From: John A. Kremlin (jonh.a.kremliniol.pt)
Date: Wed Dec 17 2003 - 13:28:16 CST


Hi,

If you are talking about "Ldapcfg_domain = somewhere.com", I was already using it and it seems to be working fine (because when I send emails to another domain I don't get ldap searchs). If you're not talking about this domain attribute, please correct me.

Thanks.

----- Mensagem Original -----
De: Liviu Daia <Liviu.Daiaimar.ro>
Data: Quarta-Feira, 17 de Dezembro de 2003, 18:32
Assunto: Re: 2 ldap lookups instead of 1

> On 17 December 2003, John A . Kremlin <jonh.a.kremliniol.pt> wrote:
> >
> > Inside «main.cf» I defined the following:
> > ###
> > smtpd_sender_restrictions=check_sender_access,ldap:Ldapcfg,permit
> > smtpd_recipient_restrictions=check_recipient_access,ldap:Ldapcfg,
> > permit_mynetworks,reject_unauth_destination
> >
> > (...)
> > Ldapcfg_query_filter = (&(inactive=true)(mail=%s))
> > ###
> >
> >
> > The problem exists in ldap lookups made by postfix...
> >
> > Lets imagine I use "somethingsomewhere.com" as «MAIL FROM» and
> > "somethinganotherdomain.com" as «RCPT TO». Postfix looks up for:
> > a) MAIL FROM:
> > a.1) (&(inactive=true)(mail=somethingsomewhere.com))
> > a.2) (&(inactive=true)(mail=somewhere.com))
> >
> > b)RCPT TO:
> > b.1) (&(inactive=true)(mail=somethinganotherdomain.com))
> > b.2) (&(inactive=true)(mail=anotherdomain.com))
> >
> > The a.2 and b.2 lookups weren't supose to happen.
>
> They are. Try:
>
> man 5 access
>
> > Can someone please explain why is this happening and how to
> avoid it?
>
> Use the domain parameter to restrict lookups to addresses from a
> (list of) domain(s). Lookups for address parts are also supressed
> whenyou do that.
>
> Regards,
>
> Liviu Daia
>
> --
> Dr. Liviu Daia e-mail: Liviu.Daiaimar.ro
> Institute of Mathematics web page: http://www.imar.ro/~daia
> of the Romanian Academy PGP key:
> http://www.imar.ro/~daia/daia.asc