aboutsummaryrefslogtreecommitdiffstats
path: root/modules/postfix
diff options
context:
space:
mode:
authorMichael Scherer <misc@mageia.org>2011-03-24 02:43:08 +0000
committerMichael Scherer <misc@mageia.org>2011-03-24 02:43:08 +0000
commitd951a3d57cfeeab450450b7cdfb51b9844a3c648 (patch)
tree6f9a991168aec934dbac0010892a7866fe5f283b /modules/postfix
parent8ecda71a868edee70b396d241cf77012bd52d8a3 (diff)
downloadpuppet-d951a3d57cfeeab450450b7cdfb51b9844a3c648.tar
puppet-d951a3d57cfeeab450450b7cdfb51b9844a3c648.tar.gz
puppet-d951a3d57cfeeab450450b7cdfb51b9844a3c648.tar.bz2
puppet-d951a3d57cfeeab450450b7cdfb51b9844a3c648.tar.xz
puppet-d951a3d57cfeeab450450b7cdfb51b9844a3c648.zip
- add support for mailing all people in a ldap group
Diffstat (limited to 'modules/postfix')
-rw-r--r--modules/postfix/manifests/init.pp12
-rw-r--r--modules/postfix/templates/group_aliases.conf12
-rw-r--r--modules/postfix/templates/main.cf4
3 files changed, 27 insertions, 1 deletions
diff --git a/modules/postfix/manifests/init.pp b/modules/postfix/manifests/init.pp
index 3f74a5e6..28302f1f 100644
--- a/modules/postfix/manifests/init.pp
+++ b/modules/postfix/manifests/init.pp
@@ -72,6 +72,18 @@ class postfix {
content => template("postfix/ldap_aliases.conf"),
}
+ # TODO merge the file with the previous one, for common part (ldap, etc)
+ file { '/etc/postfix/group_aliases.conf':
+ ensure => present,
+ owner => root,
+ group => root,
+ mode => 644,
+ content => template("postfix/group_aliases.conf"),
+ }
+
+
+
+
file { '/etc/postfix/virtual_aliases':
ensure => present,
owner => root,
diff --git a/modules/postfix/templates/group_aliases.conf b/modules/postfix/templates/group_aliases.conf
new file mode 100644
index 00000000..85788e41
--- /dev/null
+++ b/modules/postfix/templates/group_aliases.conf
@@ -0,0 +1,12 @@
+server_host = ldaps://ldap.<%= domain %>:636
+search_base = <%= dc_suffix %>
+query_filter = (&(cn=mga-%u)(objectClass=groupOfNames))
+result_attribute = mail
+special_result_attribute = member
+bind = yes
+bind_dn = cn=postfix-<%= hostname %>,ou=System Accounts,<%= dc_suffix %>
+bind_pw = <%= ldap_password %>
+# postfix complain on url
+# warning: dict_ldap_open: URL scheme ldaps requires protocol version 3
+version = 3
+domain = group.<%= domain %>
diff --git a/modules/postfix/templates/main.cf b/modules/postfix/templates/main.cf
index 5146d5f9..c4f642db 100644
--- a/modules/postfix/templates/main.cf
+++ b/modules/postfix/templates/main.cf
@@ -43,7 +43,8 @@ mydestination = <%= fqdn %>
<%- if all_tags.include?('postfix::primary_smtp') -%>
-virtual_mailbox_domains = <%= domain %>
+virtual_mailbox_domains = <%= domain %>,
+ group.<%= domain %>
# postfix complain if not set
# Mar 22 23:51:20 alamut postfix/virtual[22952]: fatal: bad string length 0 < 1: virtual_mailbox_base =
@@ -61,6 +62,7 @@ fallback_transport_maps = regexp:/etc/postfix/transport_regexp
alias_maps = hash:/etc/postfix/aliases
virtual_alias_maps = ldap:/etc/postfix/ldap_aliases.conf
+ ldap:/etc/postfix/group_aliases.conf
hash:/etc/postfix/virtual_aliases
<%- end -%>