Fix FreeBSD isms in Postfix.
This commit is contained in:
parent
93c9e22837
commit
fbeb44dae1
@ -20,12 +20,11 @@ default['postfix']['mail_type'] = 'client'
|
||||
default['postfix']['relayhost_role'] = 'relayhost'
|
||||
default['postfix']['multi_environment_relay'] = false
|
||||
default['postfix']['use_procmail'] = false
|
||||
default['postfix']['use_alias_maps'] = false
|
||||
default['postfix']['use_alias_maps'] = (node['platform'] == 'freebsd')
|
||||
default['postfix']['use_transport_maps'] = false
|
||||
default['postfix']['use_access_maps'] = false
|
||||
default['postfix']['use_virtual_aliases'] = false
|
||||
default['postfix']['use_virtual_aliases_domains'] = false
|
||||
default['postfix']['aliases'] = {}
|
||||
default['postfix']['transports'] = {}
|
||||
default['postfix']['access'] = {}
|
||||
default['postfix']['virtual_aliases'] = {}
|
||||
@ -48,6 +47,13 @@ when 'smartos'
|
||||
default['postfix']['access_db'] = '/opt/local/etc/postfix/access'
|
||||
default['postfix']['virtual_alias_db'] = '/opt/local/etc/postfix/virtual'
|
||||
default['postfix']['virtual_alias_domains_db'] = '/opt/local/etc/postfix/virtual_domains'
|
||||
when 'freebsd'
|
||||
default['postfix']['conf_dir'] = '/usr/local/etc/postfix'
|
||||
default['postfix']['aliases_db'] = '/etc/aliases'
|
||||
default['postfix']['transport_db'] = '/usr/local/etc/postfix/transport'
|
||||
default['postfix']['access_db'] = '/usr/local/etc/postfix/access'
|
||||
default['postfix']['virtual_alias_db'] = '/usr/local/etc/postfix/virtual'
|
||||
default['postfix']['virtual_alias_domains_db'] = '/usr/local/etc/postfix/virtual_domains'
|
||||
when 'omnios'
|
||||
default['postfix']['conf_dir'] = '/opt/omni/etc/postfix'
|
||||
default['postfix']['aliases_db'] = '/opt/omni/etc/postfix/aliases'
|
||||
@ -106,3 +112,26 @@ end
|
||||
|
||||
# Master.cf attributes
|
||||
default['postfix']['master']['submission'] = false
|
||||
|
||||
|
||||
# OS Aliases
|
||||
case node['platform']
|
||||
when 'freebsd'
|
||||
default['postfix']['aliases'] = {
|
||||
'MAILER-DAEMON' => 'postmaster',
|
||||
'bin' => 'root',
|
||||
'daemon' => 'root',
|
||||
'named' => 'root',
|
||||
'nobody' => 'root',
|
||||
'uucp' => 'root',
|
||||
'www' => 'root',
|
||||
'ftp-bugs' => 'root',
|
||||
'postfix' => 'root',
|
||||
'manager' => 'root',
|
||||
'dumper' => 'root',
|
||||
'operator' => 'root',
|
||||
'abuse' => 'postmaster'
|
||||
}
|
||||
else
|
||||
default['postfix']['aliases'] = {}
|
||||
end
|
||||
|
@ -60,7 +60,7 @@ when 'omnios'
|
||||
template manifest_path do
|
||||
source 'manifest-postfix.xml.erb'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
group node['root_group']
|
||||
mode '0644'
|
||||
notifies :run, 'execute[load postfix manifest]', :immediately
|
||||
end
|
||||
@ -80,7 +80,7 @@ end
|
||||
unless node['postfix']['sender_canonical_map_entries'].empty?
|
||||
template "#{node['postfix']['conf_dir']}/sender_canonical" do
|
||||
owner 'root'
|
||||
group 0
|
||||
group node['root_group']
|
||||
mode '0644'
|
||||
notifies :run, 'execute[update-postfix-sender_canonical]'
|
||||
notifies :reload, 'service[postfix]'
|
||||
@ -99,7 +99,7 @@ end
|
||||
unless node['postfix']['smtp_generic_map_entries'].empty?
|
||||
template "#{node['postfix']['conf_dir']}/smtp_generic" do
|
||||
owner 'root'
|
||||
group 0
|
||||
group node['root_group']
|
||||
mode '0644'
|
||||
notifies :run, 'execute[update-postfix-smtp_generic]'
|
||||
notifies :reload, 'service[postfix]'
|
||||
@ -114,7 +114,7 @@ end
|
||||
template "#{node['postfix']['conf_dir']}/#{cfg}.cf" do
|
||||
source "#{cfg}.cf.erb"
|
||||
owner 'root'
|
||||
group 0
|
||||
group node['root_group']
|
||||
mode '0644'
|
||||
notifies :restart, 'service[postfix]'
|
||||
variables(settings: node['postfix'][cfg])
|
||||
|
@ -19,6 +19,8 @@ include_recipe 'postfix::_common'
|
||||
execute 'update-postfix-aliases' do
|
||||
command 'newaliases'
|
||||
environment PATH: "#{ENV['PATH']}:/opt/omni/bin:/opt/omni/sbin" if platform_family?('omnios')
|
||||
# On FreeBSD, /usr/sbin/newaliases is the sendmail command, and it's in the path before postfix's /usr/local/bin/newaliases
|
||||
environment ({ "PATH" => "/usr/local/bin:#{ENV['PATH']}" }) if platform_family?('freebsd')
|
||||
action :nothing
|
||||
end
|
||||
|
||||
|
@ -51,7 +51,7 @@ end
|
||||
template node['postfix']['sasl_password_file'] do
|
||||
source 'sasl_passwd.erb'
|
||||
owner 'root'
|
||||
group 'root'
|
||||
group node['root_group']
|
||||
mode 0400
|
||||
notifies :run, 'execute[postmap-sasl_passwd]', :immediately
|
||||
notifies :restart, 'service[postfix]'
|
||||
|
Loading…
x
Reference in New Issue
Block a user