Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added inet_protocols parameter. #9

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
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
34 changes: 25 additions & 9 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
#
# Parameters:
#
# [*header_checks*]
# If not undef, sets the header_checks field in main.cfg to
# regexp:/etc/postfix/header_checks
# It populates the header_checks file with the contents of this string.
# Default: undef
#
# Actions:
#
# Requires:
Expand All @@ -28,13 +34,16 @@

# [Remember: No empty lines between comments and class definition]
class postfix (
$remove_sendmail = undef,
$myorigin = undef,
$mydestination = undef,
$relayhost = undef,
$relayhost_port = undef,
$daemon_directory = $::postfix::params::daemon_directory,
$inet_interfaces = $::postfix::params::inet_interfaces,
$remove_sendmail = undef,
$myorigin = undef,
$mydestination = undef,
$relayhost = undef,
$relayhost_port = undef,
$daemon_directory = $::postfix::params::daemon_directory,
$inet_interfaces = $::postfix::params::inet_interfaces,
$inet_protocols = $::postfix::params::inet_protocols,
$enable_daemon_directory = $::postfix::params::enable_daemon_directory,
$header_checks = undef,
) inherits postfix::params {

if $remove_sendmail {
Expand All @@ -59,6 +68,14 @@
],
}

if $header_checks {
file{$postfix::params::header_checks_file:
ensure => file,
content => $header_checks,
before => File['postfix_config'],
}
}

file{'postfix_config':
ensure => 'file',
path => $postfix::params::config_file,
Expand All @@ -74,5 +91,4 @@
File['postfix_config']
]
}

}
}
11 changes: 10 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,19 @@
fail("The postfix module does not support the ${::osfamily} family of operating systems.")
}
}


$header_checks_file = '/etc/postfix/header_checks'

if $::lsbdistcodename == 'xenial' {
$enable_daemon_directory = false
}else{
$enable_daemon_directory = true
}

# Set OS independent varibles here
$sendmail_package = 'sendmail'
$sendmailcf_package = 'sendmail-cf'
$sendmail_service = 'sendmail'
$inet_interfaces = 'localhost'
$inet_protocols = 'all'
}
8 changes: 7 additions & 1 deletion templates/main.cf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ command_directory = /usr/sbin
# daemon programs (i.e. programs listed in the master.cf file). This
# directory must be owned by root.
#
<% if @enable_daemon_directory == true %>
daemon_directory = <%= @daemon_directory %>
<% end %>

# The data_directory parameter specifies the location of Postfix-writable
# data files (caches, random numbers). This directory must be owned
Expand Down Expand Up @@ -121,7 +123,7 @@ myorigin = <%= @myorigin %>
inet_interfaces = <%= @inet_interfaces %>

# Enable IPv4, and IPv6 if supported
inet_protocols = all
inet_protocols = <%= @inet_protocols %>

# The proxy_interfaces parameter specifies the network interface
# addresses that this mail system receives mail on by way of a
Expand Down Expand Up @@ -559,6 +561,10 @@ alias_database = hash:/etc/aliases
# For details, see "man header_checks".
#
#header_checks = regexp:/etc/postfix/header_checks
<% if @header_checks -%>
header_checks = regexp:/etc/postfix/header_checks
local_header_rewrite_clients = static:all
<% end -%>

# FAST ETRN SERVICE
#
Expand Down