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

[COOK-1520] Add support for procmail as local delivery agent #6

Merged
merged 1 commit into from Aug 18, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Expand Up @@ -57,6 +57,9 @@ See `attributes/default.rb` for default values.
* `node['postfix']['aliases']` - hash of aliases to create with * `node['postfix']['aliases']` - hash of aliases to create with
`recipe[postfix::aliases]`, see below under __Recipes__ for more `recipe[postfix::aliases]`, see below under __Recipes__ for more
information. information.
* `node['postfix']['use_procmail']` - set to true if nodes should use
procmail as the delivery agent (mailbox_command).



Recipes Recipes
======= =======
Expand Down
2 changes: 2 additions & 0 deletions attributes/default.rb
Expand Up @@ -33,4 +33,6 @@
default['postfix']['smtp_sasl_user_name'] = "" default['postfix']['smtp_sasl_user_name'] = ""
default['postfix']['smtp_sasl_passwd'] = "" default['postfix']['smtp_sasl_passwd'] = ""


default['postfix']['use_procmail'] = false

default['postfix']['aliases'] = {} default['postfix']['aliases'] = {}
5 changes: 5 additions & 0 deletions metadata.rb
Expand Up @@ -102,3 +102,8 @@
:display_name => "Postfix Search for relayhost in any environment", :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", :description => "If true, then the client recipe will search any environment instead of just the node's",
:default => "" :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"
7 changes: 7 additions & 0 deletions recipes/default.rb
Expand Up @@ -22,6 +22,13 @@
action :install action :install
end end


if node['postfix']['use_procmail'] then
package "procmail" do
action :install
end
end


service "postfix" do service "postfix" do
supports :status => true, :restart => true, :reload => true supports :status => true, :restart => true, :reload => true
action :enable action :enable
Expand Down
3 changes: 3 additions & 0 deletions templates/default/main.cf.erb
Expand Up @@ -37,5 +37,8 @@ relayhost = <%= node['postfix']['relayhost'] %>
mynetworks = <%= node['postfix']['mail_relay_networks'] %> mynetworks = <%= node['postfix']['mail_relay_networks'] %>
inet_interfaces = loopback-only inet_interfaces = loopback-only
<% end -%> <% end -%>
<% if node['postfix']['use_procmail'] -%>
mailbox_command = /usr/bin/procmail -a "$EXTENSION"
<% end -%>
mailbox_size_limit = 0 mailbox_size_limit = 0
recipient_delimiter = + recipient_delimiter = +