summaryrefslogtreecommitdiff
path: root/manifests/mlmmj
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/mlmmj')
-rw-r--r--manifests/mlmmj/list.pp19
-rw-r--r--manifests/mlmmj/packages.pp5
-rw-r--r--manifests/mlmmj/web.pp33
-rw-r--r--manifests/mlmmj/web/disabled.pp18
4 files changed, 75 insertions, 0 deletions
diff --git a/manifests/mlmmj/list.pp b/manifests/mlmmj/list.pp
new file mode 100644
index 0000000..13f30a9
--- /dev/null
+++ b/manifests/mlmmj/list.pp
@@ -0,0 +1,19 @@
+# From transport(5):
+#
+# The trivial-rewrite(8) server disallows regular expression
+# substitution of $1 etc. in regular expression lookup
+# tables, because that could open a security hole (Postfix
+# version 2.3 and later).
+#
+# That's why we need one definition per mailing list.
+define mail::mlmmj::list($ensure = 'present') {
+ postfix::transport_regexp_snippet { "mlmmj_transport_regexp-${name}":
+ content => "/^(${name})\\@.*$/ mlmmj:${name}\n",
+ ensure => $ensure,
+ }
+
+ postfix::transport_regexp_snippet { "mlmmj_transport_regexp-${name}-request":
+ content => "/^(${name})\\+.*\\@.*$/ mlmmj:${name}\n",
+ ensure => $ensure,
+ }
+}
diff --git a/manifests/mlmmj/packages.pp b/manifests/mlmmj/packages.pp
new file mode 100644
index 0000000..34c133d
--- /dev/null
+++ b/manifests/mlmmj/packages.pp
@@ -0,0 +1,5 @@
+class mail::mlmmj::packages {
+ package { 'mlmmj':
+ ensure => installed,
+ }
+}
diff --git a/manifests/mlmmj/web.pp b/manifests/mlmmj/web.pp
new file mode 100644
index 0000000..b0a79d4
--- /dev/null
+++ b/manifests/mlmmj/web.pp
@@ -0,0 +1,33 @@
+class mail::mlmmj::web inherits websites::setup {
+ $mlmmj_subdomain = hiera('mlmmj_subdomain')
+
+ apache::site { "${mail::mlmmj::subdomain}":
+ docroot => "/usr/share/mlmmj-php-web-admin",
+ owner => 'mlmmj',
+ group => 'mlmmj',
+ mpm_user => 'mlmmj',
+ mpm_group => 'mlmmj',
+ manage_user => false,
+ require => Package['mlmmj-php-web-admin'],
+ }
+
+ package { [ 'mlmmj-php-web', 'mlmmj-php-web-admin' ]:
+ ensure => present,
+ }
+
+ file { '/etc/mlmmj-php-web-admin':
+ ensure => directory,
+ owner => mlmmj,
+ group => mlmmj,
+ mode => 0640,
+ }
+
+ file { '/etc/mlmmj-php-web-admin/htpasswd':
+ ensure => present,
+ owner => mlmmj,
+ group => mlmmj,
+ mode => 0640,
+ source => [ "puppet:///modules/site_mail/mlmmj/htpasswd",
+ "puppet:///modules/mail/mlmmj/htpasswd" ],
+ }
+}
diff --git a/manifests/mlmmj/web/disabled.pp b/manifests/mlmmj/web/disabled.pp
new file mode 100644
index 0000000..bf29d7b
--- /dev/null
+++ b/manifests/mlmmj/web/disabled.pp
@@ -0,0 +1,18 @@
+class mail::mlmmj::web::disabled inherits mail::web::mlmmj {
+ Apache::Site["$mlmmj_subdomain"] {
+ ensure => absent,
+ }
+
+ Package[ 'mlmmj-php-web', 'mlmmj-php-web-admin' ] {
+ ensure => absent,
+ }
+
+ File['/etc/mlmmj-php-web-admin'] {
+ ensure => absent,
+ force => true,
+ }
+
+ File['/etc/mlmmj-php-web-admin/htpasswd'] {
+ ensure => absent,
+ }
+}