From c783c4c439aa029f669eeff80788149a9dbe67fa Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 5 Aug 2010 18:41:09 -0300 Subject: Postfixadmin and dovecot configuration --- manifests/dovecot.pp | 12 +++++++----- manifests/postfixadmin.pp | 34 ++++++++++++++++++++++++++++------ 2 files changed, 35 insertions(+), 11 deletions(-) (limited to 'manifests') diff --git a/manifests/dovecot.pp b/manifests/dovecot.pp index 4f9a226..2fda2fc 100644 --- a/manifests/dovecot.pp +++ b/manifests/dovecot.pp @@ -8,16 +8,18 @@ class mail::dovecot { file { "/etc/dovecot/dovecot.conf": ensure => present, owner => root, + group => root, mode => 0644, source => "puppet://$server/modules/mail/dovecot/dovecot.conf", notify => Service['dovecot'], } file { "/etc/dovecot/dovecot-sql.conf": - ensure => present, - owner => root, - mode => 0600, - source => "puppet://$server/modules/mail/dovecot/dovecot-sql.conf", - notify => Service['dovecot'], + ensure => present, + owner => root, + group => root, + mode => 0600, + content => template('dovecot/dovecot-sql.conf.erb'), + notify => Service['dovecot'], } } diff --git a/manifests/postfixadmin.pp b/manifests/postfixadmin.pp index 3d63f1e..f265385 100644 --- a/manifests/postfixadmin.pp +++ b/manifests/postfixadmin.pp @@ -1,11 +1,30 @@ class mail::postfixadmin { - # TODO - # $postfixadmin_user - # $postfixadmin_password - # $postfixadmin_hosts - # $postfixadmin_dbname + # + # Database configuration + # + case $postfixadmin_password { + '': { fail("You need to define \$postfixadmin_password host config") } + } + + case $postfixadmin_user { + '': { $postfixadmin_user = "postfix" } + } + + case $postfixadmin_hosts { + '': { $postfixadmin_hosts = "localhost" } + } + + case $postfixadmin_dbname { + '': { $postfixadmin_dbname= "postfix" } + } + + database::instance { "$postfixadmin_dbname": + password => "$postfixadmin_password", + } - # Postfixadmin + # + # Postfix configuration + # postfix::config { "virtual_mailbox_domains": value => 'proxy:mysql:/etc/postfix/sql/mysql_virtual_domains_maps.cf', require => File['/etc/postfix/sql/mysql_virtual_domains_maps.cf'], @@ -36,6 +55,9 @@ class mail::postfixadmin { postfix::config { "virtual_maildir_limit_message": value => 'The user's maildir has overdrawn his quota, try again later.' } postfix::config { "virtual_overquota_bounce": value => 'yes' } + # + # Map files + # file { "/etc/postfix/sql/mysql_virtual_domains_maps.cf": ensure => present, owner => root, -- cgit v1.2.3