Puppet Class: otrs::mail

Defined in:
modules/otrs/manifests/mail.pp

Overview

Class: otrs::mail

This class installs/configures the exim part of the WMF OTRS installation

Parameters:

$otrs_mysql_database
    The name of the OTRS database
$otrs_mysql_user
    The user for exim to connect to the OTRS database
$otrs_mysql_password
    The password for exim to connect to the OTRS database
$trusted_networks
    OTRS trusted networks by exim/spamassasin

Actions:

Install/configure exim/spamassasin

Requires:

Sample Usage:

class { 'otrs::mail'
    otrs_mysql_database => 'otrs',
    otrs_mysql_user => 'exim',
    otrs_mysql_password => 'pass',
    trusted_networks => [],
}

Parameters:

  • otrs_mysql_database (Any)
  • otrs_mysql_user (Any)
  • otrs_mysql_password (Any)
  • trusted_networks (Any)


28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'modules/otrs/manifests/mail.pp', line 28

class otrs::mail(
    $otrs_mysql_database,
    $otrs_mysql_user,
    $otrs_mysql_password,
    $trusted_networks,
){
    class { '::clamav':
        proxy => "webproxy.${::site}.wmnet:8080",
    }

    class { '::exim4':
        variant => 'heavy',
        config  => template('otrs/exim4.conf.otrs.erb'),
        filter  => template('otrs/system_filter.conf.otrs.erb'),
        require => [
            Class['spamassassin'],
            Class['clamav'],
        ],
    }
    class { '::spamassassin':
        required_score        => '3.5',# (5.0)
        use_bayes             => '1',  # 0|(1)
        bayes_auto_learn      => '0',  # 0|(1)
        short_report_template => true, # true|(false)
        trusted_networks      => $trusted_networks,
        custom_scores         => {
            'RP_MATCHES_RCVD'   => '-0.500',
            'SPF_SOFTFAIL'      => '2.000',
            'SUSPICIOUS_RECIPS' => '2.000',
            'DEAR_SOMETHING'    => '1.500',
        },
        debug_logging         => '--debug spf',
        proxy                 => "webproxy.${::site}.wmnet:8080",
    }

    mailalias { 'root':
        recipient => 'root@wikimedia.org',
    }

    file { '/etc/exim4/defer_domains':
        ensure  => present,
        owner   => 'root',
        group   => 'Debian-exim',
        mode    => '0444',
        require => Class['exim4'],
    }

    file { '/usr/local/bin/train_spamassassin':
        ensure => 'file',
        owner  => 'root',
        group  => 'root',
        mode   => '0555',
        source => 'puppet:///modules/otrs/train_spamassassin',
    }

    cron { 'otrs_train_spamassassin':
        ensure  => 'present',
        user    => 'root',
        minute  => '5',
        command => '/usr/local/bin/train_spamassassin',
    }

    file { '/var/spool/spam':
        ensure => 'directory',
        owner  => 'otrs',
        group  => 'www-data',
        mode   => '0775',
    }
}