From: Peter Palfrader Date: Sun, 22 Sep 2019 07:43:53 +0000 (+0200) Subject: Document exim::vdomain, make files ownable by somebody other than root, retire alias_... X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=fcfcf859ac7a3fd03ba5240212e8b487d3932a11;p=mirror%2Fdsa-puppet.git Document exim::vdomain, make files ownable by somebody other than root, retire alias_file parameter --- diff --git a/modules/exim/manifests/vdomain.pp b/modules/exim/manifests/vdomain.pp index 8ab9850a9..4ce67800a 100644 --- a/modules/exim/manifests/vdomain.pp +++ b/modules/exim/manifests/vdomain.pp @@ -1,33 +1,50 @@ +# add an exim virtualdomain entry on this host +# +# @param mail_user User to run the virtual email domain's pipe jobs and deliveries as +# @param mail_group Group to run the virtual email domain's pipe jobs and deliveries as +# @param owner User to own the directories and files +# @param group Group to own the directories and files +# @param domain email domain (defaults to $name) +# @param basedir Base directory (it gets created), usually is and defaults to /srv/$name +# @param maildir Mail directory, usually under base and defaults to $basedir/mail define exim::vdomain ( - $alias_file, - $user, - $group, - $maildir="/srv/${name}", - $domain=$name, + String $domain = $name, + String $basedir = "/srv/${name}", + String $maildir = "${basedir}/mail", + String $owner = 'root', + String $group = 'root', + String $mail_user = $owner, + String $mail_group = $group, ) { - file { $maildir: + file { $basedir: ensure => directory, - mode => '0755', - owner => root, - group => root + mode => '2755', + owner => $owner, + group => $group, } - file { "${maildir}/mail": + file { "${maildir}": ensure => directory, - mode => '0755', - owner => root, - group => root + mode => '2755', + owner => $owner, + group => $group, } - file { "${maildir}/mail/aliases": - source => $alias_file, - mode => '0644', - owner => root, - group => root + file { [ + "${maildir}/aliases", + "${maildir}/callout_users", + "${maildir}/grey_users", + "${maildir}/neversenders", + "${maildir}/rbllist", + "${maildir}/rhsbllist", + ] : + mode => '0644', + owner => $owner, + group => $group, } concat::fragment { "virtualdomain_${domain}": target => '/etc/exim4/virtualdomains', - content => "${domain}: user=${user} group=${group} directory=${maildir}/mail\n", + content => "${domain}: user=${mail_user} group=${mail_group} directory=${maildir}\n", } }