Puppet Class: sendmail::submit
- Inherits:
- sendmail::params
- Defined in:
- manifests/submit.pp
Summary
Manage the submit.mc file for the Sendmail submission program.Overview
On FreeBSD the submit configuration file is named after the hostname of the server. In this case the class also manages a symbolic link in ‘/etc/mail` to reference the file.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'manifests/submit.pp', line 37
class sendmail::submit (
Optional[String] $ostype = $sendmail::params::submit_mc_ostype,
Optional[String] $submit_mc_domain = $sendmail::params::submit_mc_domain,
String $msp_host = '[127.0.0.1]',
Pattern[/^(MSA)|([0-9]+)$/] $msp_port = 'MSA',
Boolean $enable_msp_trusted_users = false,
Optional[String] $masquerade_as = undef,
) inherits sendmail::params {
include sendmail::makeall
$params = {
'ostype' => $ostype,
'submit_mc_domain' => $submit_mc_domain,
'masquerade_as' => $masquerade_as,
'enable_msp_trusted_users' => $enable_msp_trusted_users,
'msp_host' => $msp_host,
'msp_port' => $msp_port,
}
file { $sendmail::params::submit_mc_file:
ensure => file,
owner => 'root',
group => $sendmail::params::sendmail_group,
mode => '0644',
content => epp('sendmail/submit.m4', $params),
notify => [Class['sendmail::makeall'], Class['sendmail::service'],],
}
if ($facts['os']['family'] == 'FreeBSD') {
# FreeBSD uses a sendmail.mc file named after the hostname of the
# machine. Unfortunately Puppet doesn't know, if
# $facts[networking][hostname] or $facts[networking][[fqdn] will be the
# correct fact to determine the file name that the makefile expects (the
# hostname command is used by the makefile). Therefore we use a symbolic
# link here to create the second alternative.
file { "${sendmail::params::mail_settings_dir}/${facts[networking][fqdn]}.submit.mc":
ensure => link,
target => "${facts[networking][hostname]}.submit.mc",
before => File[$sendmail::params::submit_mc_file],
}
}
}
|