smtpd: Initial version
This commit is contained in:
parent
5bb9db292f
commit
e3bcf4c1f2
3 changed files with 58 additions and 0 deletions
5
smtpd/files/mailer.conf
Normal file
5
smtpd/files/mailer.conf
Normal file
|
@ -0,0 +1,5 @@
|
|||
sendmail /usr/sbin/smtpctl
|
||||
send-mail /usr/sbin/smtpctl
|
||||
mailq /usr/sbin/smtpctl
|
||||
makemap /usr/libexec/smtpd/makemap
|
||||
newaliases /usr/libexec/smtpd/makemap
|
43
smtpd/manifests/init.pp
Normal file
43
smtpd/manifests/init.pp
Normal file
|
@ -0,0 +1,43 @@
|
|||
# Configure smtpd for local delivery.
|
||||
#
|
||||
# === Global variables
|
||||
#
|
||||
# $mail_domain:
|
||||
# Domain to masquerade as (envelope only).
|
||||
#
|
||||
# $smtpd_relay:
|
||||
# URI of mail relay server.
|
||||
#
|
||||
class smtpd {
|
||||
|
||||
file { "/etc/mailer.conf":
|
||||
ensure => present,
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "wheel",
|
||||
source => "puppet:///modules/smtpd/mailer.conf",
|
||||
before => Service["smtpd"],
|
||||
}
|
||||
|
||||
file { "/etc/mail/smtpd.conf":
|
||||
ensure => present,
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "wheel",
|
||||
content => template("smtpd/client.conf.erb"),
|
||||
notify => Service["smtpd"],
|
||||
}
|
||||
|
||||
service { "sendmail":
|
||||
ensure => stopped,
|
||||
enable => false,
|
||||
before => Service["smtpd"],
|
||||
}
|
||||
|
||||
service { "smtpd":
|
||||
ensure => running,
|
||||
enable => true,
|
||||
start => "/usr/sbin/smtpd",
|
||||
}
|
||||
|
||||
}
|
10
smtpd/templates/client.conf.erb
Normal file
10
smtpd/templates/client.conf.erb
Normal file
|
@ -0,0 +1,10 @@
|
|||
listen on lo0
|
||||
|
||||
<% if @smtpd_relay -%>
|
||||
accept from local for any relay via <%= @smtpd_relay %><% if @mail_domain %> as "@<%= @mail_domain %>"<% end %>
|
||||
<% else -%>
|
||||
table aliases db:/etc/mail/aliases.db
|
||||
|
||||
accept from local for local alias <aliases> deliver to mbox
|
||||
accept from local for any relay<% if @mail_domain %> as "@<%= @mail_domain %>"<% end %>
|
||||
<% end -%>
|
Loading…
Add table
Reference in a new issue