class exim {
+ include exim::vdomain::setup
+
munin::check { 'ps_exim4': script => 'ps_' }
munin::check { 'exim_mailqueue': }
munin::check { 'exim_mailstats': }
Package['exim4-daemon-heavy']->Mailalias<| |>
+ concat::fragment { 'virtual_domain_template':
+ target => '/etc/exim4/virtualdomains',
+ content => template('exim/virtualdomains.erb'),
+ order => 05,
+ }
+
service { 'exim4':
ensure => running,
require => [
file { '/etc/exim4/locals':
content => template('exim/locals.erb')
}
- file { '/etc/exim4/virtualdomains':
- content => template('exim/virtualdomains.erb'),
- }
file { '/etc/exim4/submission-domains':
content => template('exim/submission-domains.erb'),
}
--- /dev/null
+class exim::vdomain (
+ $alias_file,
+ $user,
+ $group,
+ $maildir,
+ $domain=$name,
+) {
+ include exim::vdomain::setup
+
+ file { $maildir:
+ ensure => directory,
+ mode => '0755',
+ owner => root,
+ group => root
+ }
+
+ file { "${maildir}/aliases":
+ source => $alias_file,
+ mode => '0644',
+ owner => root,
+ group => root
+ }
+
+ concat::fragment { "virtualdomain_${domain}":
+ target => '/etc/exim4/virtualdomains',
+ content => "${domain}: user=${user} group=${group} directory=${maildir}\n",
+ }
+}
--- /dev/null
+class exim::vdomain::setup {
+ concat { '/etc/exim4/virtualdomains':
+ owner => root,
+ group => root,
+ mode => '0644',
+ require => Package['exim4-daemon-heavy']
+ }
+
+ concat::fragment { 'virtualdomains_header':
+ target => '/etc/exim4/virtualdomains',
+ source => 'puppet:///modules/exim/virtualdomains.header',
+ order => 00,
+ }
+}
-##
-## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
-## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
-##
-
-# This file lists the virtual domains that this host should handle. The
-# format is
-# host: user=user group=group directory=dir
-# Host may be a wildcard.
-# User/Group are the symbolic names of the uid/gid to operate under when
-# performing deliveries for this name. These should not be root!
-# Directory is the directory to look in for data files. The directory and
-# files may be group writable. The first file to lookup is DIR/aliases
-# which is a traditional exim/sendmail alias file. You can specify
-# users, patterns, pipes and filenames. If that fails then
-# .forward-foo is tried, should that fail then .forward-default is tried.
-# Finally the email will bounce.
-
<%=
-vdoms = case scope.lookupvar('::fqdn')
+vdoms = case @fqdn
when "busoni.debian.org" then "bugs.debian.org: user=debbugs group=debbugs directory=/srv/bugs.debian.org/mail"
when "buxtehude.debian.org" then "bugs.debian.org: user=debbugs group=debbugs directory=/srv/bugs.debian.org/mail"