add ability to set network connection port for a remote relayhost
Signed-off-by: Joshua Colson <joshua.colson@gmail.com>
This commit is contained in:
parent
07a56800da
commit
42b4078369
@ -34,6 +34,7 @@ See `attributes/default.rb` for default values.
|
|||||||
|
|
||||||
- `node['postfix']['mail_type']` - Sets the kind of mail configuration. `master` will set up a server (relayhost).
|
- `node['postfix']['mail_type']` - Sets the kind of mail configuration. `master` will set up a server (relayhost).
|
||||||
- `node['postfix']['relayhost_role']` - name of a role used for search in the client recipe.
|
- `node['postfix']['relayhost_role']` - name of a role used for search in the client recipe.
|
||||||
|
- `node['postfix']['relayhost_port']` - listening network port of the relayhost.
|
||||||
- `node['postfix']['multi_environment_relay']` - set to true if nodes should not constrain search for the relayhost in their own environment.
|
- `node['postfix']['multi_environment_relay']` - set to true if nodes should not constrain search for the relayhost in their own environment.
|
||||||
- `node['postfix']['use_procmail']` - set to true if nodes should use procmail as the delivery agent.
|
- `node['postfix']['use_procmail']` - set to true if nodes should use procmail as the delivery agent.
|
||||||
- `node['postfix']['use_alias_maps']` - set to true if you want the cookbook to use/configure alias maps
|
- `node['postfix']['use_alias_maps']` - set to true if you want the cookbook to use/configure alias maps
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
# Generic cookbook attributes
|
# Generic cookbook attributes
|
||||||
default['postfix']['mail_type'] = 'client'
|
default['postfix']['mail_type'] = 'client'
|
||||||
default['postfix']['relayhost_role'] = 'relayhost'
|
default['postfix']['relayhost_role'] = 'relayhost'
|
||||||
|
default['postfix']['relayhost_port'] = '25'
|
||||||
default['postfix']['multi_environment_relay'] = false
|
default['postfix']['multi_environment_relay'] = false
|
||||||
default['postfix']['use_procmail'] = false
|
default['postfix']['use_procmail'] = false
|
||||||
default['postfix']['use_alias_maps'] = (node['platform'] == 'freebsd')
|
default['postfix']['use_alias_maps'] = (node['platform'] == 'freebsd')
|
||||||
|
@ -24,6 +24,9 @@ end
|
|||||||
|
|
||||||
query = "role:#{node['postfix']['relayhost_role']}"
|
query = "role:#{node['postfix']['relayhost_role']}"
|
||||||
relayhost = ''
|
relayhost = ''
|
||||||
|
# if the relayhost_port attribute is not port 25, append to the relayhost
|
||||||
|
relayhost_port = node['postfix']['relayhost_port'].to_s != '25' ? ":#{node['postfix']['relayhost_port']}" : ''
|
||||||
|
|
||||||
# results = []
|
# results = []
|
||||||
|
|
||||||
if node.run_list.roles.include?(node['postfix']['relayhost_role'])
|
if node.run_list.roles.include?(node['postfix']['relayhost_role'])
|
||||||
@ -36,6 +39,6 @@ else
|
|||||||
relayhost = results.map { |n| n['ipaddress'] }.first
|
relayhost = results.map { |n| n['ipaddress'] }.first
|
||||||
end
|
end
|
||||||
|
|
||||||
node.normal['postfix']['main']['relayhost'] = "[#{relayhost}]"
|
node.normal['postfix']['main']['relayhost'] = "[#{relayhost}]#{relayhost_port}"
|
||||||
|
|
||||||
include_recipe 'postfix'
|
include_recipe 'postfix'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user