Document exim::vdomain, make files ownable by somebody other than root, retire alias_...
[mirror/dsa-puppet.git] / modules / exim / manifests / vdomain.pp
1 # add an exim virtualdomain entry on this host
2 #
3 # @param mail_user  User to run the virtual email domain's pipe jobs and deliveries as
4 # @param mail_group Group to run the virtual email domain's pipe jobs and deliveries as
5 # @param owner      User to own the directories and files
6 # @param group      Group to own the directories and files
7 # @param domain   email domain (defaults to $name)
8 # @param basedir  Base directory (it gets created), usually is and defaults to /srv/$name
9 # @param maildir  Mail directory, usually under base and defaults to $basedir/mail
10 define exim::vdomain (
11   String $domain = $name,
12   String $basedir = "/srv/${name}",
13   String $maildir = "${basedir}/mail",
14   String $owner = 'root',
15   String $group = 'root',
16   String $mail_user = $owner,
17   String $mail_group = $group,
18 ) {
19   file { $basedir:
20     ensure => directory,
21     mode   => '2755',
22     owner  => $owner,
23     group  => $group,
24   }
25
26   file { "${maildir}":
27     ensure => directory,
28     mode   => '2755',
29     owner  => $owner,
30     group  => $group,
31   }
32
33   file { [
34     "${maildir}/aliases",
35     "${maildir}/callout_users",
36     "${maildir}/grey_users",
37     "${maildir}/neversenders",
38     "${maildir}/rbllist",
39     "${maildir}/rhsbllist",
40     ] :
41     mode  => '0644',
42     owner => $owner,
43     group => $group,
44   }
45
46   concat::fragment { "virtualdomain_${domain}":
47     target  => '/etc/exim4/virtualdomains',
48     content => "${domain}: user=${mail_user} group=${mail_group} directory=${maildir}\n",
49   }
50 }