]> gitweb.fluxo.info Git - puppet-mail.git/commitdiff
Managing sympa and postfix integration
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 25 Aug 2010 18:09:32 +0000 (15:09 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 25 Aug 2010 18:09:32 +0000 (15:09 -0300)
manifests/base.pp
manifests/postfixadmin.pp
manifests/sympa.pp
templates/postfix/transport_regexp.erb [new file with mode: 0644]
templates/postfix/virtual_regexp.erb [new file with mode: 0644]

index 972fa100ddced5eca1d005eba1837019434a9753..7aa96b12bc7972c87932c0831c9f66eb0f049843 100644 (file)
@@ -6,7 +6,7 @@ class mail::base {
     "mydestination":                       value => "$postfix_mydestination";
     "mynetworks":                          value => "$postfix_mynetworks";
     "relay_domains":                       value => '$mydestination';
-    "transport_maps":                      value => "hash:/etc/postfix/transport";
+    "transport_maps":                      value => "hash:/etc/postfix/transport, regexp:/etc/postfix/transport_regexp";
     "mailbox_command":                     value => '/usr/bin/maildrop -d ${USER}';
     "virtual_mailbox_base":                value => '/var/mail/virtual';
     "virtual_uid_maps":                    value => 'static:5000';
index 8cbcf54eb3e9950eac85764da60bf2eaa3895111..be3e312d9c0039b3f3e31eb94171e9ed50832589 100644 (file)
@@ -15,7 +15,7 @@ class mail::postfixadmin {
   }
 
   postfix::config { "virtual_alias_maps":
-    value   => 'hash:/etc/postfix/virtual, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf',
+    value   => 'hash:/etc/postfix/virtual, regexp:/etc/postfix/virtual_regexp, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf',
     require => File['/etc/postfix/sql/mysql_virtual_alias_maps.cf',
                     '/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf',
                     '/etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf' ],
index 2ce336b2e76a2d5b04f609c50b9e5ae1b7426804..b604006abfafabd83641281de391e581bf47d0a2 100644 (file)
@@ -31,4 +31,27 @@ class mail::sympa {
     content => template('mail/sympa/sympa.conf.erb'),
     require => [ File['/etc/sympa'], User['sympa'] ],
   }
+
+  file { "/etc/postfix/transport_regexp":
+    ensure  => present,
+    owner   => root,
+    group   => root,
+    mode    => 0644,
+    content => template('mail/postfix/transport_regexp.erb'),
+    notify  => Service['postfix'],
+  }
+
+  file { "/etc/postfix/virtual_regexp":
+    ensure  => present,
+    owner   => root,
+    group   => root,
+    mode    => 0644,
+    content => template('mail/postfix/virtual_regexp.erb'),
+    notify  => Service['postfix'],
+  }
+
+  postfix::config {
+    "sympa_destination_recipient_limit":       value => '1';
+    "sympabounce_destination_recipient_limit": value => '1';
+  }
 }
diff --git a/templates/postfix/transport_regexp.erb b/templates/postfix/transport_regexp.erb
new file mode 100644 (file)
index 0000000..a7885f7
--- /dev/null
@@ -0,0 +1,2 @@
+/^.*+owner\@<%= sympa_subdomain.gsub(/\./, '\.') %>\.(.*)$/ sympabounce:
+/^.*\@<%= sympa_subdomain.gsub(/\./, '\.') %>\.(.*)$/       sympa:
diff --git a/templates/postfix/virtual_regexp.erb b/templates/postfix/virtual_regexp.erb
new file mode 100644 (file)
index 0000000..b1c1245
--- /dev/null
@@ -0,0 +1 @@
+/^(.*)-owner\@<%= sympa_subdomain.gsub(/\./, '\.') %>\.(.*)$/                    $1+owner@$2