diff options
-rw-r--r-- | modules/postfix/manifests/init.pp | 3 | ||||
-rw-r--r-- | modules/postfix/templates/ldap_aliases.conf | 13 |
2 files changed, 10 insertions, 6 deletions
diff --git a/modules/postfix/manifests/init.pp b/modules/postfix/manifests/init.pp index c09cbc2b..c184f298 100644 --- a/modules/postfix/manifests/init.pp +++ b/modules/postfix/manifests/init.pp @@ -58,7 +58,8 @@ class postfix { content => template("postfix/primary_master.cf"), } - + + $aliases_group = ['mga-founders'] $ldap_password = extlookup("postfix_ldap",'x') file { '/etc/postfix/ldap_aliases.conf': ensure => present, diff --git a/modules/postfix/templates/ldap_aliases.conf b/modules/postfix/templates/ldap_aliases.conf index e249b8ee..8bca9017 100644 --- a/modules/postfix/templates/ldap_aliases.conf +++ b/modules/postfix/templates/ldap_aliases.conf @@ -1,10 +1,13 @@ -<% -# TODO add some code to take a array of group where people -# have the aliasing -%> +<%- +# TODO I am sure that a more elegant way could be find +query_string = '' +aliases_group.each do |g| + query_string += '(memberOf=cn=' + g + ',ou=Group,' + dc_suffix + ')' +end +-%> server_host = ldaps://ldap.<%= domain %>:636 search_base = <%= dc_suffix %> -query_filter = (&(uid=%u)(memberOf=cn=mga-founders,ou=Group,<%= dc_suffix %>)) +query_filter = (&(uid=%u)(|<%= query_string %>)) result_attribute = mail bind = yes bind_dn = cn=postfix-alamut,ou=System Accounts,<%= dc_suffix %> |