smtpd: Added relaying for clients

This commit is contained in:
Ossi Salmi 2013-07-30 23:28:50 +03:00
parent 4f22f69766
commit 20423bd1db
3 changed files with 22 additions and 4 deletions

0
smtpd/files/empty Normal file
View file

View file

@ -173,6 +173,25 @@ class smtpd::server(
before => Service["smtpd"],
}
file { "/etc/mail/clients":
ensure => present,
mode => "0644",
owner => "root",
group => "wheel",
source => [
"puppet:///files/mail/clients.${::homename}",
"puppet:///files/mail/clients",
"puppet:///modules/smtpd/empty",
],
}
exec { "makemap -t set clients":
refreshonly => true,
cwd => "/etc/mail",
path => "/bin:/usr/bin:/sbin:/usr/sbin",
subscribe => File["/etc/mail/clients"],
before => Service["smtpd"],
}
if $domains {
smtpd::aliases { $domains:
gecos => $gecos,

View file

@ -1,9 +1,7 @@
listen on egress port smtp tls certificate server
listen on egress port submission tls-require certificate server auth
<% if @domains or @virtual -%>
# alias and virtual maps
<% end -%>
table clients db:/etc/mail/clients.db
<% @domains.each do |domain| -%>
table aliases.<%= domain %> db:/etc/mail/aliases.<%= domain %>.db
<% end if @domains -%>
@ -35,5 +33,6 @@ accept from any for domain { "<%= domain %>", "*.<%= domain %>" } \
<% end -%>
<% end -%>
# relay for local and authenticated users
# relay for remote clients and local users
accept from <clients> for any relay<% if @mail_domain %> as "@<%= @mail_domain %>"<% end %>
accept from local for any relay<% if @mail_domain %> as "@<%= @mail_domain %>"<% end %>