Setup mail handling for crm.osmfoundation.org
authorTom Hughes <tom@compton.nu>
Mon, 24 Mar 2014 19:20:36 +0000 (19:20 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 24 Mar 2014 20:05:36 +0000 (20:05 +0000)
cookbooks/exim/templates/default/exim4.conf.erb
roles/crm.rb [new file with mode: 0644]
roles/foundation.rb
roles/mail.rb

index 3b33fac..52816e7 100644 (file)
@@ -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 (file)
index 0000000..35776f0
--- /dev/null
@@ -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]"
+)
index b6a3247..e02b7d3 100644 (file)
@@ -18,5 +18,5 @@ default_attributes(
 )
 
 run_list(
-  "recipe[civicrm]"
+  "role[crm]"
 )
index 68b4655..5cdb837 100644 (file)
@@ -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 => {