class mail::sympa { # 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", privileges => $lsbdistcodename ? { 'lenny' => 'all', default => [ 'alter_priv', 'alter_routine_priv', 'create_priv', 'create_routine_priv', 'create_tmp_table_priv', 'create_view_priv', 'delete_priv', 'drop_priv', 'event_priv', 'execute_priv', 'grant_priv', 'index_priv', 'insert_priv', 'lock_tables_priv', 'references_priv', 'select_priv', 'show_view_priv', 'trigger_priv', 'update_priv' ], } } 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.${lsbdistcodename}.erb"), require => [ File['/etc/sympa'], User['sympa'] ], notify => Service['apache', 'sympa'], } file { "/etc/logrotate.d/sympa": ensure => present, owner => root, group => root, mode => 0644, source => "puppet:///modules/mail/sympa/logrotate", } postfix::transport_regexp_snippet { 'sympa_transport_regexp': content => template('mail/postfix/sympa/transport_regexp.erb'), } postfix::virtual_regexp_snippet { 'sympa_virtual_regexp': content => template('mail/postfix/sympa/virtual_regexp.erb'), } postfix::config { "sympa_destination_recipient_limit": value => '1', nonstandard => true; "sympabounce_destination_recipient_limit": value => '1', nonstandard => true; } 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"], } mailalias { "abuse-feedback-report": recipient => "|/usr/lib/sympa/bin/bouncequeue sympa", notify => Exec["newaliases"], } mailalias { "bounce+*": recipient => "|/usr/lib/sympa/bin/bouncequeue sympa", notify => Exec["newaliases"], } # # Listserv compatibility # mailalias { "listserv": recipient => "sympa", notify => Exec["newaliases"], } mailalias { "listserv-request": recipient => "sympa-request", notify => Exec["newaliases"], } mailalias { "listserv-owner": recipient => "sympa-owner", notify => Exec["newaliases"], } mailalias { "majordomo": recipient => "sympa", notify => Exec["newaliases"], } } class mail::sympa::disabled inherits mail::sympa { include mail::web::sympa::disabled Service["sympa"] { ensure => stopped, enable => false, } Postfix::Transport_regexp_snippet['sympa_transport_regexp'] { content => undef, } Postfix::Virtual_regexp_snippet['sympa_virtual_regexp'] { content => undef, } Mailalias["sympa"] { ensure => absent, } Mailalias["sympa-request"] { ensure => absent, } Mailalias["sympa-owner"] { ensure => absent, } Mailalias["abuse-feedback-report"] { ensure => absent, } Mailalias["bounce+*"] { ensure => absent, } Mailalias["listserv"] { ensure => absent, } Mailalias["listserv-request"] { ensure => absent, } Mailalias["listserv-owner"] { ensure => absent, } Mailalias["majordomo"] { ensure => absent, } }