aboutsummaryrefslogtreecommitdiffstats
path: root/modules/postfix
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2011-03-08 14:50:45 +0000
committerMichael Scherer <misc@mageia.org>2011-03-08 14:50:45 +0000
commit3dc06dfd8b69423d67df09283ec61e762b6099c9 (patch)
treec99524c68c1fc53e6a82d36707bcb7b43f569ed2 /modules/postfix
parentff81c47444e3819c2b97b43891ac11cb14b14d1b (diff)
downloadpuppet-3dc06dfd8b69423d67df09283ec61e762b6099c9.tar
puppet-3dc06dfd8b69423d67df09283ec61e762b6099c9.tar.gz
puppet-3dc06dfd8b69423d67df09283ec61e762b6099c9.tar.bz2
puppet-3dc06dfd8b69423d67df09283ec61e762b6099c9.tar.xz
puppet-3dc06dfd8b69423d67df09283ec61e762b6099c9.zip
allow to have more than one ldap group with aliases
Diffstat (limited to 'modules/postfix')
-rw-r--r--modules/postfix/manifests/init.pp3
-rw-r--r--modules/postfix/templates/ldap_aliases.conf13
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 %>