Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions manifests/file.pp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
$ensure = undef
) {

include '::postfix::params'
include ::postfix::params

file { "${postfixdir}/${title}":
ensure => $ensure,
Expand All @@ -43,8 +43,7 @@
content => $content,
source => $source,
notify => Service['postfix'],
require => Package[$::postfix::params::postfix_package],
require => Package[$::postfix::server::postfix_package],
}

}

2 changes: 2 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
case $facts['os']['family'] {
'RedHat': {
$postfix_version = $facts['os']['release']['major'] ? {
'9' => '3.5.25',
'8' => '3.5.8',
'7' => '2.6.6', # Not correct, but let's not change existing
'6' => '2.6.6',
'5' => '2.3.3',
Expand Down
8 changes: 6 additions & 2 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,14 @@
# submission should only be used for authenticated delivery, so explicitly
# reject everything else.
$submission_smtpd_client_restrictions = 'permit_sasl_authenticated,reject',
$submission_smtpd_recipient_restrictions = undef,
$submission_smtpd_sender_restrictions = undef,
# smtps should allow unauthenticated delivery (for local or relay_domains for
# example) so no explicit reject. smtps port 465 is non-standards compliant
# anyway so no one true answer.
# example) so no explicit reject. smtps port 465 is non-standards compliant
# anyway so no one true answer.
$smtps_smtpd_client_restrictions = 'permit_sasl_authenticated',
$smtps_smtpd_recipient_restrictions = undef,
$smtps_smtpd_sender_restrictions = undef,
$master_services = [],
# Other files
$header_checks = [],
Expand Down
2 changes: 2 additions & 0 deletions templates/main.cf-el5.erb
Original file line number Diff line number Diff line change
Expand Up @@ -886,11 +886,13 @@ smtpd_recipient_restrictions =
<% @smtpd_recipient_restrictions.each do |line| -%>
<%= line %>,
<% end -%>
<% if @postgrey -%>
<% if @postgrey_policy_service -%>
check_policy_service <%= @postgrey_policy_service %>,
<% else -%>
check_policy_service unix:postgrey/socket,
<% end -%>
<% end -%>

<% end -%>
<% if !@smtpd_data_restrictions.empty? -%>
Expand Down
2 changes: 2 additions & 0 deletions templates/main.cf-el8.erb
Original file line number Diff line number Diff line change
Expand Up @@ -960,11 +960,13 @@ smtpd_recipient_restrictions =
<% @smtpd_recipient_restrictions.each do |line| -%>
<%= line %>,
<% end -%>
<% if @postgrey -%>
<% if @postgrey_policy_service -%>
check_policy_service <%= @postgrey_policy_service %>,
<% else -%>
check_policy_service unix:postgrey/socket,
<% end -%>
<% end -%>

<% end -%>
<% if !@smtpd_data_restrictions.empty? -%>
Expand Down
2 changes: 2 additions & 0 deletions templates/main.cf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -908,11 +908,13 @@ smtpd_recipient_restrictions =
<% @smtpd_recipient_restrictions.each do |line| -%>
<%= line %>,
<% end -%>
<% if @postgrey -%>
<% if @postgrey_policy_service -%>
check_policy_service <%= @postgrey_policy_service %>,
<% else -%>
check_policy_service unix:postgrey/socket,
<% end -%>
<% end -%>

<% end -%>
<% if !@smtpd_data_restrictions.empty? -%>
Expand Down
12 changes: 12 additions & 0 deletions templates/master.cf-el5.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,24 @@ submission inet n - n - - smtpd
-o smtpd_enforce_tls=<%= @submission_smtpd_enforce_tls %>
-o smtpd_sasl_auth_enable=<%= @submission_smtpd_sasl_auth_enable %>
-o smtpd_client_restrictions=<%= @submission_smtpd_client_restrictions %>
<% if @submission_smtpd_recipient_restrictions -%>
-o smtpd_recipient_restrictions=<%= @submission_smtpd_recipient_restrictions %>
<% end -%>
<% if @submission_smtpd_sender_restrictions -%>
-o smtpd_sender_restrictions=<%= @submission_smtpd_sender_restrictions %>
<% end -%>
<% end -%>
<% if @ssl -%>
smtps inet n - n - - smtpd
-o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
<% if @smtps_smtpd_recipient_restrictions -%>
-o smtpd_recipient_restrictions=<%= @smtps_smtpd_recipient_restrictions %>
<% end -%>
<% if @smtps_smtpd_sender_restrictions -%>
-o smtpd_sender_restrictions=<%= @smtps_smtpd_sender_restrictions %>
<% end -%>
<% @smtp_content_filter.each do |content_filter| -%>
-o content_filter=<%= content_filter %>
<% end -%>
Expand Down
12 changes: 12 additions & 0 deletions templates/master.cf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,25 @@ submission inet n - n - - smtpd
-o smtpd_tls_security_level=<%= @submission_smtpd_tls_security_level %>
-o smtpd_sasl_auth_enable=<%= @submission_smtpd_sasl_auth_enable %>
-o smtpd_client_restrictions=<%= @submission_smtpd_client_restrictions %>
<% if @submission_smtpd_recipient_restrictions -%>
-o smtpd_recipient_restrictions=<%= @submission_smtpd_recipient_restrictions %>
<% end -%>
<% if @submission_smtpd_sender_restrictions -%>
-o smtpd_sender_restrictions=<%= @submission_smtpd_sender_restrictions %>
<% end -%>
-o milter_macro_daemon_name=ORIGINATING
<% end -%>
<% if @ssl -%>
smtps inet n - n - - smtpd
-o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=<%= @smtps_smtpd_sasl_auth_enable %>
-o smtpd_client_restrictions=<%= @smtps_smtpd_client_restrictions %>
<% if @smtps_smtpd_recipient_restrictions -%>
-o smtpd_recipient_restrictions=<%= @smtps_smtpd_recipient_restrictions %>
<% end -%>
<% if @smtps_smtpd_sender_restrictions -%>
-o smtpd_sender_restrictions=<%= @smtps_smtpd_sender_restrictions %>
<% end -%>
-o milter_macro_daemon_name=ORIGINATING
<% @smtps_content_filter.each do |content_filter| -%>
-o content_filter=<%= content_filter %>
Expand Down