sendmail: Added support for installing sendmail without SSL support.
This commit is contained in:
parent
fae8257a89
commit
a90016c5f2
2 changed files with 44 additions and 27 deletions
|
@ -165,8 +165,15 @@ class sendmail::client::msa inherits sendmail::client {
|
||||||
# List of authentication mechanisms to use. Defaults to PLAIN and LOGIN.
|
# List of authentication mechanisms to use. Defaults to PLAIN and LOGIN.
|
||||||
#
|
#
|
||||||
# $sendmail_ssl_key:
|
# $sendmail_ssl_key:
|
||||||
|
# Path to SSL key file. If not set sendmail will be configured
|
||||||
|
# without SSL support.
|
||||||
#
|
#
|
||||||
# $sendmail_ssl_cert:
|
# $sendmail_ssl_cert:
|
||||||
|
# Path to SSL certificate file. If not set sendmail will be
|
||||||
|
# configured without SSL support.
|
||||||
|
#
|
||||||
|
# $sendmail_ssl_chain:
|
||||||
|
# Path to SSL certificate chain file.
|
||||||
#
|
#
|
||||||
class sendmail::server inherits sendmail::common {
|
class sendmail::server inherits sendmail::common {
|
||||||
|
|
||||||
|
@ -180,12 +187,6 @@ class sendmail::server inherits sendmail::common {
|
||||||
$masquerade_exception = []
|
$masquerade_exception = []
|
||||||
}
|
}
|
||||||
|
|
||||||
$ssl_key = basename($sendmail_ssl_key)
|
|
||||||
$ssl_cert = basename($sendmail_ssl_cert)
|
|
||||||
if $sendmail_ssl_chain {
|
|
||||||
$ssl_chain = basename($sendmail_ssl_chain)
|
|
||||||
}
|
|
||||||
|
|
||||||
selinux::manage_fcontext { "/etc/smrsh(/.*)?":
|
selinux::manage_fcontext { "/etc/smrsh(/.*)?":
|
||||||
type => "sendmail_exec_t",
|
type => "sendmail_exec_t",
|
||||||
}
|
}
|
||||||
|
@ -201,6 +202,13 @@ class sendmail::server inherits sendmail::common {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $sendmail_ssl_key and $sendmail_ssl_cert {
|
||||||
|
$ssl_key = basename($sendmail_ssl_key)
|
||||||
|
$ssl_cert = basename($sendmail_ssl_cert)
|
||||||
|
if $sendmail_ssl_chain {
|
||||||
|
$ssl_chain = basename($sendmail_ssl_chain)
|
||||||
|
}
|
||||||
|
|
||||||
file { "/etc/pki/tls/private/${ssl_key}":
|
file { "/etc/pki/tls/private/${ssl_key}":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
source => $sendmail_ssl_key,
|
source => $sendmail_ssl_key,
|
||||||
|
@ -227,6 +235,7 @@ class sendmail::server inherits sendmail::common {
|
||||||
notify => Service["sendmail"],
|
notify => Service["sendmail"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
file { "sendmail.mc":
|
file { "sendmail.mc":
|
||||||
name => $::operatingsystem ? {
|
name => $::operatingsystem ? {
|
||||||
|
|
|
@ -22,11 +22,16 @@ define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
|
||||||
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
|
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
|
||||||
define(`confTO_IDENT', `0')dnl
|
define(`confTO_IDENT', `0')dnl
|
||||||
dnl #
|
dnl #
|
||||||
|
<% if @ssl_key and @ssl_cert -%>
|
||||||
define(`confAUTH_OPTIONS', `A p y')dnl
|
define(`confAUTH_OPTIONS', `A p y')dnl
|
||||||
TRUST_AUTH_MECH(`<%= @sendmail_auth_mech.join(' ') %>')dnl
|
TRUST_AUTH_MECH(`<%= @sendmail_auth_mech.join(' ') %>')dnl
|
||||||
define(`confAUTH_MECHANISMS', `<%= @sendmail_auth_mech.join(' ') %>')dnl
|
define(`confAUTH_MECHANISMS', `<%= @sendmail_auth_mech.join(' ') %>')dnl
|
||||||
|
<% else -%>
|
||||||
|
define(`confAUTH_OPTIONS', `A')dnl
|
||||||
|
<% end -%>
|
||||||
dnl #
|
dnl #
|
||||||
define(`confCACERT_PATH', `/etc/mail/certs')
|
define(`confCACERT_PATH', `/etc/mail/certs')
|
||||||
|
<% if @ssl_key and @ssl_cert -%>
|
||||||
<% if @ssl_chain -%>
|
<% if @ssl_chain -%>
|
||||||
define(`confCACERT', `/etc/pki/tls/certs/<%= @ssl_chain %>')
|
define(`confCACERT', `/etc/pki/tls/certs/<%= @ssl_chain %>')
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
@ -34,6 +39,7 @@ define(`confSERVER_CERT', `/etc/pki/tls/certs/<%= @ssl_cert %>')
|
||||||
define(`confSERVER_KEY', `/etc/pki/tls/private/<%= @ssl_key %>')
|
define(`confSERVER_KEY', `/etc/pki/tls/private/<%= @ssl_key %>')
|
||||||
define(`confCLIENT_CERT', `/etc/pki/tls/certs/<%= @ssl_cert %>')
|
define(`confCLIENT_CERT', `/etc/pki/tls/certs/<%= @ssl_cert %>')
|
||||||
define(`confCLIENT_KEY', `/etc/pki/tls/private/<%= @ssl_key %>')
|
define(`confCLIENT_KEY', `/etc/pki/tls/private/<%= @ssl_key %>')
|
||||||
|
<% end -%>
|
||||||
dnl #
|
dnl #
|
||||||
FEATURE(`no_default_msa', `dnl')dnl
|
FEATURE(`no_default_msa', `dnl')dnl
|
||||||
FEATURE(`smrsh', `/usr/sbin/smrsh')dnl
|
FEATURE(`smrsh', `/usr/sbin/smrsh')dnl
|
||||||
|
@ -52,7 +58,9 @@ FEATURE(`blacklist_recipients')dnl
|
||||||
EXPOSED_USER(`root')dnl
|
EXPOSED_USER(`root')dnl
|
||||||
dnl #
|
dnl #
|
||||||
DAEMON_OPTIONS(`Port=smtp, Name=MTA, M=A')dnl
|
DAEMON_OPTIONS(`Port=smtp, Name=MTA, M=A')dnl
|
||||||
|
<% if @ssl_key and @ssl_cert -%>
|
||||||
DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
|
DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
|
||||||
|
<% end -%>
|
||||||
dnl #
|
dnl #
|
||||||
LOCAL_DOMAIN(`localhost.localdomain')dnl
|
LOCAL_DOMAIN(`localhost.localdomain')dnl
|
||||||
MASQUERADE_AS(`<%= @mail_domain %>')dnl
|
MASQUERADE_AS(`<%= @mail_domain %>')dnl
|
||||||
|
|
Loading…
Add table
Reference in a new issue