Hi,

I have been using Postfix with MySQL for a few years now, but I want to move to 
LDAP (FreeIPA) to store my user’s data.

I figured out all the queries I need, except one. You see, right now, I use 
Postfixadmin and my query for virtual_mailbox_domains is like this:

query = SELECT goto FROM alias,alias_domain WHERE alias_domain.alias_domain = 
'%d' and alias.address = CONCAT('%u', '@', alias_domain.target_domain) AND 
alias.active = 1 AND alias_domain.active=‘1’

So it basically checks a list of all valid addresses, and try to match with the 
target domain.

I am struggling with LDAP to do this, mostly because LDAP doesn’t do nested 
searches, at least not in the way MySQL does.

My directory is structured like this:

cn=postfix - root for my configuration
  cn=mydomain.com,cn=postix - container for mailboxes and aliases
     uid=myuser,cn=mydomain.com,cn=postfix - my mailbox or my alias
     uid=myaliasdomain.com,cn=mydomain.com,cn=postfix - my alias domain 
(different objectClass)

My main problem is how to get the «target» domain from a query to check if 
there’s a valid mailbox/alias configured for the target domain.

I created an attribute on my alias domain called «targetDomain», but I don’t 
think it is possible with LDAP to read its value, concatenate with the %s and 
query again.

Is there a way to accomplish something like this?

Best,
Francis

_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org
  • [pfx] LDAP - how to desi... Francis Augusto Medeiros-Logeay via Postfix-users

Reply via email to