gentoo-overlay/www-apps/gitlabhq/files/gitlabhq-7.8.0-email-custom-reply_to.patch

39 lines
1.8 KiB
Diff

diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index 46ead62..d4ee6bb 100644
--- a/app/mailers/notify.rb
+++ b/app/mailers/notify.rb
@@ -19,7 +19,7 @@ class Notify < ActionMailer::Base
default_url_options[:script_name] = Gitlab.config.gitlab.relative_url_root
default from: Proc.new { default_sender_address.format }
- default reply_to: "noreply@#{Gitlab.config.gitlab.host}"
+ default reply_to: Gitlab.config.gitlab.email_reply_to
# Just send email with 2 seconds delay
def self.delay
diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example
index 044b1f6..5ff344e 100644
--- a/config/gitlab.yml.example
+++ b/config/gitlab.yml.example
@@ -44,6 +44,9 @@ production: &base
# Email address used in the "From" field in mails sent by GitLab
email_from: example@example.com
+ # Email address used in the "Reply-To" field in mails send by GitLab (default: no-reply@<host>)
+ email_reply_to: no-reply@example.com
+
# Email server smtp settings are in config/initializers/smtp_settings.rb.sample
# default_can_create_group: false # default: true
diff --git a/config/initializers/1_settings.rb b/config/initializers/1_settings.rb
index 6a8bbb8..de5c8f8 100644
--- a/config/initializers/1_settings.rb
+++ b/config/initializers/1_settings.rb
@@ -102,6 +102,7 @@ Settings.gitlab['relative_url_root'] ||= ENV['RAILS_RELATIVE_URL_ROOT'] || ''
Settings.gitlab['protocol'] ||= Settings.gitlab.https ? "https" : "http"
Settings.gitlab['email_enabled'] ||= true if Settings.gitlab['email_enabled'].nil?
Settings.gitlab['email_from'] ||= "gitlab@#{Settings.gitlab.host}"
+Settings.gitlab['email_reply_to'] ||= "no-reply@#{Settings.gitlab.host}"
Settings.gitlab['url'] ||= Settings.send(:build_gitlab_url)
Settings.gitlab['user'] ||= 'git'
Settings.gitlab['user_home'] ||= begin