diff --git a/dovecot/manifests/dovecot2.pp b/dovecot/manifests/dovecot2.pp index 3231398..8df6696 100644 --- a/dovecot/manifests/dovecot2.pp +++ b/dovecot/manifests/dovecot2.pp @@ -1,4 +1,39 @@ +# Install custom config to Dovecot +# +# === Parameters +# +# $name: +# Config name. +# +# $idx: +# Config load order. Defaults to 99. +# +# === Sample usage +# +# dovecot::server::config { "passdb-pam": idx => 09 } +# +define dovecot::server::config($idx = 90) { + + include dovecot::server::v2 + + file { "${name}.conf": + ensure => present, + path => "/etc/dovecot/conf.d/${idx}-${name}.conf", + source => [ "puppet:///files/dovecot/${name}.conf", + "puppet:///modules/dovecot/${name}.conf", ], + mode => "0644", + owner => "root", + group => $::operatingsystem ? { + "openbsd" => "wheel", + default => "root", + }, + notify => Service["dovecot"], + require => Package["dovecot"], + } +} + + class dovecot::server::v2 { case $operatingsystem { centos,fedora: { diff --git a/dovecot/templates/puppet.conf.erb b/dovecot/templates/puppet.conf.erb index d1def49..baea4c8 100644 --- a/dovecot/templates/puppet.conf.erb +++ b/dovecot/templates/puppet.conf.erb @@ -20,19 +20,3 @@ plugin { zlib_save = gz # or bz2 } <% end -%> - -mail_location = <%= dovecot_mailbox_format %>:~/imapmail/ - -namespace { - separator = / - list = yes -} - -namespace { - separator = / - prefix = "#mbox/" - location = mbox:~/imapinbox/:INBOX=/var/mail/%u - inbox = yes - hidden = yes - list = no -} diff --git a/sendmail/manifests/init.pp b/sendmail/manifests/init.pp index f40d867..134981d 100644 --- a/sendmail/manifests/init.pp +++ b/sendmail/manifests/init.pp @@ -28,6 +28,13 @@ class sendmail::common { mode => "0644", notify => Service["sendmail"], } + $ostype = "linux" + } + "ubuntu","debian": { + $ostype = "linux" + } + "openbsd": { + $ostype = "openbsd" } } @@ -127,6 +134,9 @@ class sendmail::client::msa inherits sendmail::client { # $mail_domain: # SMTP domain name. # +# $masquerade_exception: +# Everything is masqueraded to $mail_domain except these hosts. +# # $sendmail_auth_mech: # List of authentication mechanisms to use. Defaults to PLAIN and LOGIN. # @@ -142,6 +152,10 @@ class sendmail::server inherits sendmail::common { $sendmail_auth_mech = [ "PLAIN", "LOGIN", ] } + if !$masquerade_exception { + $masquerade_exception = [] + } + $ssl_key = basename($sendmail_ssl_key) $ssl_cert = basename($sendmail_ssl_cert) if $sendmail_ssl_chain { @@ -227,10 +241,11 @@ class sendmail::server inherits sendmail::common { } file { "/etc/mail/certs": - ensure => directory, - mode => "0755", - owner => "root", - group => "root", + ensure => directory, + mode => "0755", + owner => "root", + group => "root", + require => Package["sendmail"], } exec { "populate-etc-mail-certs": path => "/bin:/usr/bin:/sbin:/usr/sbin", diff --git a/sendmail/templates/sendmail.mc.erb b/sendmail/templates/sendmail.mc.erb index 953485a..74fd948 100644 --- a/sendmail/templates/sendmail.mc.erb +++ b/sendmail/templates/sendmail.mc.erb @@ -8,6 +8,7 @@ include(`/usr/share/sendmail-cf/m4/cf.m4')dnl include(`/usr/share/sendmail/cf/m4/cf.m4')dnl <% end -%> VERSIONID(`puppet sendmail::server')dnl +OSTYPE(`<%= ostype -%>')dnl dnl # define(`confDEF_USER_ID', ``8:12'')dnl define(`confTO_CONNECT', `1m')dnl @@ -53,8 +54,11 @@ dnl # DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl dnl # -LOCAL_DOMAIN`localhost.localdomain')dnl +LOCAL_DOMAIN(`localhost.localdomain')dnl MASQUERADE_AS(`<%= mail_domain %>')dnl +<% masquerade_exception.each do |exception| -%> +MASQUERADE_EXCEPTION(`<%= exception %>')dnl +<% end -%> FEATURE(masquerade_envelope)dnl FEATURE(allmasquerade)dnl FEATURE(masquerade_entire_domain)dnl diff --git a/sendmail/templates/submit.mc.erb b/sendmail/templates/submit.mc.erb index 4036ff0..ba2bdcf 100644 --- a/sendmail/templates/submit.mc.erb +++ b/sendmail/templates/submit.mc.erb @@ -22,6 +22,7 @@ include(`/usr/share/sendmail/cf/m4/cf.m4')dnl DOMAIN(`debian-msp')dnl <% end -%> VERSIONID(`puppet setup')dnl +OSTYPE(`<%= ostype -%>')dnl define(`confCF_VERSION', `Submit')dnl define(`__OSTYPE__',`')dnl dirty hack to keep proto.m4 from complaining define(`_USE_DECNET_SYNTAX_', `1')dnl support DECnet