From: Tom Hughes Date: Tue, 20 May 2014 10:37:40 +0000 (+0100) Subject: Send wiki mail notifications from a noreply address X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/d5cbd676788c5f642f87e103b2d0fd0c31fcdb07 Send wiki mail notifications from a noreply address --- diff --git a/cookbooks/exim/attributes/default.rb b/cookbooks/exim/attributes/default.rb index e6e7fff0b..bdd8be4ca 100644 --- a/cookbooks/exim/attributes/default.rb +++ b/cookbooks/exim/attributes/default.rb @@ -7,3 +7,4 @@ default[:exim][:smarthost_name] = nil default[:exim][:smarthost_via] = "mail.openstreetmap.org:26" default[:exim][:routes] = { } default[:exim][:aliases][:root] = "tomh" +default[:exim][:rewrites] = [ ] diff --git a/cookbooks/exim/files/default/noreply/wiki b/cookbooks/exim/files/default/noreply/wiki new file mode 100644 index 000000000..f041057c0 --- /dev/null +++ b/cookbooks/exim/files/default/noreply/wiki @@ -0,0 +1,13 @@ +This is an automated response to your email, which was sent to an +unattended address. + +If you were trying to confirm your email address after signing +up for a wiki account, or after changing your email address, then +you should click on the link in the original email you received. + +If you are having technical problems with the wiki then please +contact support@openstreetmap.org for assistance. + +Thank you, + +OpenStreetMap Administrators diff --git a/cookbooks/exim/templates/default/exim4.conf.erb b/cookbooks/exim/templates/default/exim4.conf.erb index 41403b04b..b5360c584 100644 --- a/cookbooks/exim/templates/default/exim4.conf.erb +++ b/cookbooks/exim/templates/default/exim4.conf.erb @@ -760,6 +760,9 @@ begin retry # There are no rewriting specifications in this default configuration file. begin rewrite +<% node[:exim][:rewrites].each do |rewrite| -%> +<%= rewrite[:pattern] %> <%= rewrite[:replacement] %> <%= rewrite[:flags] %> +<% end -%> diff --git a/roles/wiki.rb b/roles/wiki.rb index e9f3cb865..523e73c52 100644 --- a/roles/wiki.rb +++ b/roles/wiki.rb @@ -11,7 +11,14 @@ default_attributes( :trusted_users => [ "www-data" ], :aliases => { :root => "grant" - } + }, + :rewrites => [ + { + :pattern => "www-data@openstreetmap.org", + :replacement => "wiki@noreply.openstreetmap.org", + :flags => "F" + } + ] }, :memcached => { :memory_limit => 1024,