From 2a99530fd499534282de62737f72ce1ef6b106c9 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 15 Aug 2010 13:40:41 -0300 Subject: Adding schleuder package class, imp4 package and mail::base class --- manifests/base.pp | 53 ++++++++++++++++++++++++++++++++++++++++++++++ manifests/init.pp | 1 + manifests/packages.pp | 8 ++++++- manifests/system.pp | 58 +++++++-------------------------------------------- 4 files changed, 68 insertions(+), 52 deletions(-) create mode 100644 manifests/base.pp (limited to 'manifests') diff --git a/manifests/base.pp b/manifests/base.pp new file mode 100644 index 0000000..972fa10 --- /dev/null +++ b/manifests/base.pp @@ -0,0 +1,53 @@ +class mail::base { + # Postfix configuration + postfix::config { + "mydomain": value => "$domain"; + "myhostname": value => "$fqdn"; + "mydestination": value => "$postfix_mydestination"; + "mynetworks": value => "$postfix_mynetworks"; + "relay_domains": value => '$mydestination'; + "transport_maps": value => "hash:/etc/postfix/transport"; + "mailbox_command": value => '/usr/bin/maildrop -d ${USER}'; + "virtual_mailbox_base": value => '/var/mail/virtual'; + "virtual_uid_maps": value => 'static:5000'; + "virtual_gid_maps": value => 'static:5000'; + "virtual_transport": value => 'dovecot'; + "dovecot_destination_recipient_limit": value => '1'; + "recipient_delimiter": value => '+'; + } + + postfix::hash { "/etc/postfix/virtual": + ensure => present, + } + + postfix::hash { "/etc/postfix/transport": + ensure => present, + } + + # Recipient restrictions + postfix::config { "smtpd_recipient_restrictions": + value => 'permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_rbl_client psbl.surriel.com, check_policy_service inet:127.0.0.1:60000' } + + # Virtual mailboxes + file { '/var/mail/virtual': + ensure => directory, + owner => vmail, + group => vmail, + mode => 0750, + require => User['vmail'], + } + + group { "vmail": + ensure => present, + gid => 5000, + } + + user { "vmail": + ensure => present, + uid => 5000, + gid => "vmail", + password => "*", + home => '/var/mail/virtual', + require => Group['vmail'], + } +} diff --git a/manifests/init.pp b/manifests/init.pp index 74abb21..bed6e69 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -12,3 +12,4 @@ import "tls.pp" import "amavisd.pp" import "web.pp" import "sympa.pp" +import "base.pp" diff --git a/manifests/packages.pp b/manifests/packages.pp index 661bdc8..ec52009 100644 --- a/manifests/packages.pp +++ b/manifests/packages.pp @@ -12,7 +12,7 @@ class mail::packages { ensure => installed, } - package { [ 'squirrelmail', 'squirrelmail-locales' ]: + package { [ 'squirrelmail', 'squirrelmail-locales', 'imp4' ]: ensure => installed, } @@ -27,3 +27,9 @@ class mail::packages::sympa { ensure => installed, } } + +class mail::packages::schleuder { + package { 'schleuder': + ensure => installed, + } +} diff --git a/manifests/system.pp b/manifests/system.pp index 86781ad..991764b 100644 --- a/manifests/system.pp +++ b/manifests/system.pp @@ -38,6 +38,7 @@ class mail::system { # Subsystems include mail::packages + include mail::base include mail::sasl include mail::tls include mail::dovecot @@ -46,7 +47,7 @@ class mail::system { include mail::postfixadmin include mail::web - # Mailing list manager + # Sympa mailing list manager case $mail_sympa { true: { @@ -64,55 +65,10 @@ class mail::system { } } - # Postfix configuration - postfix::config { - "mydomain": value => "$domain"; - "myhostname": value => "$fqdn"; - "mydestination": value => "$postfix_mydestination"; - "mynetworks": value => "$postfix_mynetworks"; - "relay_domains": value => '$mydestination'; - "transport_maps": value => "hash:/etc/postfix/transport"; - "mailbox_command": value => '/usr/bin/maildrop -d ${USER}'; - "virtual_mailbox_base": value => '/var/mail/virtual'; - "virtual_uid_maps": value => 'static:5000'; - "virtual_gid_maps": value => 'static:5000'; - "virtual_transport": value => 'dovecot'; - "dovecot_destination_recipient_limit": value => '1'; - "recipient_delimiter": value => '+'; - } - - postfix::hash { "/etc/postfix/virtual": - ensure => present, - } - - postfix::hash { "/etc/postfix/transport": - ensure => present, - } - - # Recipient restrictions - postfix::config { "smtpd_recipient_restrictions": - value => 'permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_rbl_client psbl.surriel.com, check_policy_service inet:127.0.0.1:60000' } - - # Virtual mailboxes - file { '/var/mail/virtual': - ensure => directory, - owner => vmail, - group => vmail, - mode => 0750, - require => User['vmail'], - } - - group { "vmail": - ensure => present, - gid => 5000, - } - - user { "vmail": - ensure => present, - uid => 5000, - gid => "vmail", - password => "*", - home => '/var/mail/virtual', - require => Group['vmail'], + # Schleuder mailing list manager + case $mail_schleuder { + true: { + include mail::packages::schleuder + } } } -- cgit v1.2.3