summaryrefslogtreecommitdiff
path: root/manifests/mlmmj.pp
blob: 198595b16d7b997967071294ca37868355dc9505 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Manages a mlmmj farm.
# Known issues:
#
#  - lists with hyphens are not working when mails are sent directly, but work when sent to an alias.
#  - mail::mlmmj::domain just support a single domain; additional domains should be added into relay_domains.
class mail::mlmmj(
  $subdomain = hiera('mail::mlmmj::subdomain', $mail::mlmmj::params::subdomain)
) {

  include mail::mlmmj::packages
  include mail::mlmmj::web::disabled

  group { 'mlmmj':
    ensure => present,
  }

  user { 'mlmmj':
    ensure  => present,
    gid     => 'mlmmj',
    require => Group['mlmmj'],
  }

  file { '/var/spool/mlmmj':
    ensure  => directory,
    owner   => mlmmj,
    group   => mlmmj,
    mode    => '0750',
    require => User['mlmmj'],
  }

  # This cronjob is already set by the debian package
  cron { 'mlmmj-maintd':
    command  => '/usr/bin/mlmmj-maintd -F -d /var/spool/mlmmj',
    user     => mlmmj,
    hour     => "*",
    minute   => "*/2",
    ensure   => absent,
    require  => User['mlmmj'],
  }

  mail::mlmmj::domain { "${subdomain}.${domain}": }
}