Initial version of sendmail module.
This commit is contained in:
parent
f4d2fcfd1a
commit
8e3cac8b51
2 changed files with 110 additions and 0 deletions
76
sendmail/manifests/init.pp
Normal file
76
sendmail/manifests/init.pp
Normal file
|
@ -0,0 +1,76 @@
|
||||||
|
# Install Sendmail packages.
|
||||||
|
#
|
||||||
|
class sendmail::common {
|
||||||
|
|
||||||
|
case $operatingsystem {
|
||||||
|
centos,fedora: {
|
||||||
|
package { ["sendmail", "sendmail-cf"]:
|
||||||
|
ensure => installed,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Configure Sendmail submission.
|
||||||
|
#
|
||||||
|
# === Global variables
|
||||||
|
#
|
||||||
|
# $mail_server:
|
||||||
|
# Hostname of mail server.
|
||||||
|
#
|
||||||
|
class sendmail::client inherits sendmail::common {
|
||||||
|
|
||||||
|
case $operatingsystem {
|
||||||
|
openbsd: {
|
||||||
|
file { "/usr/share/sendmail/cf/submit.mc":
|
||||||
|
ensure => present,
|
||||||
|
content => template("sendmail/submit.mc.erb"),
|
||||||
|
owner => root,
|
||||||
|
group => bin,
|
||||||
|
mode => 0444,
|
||||||
|
notify => Exec["make submit.cf"],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
file { "/etc/mail/submit.mc":
|
||||||
|
ensure => present,
|
||||||
|
content => template("sendmail/submit.mc.erb"),
|
||||||
|
owner => root,
|
||||||
|
group => root,
|
||||||
|
mode => 0644,
|
||||||
|
notify => Exec["make submit.cf"],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
exec { "make submit.cf":
|
||||||
|
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||||
|
cwd => $operatingsystem ? {
|
||||||
|
openbsd => "/usr/share/sendmail/cf",
|
||||||
|
default => "/etc/mail",
|
||||||
|
},
|
||||||
|
require => $operatingsystem ? {
|
||||||
|
openbsd => undef,
|
||||||
|
default => Package["sendmail-cf"],
|
||||||
|
},
|
||||||
|
refreshonly => true,
|
||||||
|
}
|
||||||
|
|
||||||
|
file { "/etc/mail/submit.cf":
|
||||||
|
ensure => present,
|
||||||
|
owner => root,
|
||||||
|
group => $operatingsystem ? {
|
||||||
|
openbsd => wheel,
|
||||||
|
default => root,
|
||||||
|
},
|
||||||
|
mode => 0644,
|
||||||
|
source => $operatingsystem ? {
|
||||||
|
openbsd => "/usr/share/sendmail/cf/submit.cf",
|
||||||
|
default => undef,
|
||||||
|
},
|
||||||
|
require => Exec["make submit.cf"],
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
34
sendmail/templates/submit.mc.erb
Normal file
34
sendmail/templates/submit.mc.erb
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
divert(-1)
|
||||||
|
#
|
||||||
|
# Copyright (c) 2001-2003 Sendmail, Inc. and its suppliers.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# By using this file, you agree to the terms and conditions set
|
||||||
|
# forth in the LICENSE file which can be found at the top level of
|
||||||
|
# the sendmail distribution.
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# This is the prototype file for a set-group-ID sm-msp sendmail that
|
||||||
|
# acts as a initial mail submission program.
|
||||||
|
#
|
||||||
|
|
||||||
|
divert(0)dnl
|
||||||
|
<% if kernel == 'Linux' -%>
|
||||||
|
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
|
||||||
|
<% end -%>
|
||||||
|
VERSIONID(`puppet setup')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
|
||||||
|
define(`confTIME_ZONE', `USE_TZ')dnl
|
||||||
|
define(`confDONT_INIT_GROUPS', `True')dnl
|
||||||
|
define(`confDIRECT_SUBMISSION_MODIFIERS',`C')dnl
|
||||||
|
<% if kernel == 'Linux' -%>
|
||||||
|
define(`confPID_FILE', `/var/run/sm-client.pid')dnl
|
||||||
|
<% end -%>
|
||||||
|
FEATURE(`use_ct_file')dnl
|
||||||
|
dnl
|
||||||
|
dnl If you use IPv6 only, change [127.0.0.1] to [IPv6:::1]
|
||||||
|
FEATURE(`msp', `[<%= mail_server %>]')dnl
|
Loading…
Add table
Reference in a new issue