Merged in oherrala/puppet (pull request #23: Various sendmail and dovecot fixes and features.)
This commit is contained in:
commit
701894aa09
5 changed files with 60 additions and 21 deletions
|
@ -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: {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
@ -231,6 +245,7 @@ class sendmail::server inherits sendmail::common {
|
|||
mode => "0755",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
require => Package["sendmail"],
|
||||
}
|
||||
exec { "populate-etc-mail-certs":
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue