[COOK-1520] Added support for enabling procmail to postfix cookbook

This commit is contained in:
Joshua Buysse 2012-08-04 19:06:21 -05:00
parent e2a1a3079a
commit f231f8b408
5 changed files with 20 additions and 0 deletions

View File

@ -57,6 +57,9 @@ See `attributes/default.rb` for default values.
* `node['postfix']['aliases']` - hash of aliases to create with
`recipe[postfix::aliases]`, see below under __Recipes__ for more
information.
* `node['postfix']['use_procmail']` - set to true if nodes should use
procmail as the delivery agent (mailbox_command).
Recipes
=======

View File

@ -33,4 +33,6 @@ default['postfix']['smtp_use_tls'] = "yes"
default['postfix']['smtp_sasl_user_name'] = ""
default['postfix']['smtp_sasl_passwd'] = ""
default['postfix']['use_procmail'] = false
default['postfix']['aliases'] = {}

View File

@ -102,3 +102,8 @@ attribute "postfix/multi_environment_relay",
:display_name => "Postfix Search for relayhost in any environment",
:description => "If true, then the client recipe will search any environment instead of just the node's",
:default => ""
attribute "postfix/use_procmail",
:display_name => "Postfix Use procmail?",
:description => "Whether procmail should be used as the local delivery agent for a server",
:default => "no"

View File

@ -22,6 +22,13 @@ package "postfix" do
action :install
end
if node['postfix']['use_procmail'] then
package "procmail" do
action :install
end
end
service "postfix" do
supports :status => true, :restart => true, :reload => true
action :enable

View File

@ -37,5 +37,8 @@ relayhost = <%= node['postfix']['relayhost'] %>
mynetworks = <%= node['postfix']['mail_relay_networks'] %>
inet_interfaces = loopback-only
<% end -%>
<% if node['postfix']['use_procmail'] -%>
mailbox_command = /usr/bin/procmail -a "$EXTENSION"
<% end -%>
mailbox_size_limit = 0
recipient_delimiter = +