Configure email addresses explicitly for rails port instances
authorTom Hughes <tom@compton.nu>
Wed, 22 Mar 2017 18:50:11 +0000 (18:50 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 22 Mar 2017 18:50:11 +0000 (18:50 +0000)
cookbooks/web/definitions/rails_port.rb

index a9a6590..fe60c1c 100644 (file)
@@ -28,6 +28,7 @@ define :rails_port, :action => [:create, :enable] do
   rails_repository = params[:repository] || "git://git.openstreetmap.org/rails.git"
   rails_revision = params[:revision] || "live"
   run_migrations = params[:run_migrations] || false
+  email_from = params[:email_from] || "OpenStreetMap <support@openstreetmap.org>"
   status = params[:status] || "online"
 
   database_params = {
@@ -114,10 +115,14 @@ define :rails_port, :action => [:create, :enable] do
 
     line.gsub!(/^( *)#publisher_url:.*$/, "\\1publisher_url: \"https://plus.google.com/111953119785824514010\"")
 
+    line.gsub!(/^( *)support_email:.*$/, "\\1support_email: \"support@openstreetmap.org\"")
+
     if params[:email_from]
-      line.gsub!(/^( *)email_from:.*$/, "\\1email_from: \"#{params[:email_from]}\"")
+      line.gsub!(/^( *)email_from:.*$/, "\\1email_from: \"#{email_from}\"")
     end
 
+    line.gsub!(/^( *)email_return_path:.*$/, "\\1email_return_path: \"bounces@openstreetmap.org\"")
+
     line.gsub!(/^( *)status:.*$/, "\\1status: :#{status}")
 
     if params[:messages_domain]