sendmail: Add support for setting mail spool (/var/spool/mail) location.
This commit is contained in:
parent
71038faa92
commit
aa311183c4
1 changed files with 28 additions and 0 deletions
|
@ -175,6 +175,9 @@ class sendmail::client::msa inherits sendmail::client {
|
||||||
# $sendmail_ssl_chain:
|
# $sendmail_ssl_chain:
|
||||||
# Path to SSL certificate chain file.
|
# Path to SSL certificate chain file.
|
||||||
#
|
#
|
||||||
|
# $sendmail_datadir:
|
||||||
|
# Directory for mail spool.
|
||||||
|
#
|
||||||
class sendmail::server inherits sendmail::common {
|
class sendmail::server inherits sendmail::common {
|
||||||
|
|
||||||
include procmail
|
include procmail
|
||||||
|
@ -202,6 +205,30 @@ class sendmail::server inherits sendmail::common {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $sendmail_datadir {
|
||||||
|
file { $sendmail_datadir:
|
||||||
|
ensure => directory,
|
||||||
|
mode => "0775",
|
||||||
|
owner => "root",
|
||||||
|
group => "mail",
|
||||||
|
seltype => "mail_spool_t",
|
||||||
|
}
|
||||||
|
selinux::manage_fcontext { "${sendmail_datadir}(/.*)?":
|
||||||
|
type => "mail_spool_t",
|
||||||
|
before => File[$sendmail_datadir],
|
||||||
|
}
|
||||||
|
file { "/var/spool/mail":
|
||||||
|
ensure => link,
|
||||||
|
target => $sendmail_datadir,
|
||||||
|
owner => "root",
|
||||||
|
group => "mail",
|
||||||
|
purge => true,
|
||||||
|
force => true,
|
||||||
|
require => File[$sendmail_datadir],
|
||||||
|
before => Service["sendmail"],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if $sendmail_ssl_key and $sendmail_ssl_cert {
|
if $sendmail_ssl_key and $sendmail_ssl_cert {
|
||||||
$ssl_key = basename($sendmail_ssl_key)
|
$ssl_key = basename($sendmail_ssl_key)
|
||||||
$ssl_cert = basename($sendmail_ssl_cert)
|
$ssl_cert = basename($sendmail_ssl_cert)
|
||||||
|
@ -235,6 +262,7 @@ class sendmail::server inherits sendmail::common {
|
||||||
notify => Service["sendmail"],
|
notify => Service["sendmail"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "sendmail.mc":
|
file { "sendmail.mc":
|
||||||
|
|
Loading…
Add table
Reference in a new issue