Reverse entry lookups in LDAP

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Reverse entry lookups in LDAP

Mike A. Leonetti
I really wasn't sure of what to title the mail, but.

So, I need to get postfix to deliver both locally to the user (which is no problem) and deliver to an external contact. The actual local e-mail address of the user is found in the "mail" attribute, but the external contact to deliver to is located in another DN that is linked back to the main user using the user's DN.

For example the user would be located under "cn=Mike,cn=users,dc=server,dc=local" and have the "mail" attribute for the local mailbox.

The contact would be located under: "cn=Mike - Blackberry,cn=users,dc=server,dc=local" and have an attribute altRecipientBL that is "cn=Mike,cn=users,dc=server,dc=local" as well as a "mail" attribute containing the external e-mail address.

So the goal is to get it to recognize both the local e-mail address as well as the e-mail address of the contact which is only linked by the altRecipientBL.

What would be the best way to do this other than scripting?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: Reverse entry lookups in LDAP

Stephen Ingram
On Wed, Nov 9, 2011 at 11:29 AM, Michael A. Leonetti
<[hidden email]> wrote:

> I really wasn't sure of what to title the mail, but.
>
> So, I need to get postfix to deliver both locally to the user (which is no
> problem) and deliver to an external contact. The actual local e-mail address
> of the user is found in the "mail" attribute, but the external contact to
> deliver to is located in another DN that is linked back to the main user
> using the user's DN.
>
> For example the user would be located under
> "cn=Mike,cn=users,dc=server,dc=local" and have the "mail" attribute for the
> local mailbox.
>
> The contact would be located under: "cn=Mike -
> Blackberry,cn=users,dc=server,dc=local" and have an attribute altRecipientBL
> that is "cn=Mike,cn=users,dc=server,dc=local" as well as a "mail" attribute
> containing the external e-mail address.
>
> So the goal is to get it to recognize both the local e-mail address as well
> as the e-mail address of the contact which is only linked by the
> altRecipientBL.
>
> What would be the best way to do this other than scripting?

Instead of creating another entry in your directory
(cn=Mike-Blackberry...), why not instead use the mailAlternateAddress
attribute in your cn=Mike... entry. You can then write your filters in
such as way that Postfix will only find the right address when needed.

Steve
Reply | Threaded
Open this post in threaded view
|

Re: Reverse entry lookups in LDAP

Mike A. Leonetti
On 2011/11/09, at 14:38, Stephen Ingram <[hidden email]> wrote:

> On Wed, Nov 9, 2011 at 11:29 AM, Michael A. Leonetti
> <[hidden email]> wrote:
>> I really wasn't sure of what to title the mail, but.
>>
>> So, I need to get postfix to deliver both locally to the user (which is no
>> problem) and deliver to an external contact. The actual local e-mail address
>> of the user is found in the "mail" attribute, but the external contact to
>> deliver to is located in another DN that is linked back to the main user
>> using the user's DN.
>>
>> For example the user would be located under
>> "cn=Mike,cn=users,dc=server,dc=local" and have the "mail" attribute for the
>> local mailbox.
>>
>> The contact would be located under: "cn=Mike -
>> Blackberry,cn=users,dc=server,dc=local" and have an attribute altRecipientBL
>> that is "cn=Mike,cn=users,dc=server,dc=local" as well as a "mail" attribute
>> containing the external e-mail address.
>>
>> So the goal is to get it to recognize both the local e-mail address as well
>> as the e-mail address of the contact which is only linked by the
>> altRecipientBL.
>>
>> What would be the best way to do this other than scripting?
>
> Instead of creating another entry in your directory
> (cn=Mike-Blackberry...), why not instead use the mailAlternateAddress
> attribute in your cn=Mike... entry. You can then write your filters in
> such as way that Postfix will only find the right address when needed.
>
> Steve

Good point. I'm going to do that. Thanks.

- Mike
Reply | Threaded
Open this post in threaded view
|

Re: Reverse entry lookups in LDAP

Viktor Dukhovni
On Wed, Nov 09, 2011 at 03:36:42PM -0500, Mike A. Leonetti wrote:

> >> For example the user would be located under
> >> "cn=Mike,cn=users,dc=server,dc=local" and have the "mail" attribute for the
> >> local mailbox.
> >>
> >> The contact would be located under: "cn=Mike -
> >> Blackberry,cn=users,dc=server,dc=local" and have an attribute altRecipientBL
> >> that is "cn=Mike,cn=users,dc=server,dc=local" as well as a "mail" attribute
> >> containing the external e-mail address.
> >>
> >> So the goal is to get it to recognize both the local e-mail address as well
> >> as the e-mail address of the contact which is only linked by the
> >> altRecipientBL.
> >>
> >> What would be the best way to do this other than scripting?

Indeed LDAP is not SQL and it is not possible to express arbitrary
joins via LDAP queries. So a change in the schema to express the required
data keyed under the expected keys is in order.

> > Instead of creating another entry in your directory
> > (cn=Mike-Blackberry...), why not instead use the mailAlternateAddress
> > attribute in your cn=Mike... entry. You can then write your filters in
> > such as way that Postfix will only find the right address when needed.
> >
> > Steve
>
> Good point. I'm going to do that. Thanks.

--
        Viktor.