diff options
-rw-r--r-- | manifests/base.pp | 2 | ||||
-rw-r--r-- | manifests/postfixadmin.pp | 2 | ||||
-rw-r--r-- | manifests/sympa.pp | 23 | ||||
-rw-r--r-- | templates/postfix/transport_regexp.erb | 2 | ||||
-rw-r--r-- | templates/postfix/virtual_regexp.erb | 1 |
5 files changed, 28 insertions, 2 deletions
diff --git a/manifests/base.pp b/manifests/base.pp index 972fa10..7aa96b1 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -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'; diff --git a/manifests/postfixadmin.pp b/manifests/postfixadmin.pp index 8cbcf54..be3e312 100644 --- a/manifests/postfixadmin.pp +++ b/manifests/postfixadmin.pp @@ -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' ], diff --git a/manifests/sympa.pp b/manifests/sympa.pp index 2ce336b..b604006 100644 --- a/manifests/sympa.pp +++ b/manifests/sympa.pp @@ -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 index 0000000..a7885f7 --- /dev/null +++ b/templates/postfix/transport_regexp.erb @@ -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 index 0000000..b1c1245 --- /dev/null +++ b/templates/postfix/virtual_regexp.erb @@ -0,0 +1 @@ +/^(.*)-owner\@<%= sympa_subdomain.gsub(/\./, '\.') %>\.(.*)$/ $1+owner@$2 |