Hi Reinaldo,

Let me explain better how virtual_alias_maps works in this case:
1) Someone send an email to [email protected]
2) Query ldap:everyone result has to be [email protected],
[email protected], and so on (all mailboxes in domain example.com)

So, the %u value in everyone_query_filter is "everyone"

Considering your suggestion: (&(accountStatus=active)(uid=%u))
and
dn: uid=user1...:
=================
Is "user1"="everyone" ?
FALSE
So, it won't return any mailboxes.


Considering also the second part of your suggestion, about adding
the attribute [email protected], it has 2 cons:
1) Loop: [email protected] forward to [email protected] and
[email protected], which forward again to [email protected] and
[email protected], and again, and again, and again...
2) Redundant data, may lead to inconsistencies: no sense in having
all mailboxes with a [email protected]. If one does not have
[email protected], the result list of recipients of an email sent
to [email protected] won't be all (everyone) mailboxes.


Thanks,
Ronie


-------- Original Message  --------
Subject: Re: [email protected] virtual_alias_maps using ldap query
From: Reinaldo de Carvalho <[email protected]>
To: Postfix <[email protected]>
Date: Tue Mar 16 2010 20:26:54 GMT-0300

On Tue, Mar 16, 2010 at 6:54 PM, Ronie Gilberto Henrich
<[email protected]> wrote:
Hi,

/etc/postfix/main.cf
====================
virtual_alias_maps = ldap:everyone

everyone_server_host = ldaps://localhost
everyone_version = 3
everyone_search_base = ou=%d,ou=Mail,o=example,c=com
everyone_query_filter = (accountStatus=active)
everyone_result_attribute = mail

For only emails sent to [email protected] to be forwarded to all
mailboxes in example.com, it is necessary to add a filter like
%u=everyone to that ldap query.
I tried the following:
everyone_query_filter = (&(accountStatus=active)(%u=everyone))


everyone_query_filter = (&(accountStatus=active)(uid=%u))
everyone_result_attribute = mail

This work if you add attribute [email protected] for each
ldap entry.

dn: uid=user1...:
[email protected]
[email protected]

dn: uid=user2,...:
[email protected]
[email protected]


But it does not work.


Is there any way to add that %u=everyone filter in the ldap query above?
Or any other way to get the same results and still being dynamic?
I mean dynamic by anything but generating hash alias_maps thru cron
scripts.


Thanks and regards,
Ronie

Reply via email to