From: Tom Hughes Date: Mon, 24 Mar 2014 19:20:36 +0000 (+0000) Subject: Setup mail handling for crm.osmfoundation.org X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/4c35cca55478f6c0f76b2620a8beb22e18fb2278 Setup mail handling for crm.osmfoundation.org --- diff --git a/cookbooks/exim/templates/default/exim4.conf.erb b/cookbooks/exim/templates/default/exim4.conf.erb index 3b33facf7..52816e7fa 100644 --- a/cookbooks/exim/templates/default/exim4.conf.erb +++ b/cookbooks/exim/templates/default/exim4.conf.erb @@ -697,19 +697,31 @@ noreply: group = Debian-exim <% node[:exim][:routes].each do |name,details| -%> -<% if details[:command] -%> +<% if details[:command] or details[:file] or details[:maildir] -%> # This transport handles mail for <%= details[:comment] -%>. <%= name -%>: +<% if details[:command] -%> driver = pipe command = <%= details[:command] %> + home_directory = <%= details[:home_directory] %> + return_output +<% else -%> + driver = appendfile +<% if details[:file] -%> + file = <%= details[:file] %> +<% elsif details[:maildir] -%> + directory = <%= details[:maildir] %> + maildir_format +<% end -%> + envelope_to_add + return_path_add + mode = 0660 +<% end -%> user = <%= details[:user] %> <% if details[:group] -%> group = <%= details[:group] %> <% end -%> - home_directory = <%= details[:home_directory] %> - return_output - <% end -%> <% end -%> diff --git a/roles/crm.rb b/roles/crm.rb new file mode 100644 index 000000000..35776f050 --- /dev/null +++ b/roles/crm.rb @@ -0,0 +1,22 @@ +name "crm" +description "Role applied to CRM server" + + +default_attributes( + :exim => { + :local_domains => [ "crm.osmfoundation.org" ], + :routes => { + :crm => { + :comment => "crm.osmfoundation.org", + :domains => [ "crm.osmfoundation.org" ], + :maildir => "/var/mail/crm", + :user => "wordpress", + :group => "mail" + } + } + } +) + +run_list( + "recipe[civicrm]" +) diff --git a/roles/foundation.rb b/roles/foundation.rb index b6a324772..e02b7d3e2 100644 --- a/roles/foundation.rb +++ b/roles/foundation.rb @@ -18,5 +18,5 @@ default_attributes( ) run_list( - "recipe[civicrm]" + "role[crm]" ) diff --git a/roles/mail.rb b/roles/mail.rb index 68b465595..5cdb8372f 100644 --- a/roles/mail.rb +++ b/roles/mail.rb @@ -23,6 +23,11 @@ default_attributes( :comment => "tickets.openstreetmap.org", :domains => [ "tickets.openstreetmap.org" ], :host => "ridley.ucl.openstreetmap.org" + }, + :crm => { + :comment => "crm.osmfoundation.org", + :domains => [ "crm.osmfoundation.org" ], + :host => "ridley.ucl.openstreetmap.org" } }, :aliases => {