aboutsummaryrefslogtreecommitdiffstats
path: root/modules/postfix
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2011-03-08 14:50:43 +0000
committerMichael Scherer <misc@mageia.org>2011-03-08 14:50:43 +0000
commitff81c47444e3819c2b97b43891ac11cb14b14d1b (patch)
tree309102c74a7ad4470f3d2828ec5a5c526e467205 /modules/postfix
parentb742dd6085809b2931e2909a11c3d6040cc83891 (diff)
downloadpuppet-ff81c47444e3819c2b97b43891ac11cb14b14d1b.tar
puppet-ff81c47444e3819c2b97b43891ac11cb14b14d1b.tar.gz
puppet-ff81c47444e3819c2b97b43891ac11cb14b14d1b.tar.bz2
puppet-ff81c47444e3819c2b97b43891ac11cb14b14d1b.tar.xz
puppet-ff81c47444e3819c2b97b43891ac11cb14b14d1b.zip
- first prototype of ldap aliases
Diffstat (limited to 'modules/postfix')
-rw-r--r--modules/postfix/manifests/init.pp10
-rw-r--r--modules/postfix/templates/ldap_aliases.conf11
-rw-r--r--modules/postfix/templates/main.cf2
3 files changed, 22 insertions, 1 deletions
diff --git a/modules/postfix/manifests/init.pp b/modules/postfix/manifests/init.pp
index 8e789b38..c09cbc2b 100644
--- a/modules/postfix/manifests/init.pp
+++ b/modules/postfix/manifests/init.pp
@@ -57,6 +57,16 @@ class postfix {
mode => 644,
content => template("postfix/primary_master.cf"),
}
+
+
+ $ldap_password = extlookup("postfix_ldap",'x')
+ file { '/etc/postfix/ldap_aliases.conf':
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => 644,
+ content => template("postfix/ldap_aliases.conf"),
+ }
}
class secondary_smtp inherits smtp_server {
diff --git a/modules/postfix/templates/ldap_aliases.conf b/modules/postfix/templates/ldap_aliases.conf
new file mode 100644
index 00000000..e249b8ee
--- /dev/null
+++ b/modules/postfix/templates/ldap_aliases.conf
@@ -0,0 +1,11 @@
+<%
+# TODO add some code to take a array of group where people
+# have the aliasing
+%>
+server_host = ldaps://ldap.<%= domain %>:636
+search_base = <%= dc_suffix %>
+query_filter = (&(uid=%u)(memberOf=cn=mga-founders,ou=Group,<%= dc_suffix %>))
+result_attribute = mail
+bind = yes
+bind_dn = cn=postfix-alamut,ou=System Accounts,<%= dc_suffix %>
+bind_pw = <%= ldap_password %>
diff --git a/modules/postfix/templates/main.cf b/modules/postfix/templates/main.cf
index 334fcf43..7474467e 100644
--- a/modules/postfix/templates/main.cf
+++ b/modules/postfix/templates/main.cf
@@ -52,7 +52,7 @@ fallback_transport = regexp:/etc/postfix/transport_regexp
alias_maps = hash:/etc/postfix/aliases
# uncomment if we want to enable ldap based alias
# and create the file
- #ldap:/etc/postfix/ldap_aliases.conf
+ ldap:/etc/postfix/ldap_aliases.conf
<%- end -%>