Hi Reinaldo,

The problem about your solution below is that it will go into a loop.
1) Loop: every...@example.com forward to us...@example.com and
every...@example.com, which forward again to us...@example.com and
every...@example.com, and again, and again, and again...

If you are a developer of the project Postfix, is it easy to add support for variables (%u) on the left side?
Example:
everyone_query_filter = (&(accountStatus=active)(%u=everyone))

Thanks,
Ronie


-------- Original Message  --------
Subject: Re: every...@example.com virtual_alias_maps using ldap query
From: Reinaldo de Carvalho <reinal...@gmail.com>
To: ro...@ronie.com.br
Date: Wed Mar 17 2010 08:19:47 GMT-0300
On Tue, Mar 16, 2010 at 10:38 PM, Ronie Gilberto Henrich
<ro...@ronie.com.br> wrote:
  
Hi Reinaldo,

Let me explain better how virtual_alias_maps works in this case:
1) Someone send an email to every...@example.com
2) Query ldap:everyone result has to be us...@example.com,
us...@example.com, 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.

    

Sorry, I misunderstand your question. Is not possible create
"everyone" as you request. You need a cron job.

Maybe... (don't tested)

everyone_query_filter = (&(accountStatus=active)(mail=%s))
everyone_result_attribute = uid
everyone_result_format = %...@example.com

This work if you add attribute mail=every...@example.com for each ldap entry.

dn: uid=user1...:
uid=user1
mail=us...@example.com
mail=every...@example.com

dn: uid=user2,...:
uid=user2
mail=us...@example.com
mail=every...@example.com
- Show quoted text -


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


Thanks,
Ronie


-------- Original Message  --------
Subject: Re: every...@example.com virtual_alias_maps using ldap query
From: Reinaldo de Carvalho <reinal...@gmail.com>
To: Postfix <postfix-users@postfix.org>
Date: Tue Mar 16 2010 20:26:54 GMT-0300

On Tue, Mar 16, 2010 at 6:54 PM, Ronie Gilberto Henrich
<ro...@ronie.com.br> 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 every...@example.com 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 mail=every...@example.com for each
ldap entry.

dn: uid=user1...:
mail=us...@example.com
mail=every...@example.com

dn: uid=user2,...:
mail=us...@example.com
mail=every...@example.com


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