class mail::sympa inherits mail::regexps { # Sympa subsystems include mail::web::sympa include mail::packages::sympa # Class configuration case $sympa_database_password { '': { fail("You need to define \$sympa_database_password host config") } } case $sympa_database_name { '': { $sympa_database_name= "sympa" } } case $sympa_database_host { '': { $sympa_database_host = "localhost" } } case $sympa_listmasters { '': { $sympa_listmasters = "listmaster@${fqdn}" } } case $sympa_lang { '': { $sympa_lang = "en_US" } } # # Database configuration # database::instance { "$sympa_database_name": password => "$sympa_database_password", } group { 'sympa': ensure => present, } user { 'sympa': ensure => present, gid => 'sympa', require => Group['sympa'], } service { "sympa": ensure => running, enable => true, hasstatus => false, pattern => '/usr/lib/sympa/bin/sympa.pl', } file { "/etc/sympa": ensure => directory, owner => postfix, group => root, mode => 0755, } file { "/etc/sympa/sympa.conf": ensure => present, owner => sympa, group => sympa, mode => 0640, content => template('mail/sympa/sympa.conf.erb'), require => [ File['/etc/sympa'], User['sympa'] ], notify => Service['apache', 'sympa'], } File["/etc/postfix/transport_regexp"] { content => template('mail/postfix/sympa/transport_regexp.erb'), } File["/etc/postfix/virtual_regexp"] { content => template('mail/postfix/sympa/virtual_regexp.erb'), } postfix::config { "sympa_destination_recipient_limit": value => '1'; "sympabounce_destination_recipient_limit": value => '1'; } mailalias { "sympa": recipient => "|/usr/lib/sympa/bin/queue sympa", notify => Exec["newaliases"], } mailalias { "sympa-request": recipient => "postmaster", notify => Exec["newaliases"], } mailalias { "sympa-owner": recipient => "postmaster", notify => Exec["newaliases"], } mailalias { "listmaster": recipient => "postmaster", notify => Exec["newaliases"], } mailalias { "postmaster": recipient => "root", notify => Exec["newaliases"], } } class mail::sympa::disabled inherits mail::sympa { include mail::web::sympa::disabled Service["sympa"] { ensure => stopped, enable => false, } File["/etc/postfix/transport_regexp"] { content => undef, } File["/etc/postfix/virtual_regexp"] { content => undef, } Mailalias["sympa"] { ensure => absent, } Mailalias["sympa-request"] { ensure => absent, } Mailalias["sympa-owner"] { ensure => absent, } }