summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-06-27 16:47:54 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-06-27 16:47:54 -0300
commitf9f925230cee5c41f77357b7b1c8925e4a0caf7c (patch)
tree9232c96296e191905e494b99eeb378b2dd5b7503
parentba0c856f111abcb0120a5b77ecf3b137d0152100 (diff)
downloadpuppet-mail-f9f925230cee5c41f77357b7b1c8925e4a0caf7c.tar.gz
puppet-mail-f9f925230cee5c41f77357b7b1c8925e4a0caf7c.tar.bz2
Be more explicit on virtual and transport regexps and allow more virtual domains to be defined
-rw-r--r--manifests/firma.pp8
-rw-r--r--manifests/firma/domain.pp11
-rw-r--r--manifests/mlmmj.pp8
-rw-r--r--manifests/mlmmj/domain.pp11
-rw-r--r--manifests/sympa.pp8
-rw-r--r--manifests/sympa/domain.pp11
-rw-r--r--templates/firma/transport_regexp.erb4
-rw-r--r--templates/firma/virtual_regexp.erb2
-rw-r--r--templates/mlmmj/virtual_regexp.erb2
-rw-r--r--templates/sympa/transport_regexp.erb4
-rw-r--r--templates/sympa/virtual_regexp.erb2
11 files changed, 43 insertions, 28 deletions
diff --git a/manifests/firma.pp b/manifests/firma.pp
index 0d4ea84..5662733 100644
--- a/manifests/firma.pp
+++ b/manifests/firma.pp
@@ -7,13 +7,7 @@ class mail::firma(
postfix::config { "firma_destination_recipient_limit": value => '1', nonstandard => true }
- postfix::transport_regexp_snippet { 'firma_transport_regexp':
- content => template('mail/firma/transport_regexp.erb'),
- }
-
- postfix::virtual_regexp_snippet { 'firma_virtual_regexp':
- content => template('mail/firma/virtual_regexp.erb'),
- }
+ mail::firma::domain { "${subdomain}.${domain}": }
postfix::transport { "${subdomain}.$domain":
ensure => absent,
diff --git a/manifests/firma/domain.pp b/manifests/firma/domain.pp
new file mode 100644
index 0000000..6f6a794
--- /dev/null
+++ b/manifests/firma/domain.pp
@@ -0,0 +1,11 @@
+define mail::firma::domain() {
+ $subdomain = $name
+
+ postfix::transport_regexp_snippet { "firma_transport_regexp-${name}":
+ content => template('mail/firma/transport_regexp.erb'),
+ }
+
+ postfix::virtual_regexp_snippet { "firma_virtual_regexp-${name}":
+ content => template('mail/firma/virtual_regexp.erb'),
+ }
+}
diff --git a/manifests/mlmmj.pp b/manifests/mlmmj.pp
index dcb6d2f..56bfc64 100644
--- a/manifests/mlmmj.pp
+++ b/manifests/mlmmj.pp
@@ -32,11 +32,5 @@ class mail::mlmmj(
# require => User['mlmmj'],
#}
- #postfix::transport_regexp_snippet { 'mlmmj_transport_regexp':
- # content => template('mail/mlmmj/transport_regexp.erb'),
- #}
-
- postfix::virtual_regexp_snippet { 'mlmmj_virtual_regexp':
- content => template('mail/mlmmj/virtual_regexp.erb'),
- }
+ mail::mlmmj::domain { "${subdomain}.${domain}": }
}
diff --git a/manifests/mlmmj/domain.pp b/manifests/mlmmj/domain.pp
new file mode 100644
index 0000000..f193cc7
--- /dev/null
+++ b/manifests/mlmmj/domain.pp
@@ -0,0 +1,11 @@
+define mail::mlmmj::domain() {
+ $subdomain = $name
+
+ #postfix::transport_regexp_snippet { 'mlmmj_transport_regexp':
+ # content => template('mail/mlmmj/transport_regexp.erb'),
+ #}
+
+ postfix::virtual_regexp_snippet { 'mlmmj_virtual_regexp':
+ content => template('mail/mlmmj/virtual_regexp.erb'),
+ }
+}
diff --git a/manifests/sympa.pp b/manifests/sympa.pp
index 4ba528a..2c9a373 100644
--- a/manifests/sympa.pp
+++ b/manifests/sympa.pp
@@ -102,13 +102,7 @@ class mail::sympa(
require => Service['sympa'],
}
- postfix::transport_regexp_snippet { 'sympa_transport_regexp':
- content => template('mail/sympa/transport_regexp.erb'),
- }
-
- postfix::virtual_regexp_snippet { 'sympa_virtual_regexp':
- content => template('mail/sympa/virtual_regexp.erb'),
- }
+ mail::sympa::domain { "${subdomain}.${domain}": }
postfix::config {
"sympa_destination_recipient_limit": value => '1', nonstandard => true;
diff --git a/manifests/sympa/domain.pp b/manifests/sympa/domain.pp
new file mode 100644
index 0000000..7da9a89
--- /dev/null
+++ b/manifests/sympa/domain.pp
@@ -0,0 +1,11 @@
+define mail::sympa::domain() {
+ $subdomain = $name
+
+ postfix::transport_regexp_snippet { 'sympa_transport_regexp':
+ content => template('mail/sympa/transport_regexp.erb'),
+ }
+
+ postfix::virtual_regexp_snippet { 'sympa_virtual_regexp':
+ content => template('mail/sympa/virtual_regexp.erb'),
+ }
+}
diff --git a/templates/firma/transport_regexp.erb b/templates/firma/transport_regexp.erb
index 27c65af..fb715f5 100644
--- a/templates/firma/transport_regexp.erb
+++ b/templates/firma/transport_regexp.erb
@@ -1,2 +1,2 @@
-/^.*+request\@<%= subdomain.gsub(/\./, '\.') %>\.(.*)$/ firmarequest:
-/^.*\@<%= subdomain.gsub(/\./, '\.') %>\.(.*)$/ firma:
+/^.*+request\@<%= subdomain.gsub(/\./, '\.') %>$/ firmarequest:
+/^.*\@<%= subdomain.gsub(/\./, '\.') %>$/ firma:
diff --git a/templates/firma/virtual_regexp.erb b/templates/firma/virtual_regexp.erb
index 767f3c1..310cacd 100644
--- a/templates/firma/virtual_regexp.erb
+++ b/templates/firma/virtual_regexp.erb
@@ -1 +1 @@
-/^(.*)-request\@<%= subdomain.gsub(/\./, '\.') %>\.(.*)$/ $1+request@<%= subdomain %>.$2
+/^(.*)-request\@<%= subdomain.gsub(/\./, '\.') %>$/ $1+request@<%= subdomain %>
diff --git a/templates/mlmmj/virtual_regexp.erb b/templates/mlmmj/virtual_regexp.erb
index 57f1a72..e93ebcd 100644
--- a/templates/mlmmj/virtual_regexp.erb
+++ b/templates/mlmmj/virtual_regexp.erb
@@ -1 +1 @@
-/^(.*)\@<%= subdomain.gsub(/\./, '\.') %>\.(.*)$/ ${1}
+/^(.*)\@<%= subdomain.gsub(/\./, '\.') %>$/ ${1}
diff --git a/templates/sympa/transport_regexp.erb b/templates/sympa/transport_regexp.erb
index 1e32e2a..6323836 100644
--- a/templates/sympa/transport_regexp.erb
+++ b/templates/sympa/transport_regexp.erb
@@ -1,2 +1,2 @@
-/^.*+owner\@<%= subdomain.gsub(/\./, '\.') %>\.(.*)$/ sympabounce:
-/^.*\@<%= subdomain.gsub(/\./, '\.') %>\.(.*)$/ sympa:
+/^.*+owner\@<%= subdomain.gsub(/\./, '\.') %>$/ sympabounce:
+/^.*\@<%= subdomain.gsub(/\./, '\.') %>$/ sympa:
diff --git a/templates/sympa/virtual_regexp.erb b/templates/sympa/virtual_regexp.erb
index f5883d7..b82b9df 100644
--- a/templates/sympa/virtual_regexp.erb
+++ b/templates/sympa/virtual_regexp.erb
@@ -1 +1 @@
-/^(.*)-owner\@<%= subdomain.gsub(/\./, '\.') %>\.(.*)$/ $1+owner@<%= subdomain %>.$2
+/^(.*)-owner\@<%= subdomain.gsub(/\./, '\.') %>$/ $1+owner@<%= subdomain %>