Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2017-08-02 18:13:27 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-08-02 19:40:10 +0300
commitf097e4dbcd26a0d122776b72ca4370890a0a3f76 (patch)
treed8529785410ea37dc0e546966373ddf522ead26c /lib/gitlab/email
parent8ec089f3324ca6e181b575560c636c93bde6b52d (diff)
Don't send rejection mails for all auto-generated mails
Also make it easier to have mailer helper
Diffstat (limited to 'lib/gitlab/email')
-rw-r--r--lib/gitlab/email/handler/create_note_handler.rb1
-rw-r--r--lib/gitlab/email/receiver.rb4
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitlab/email/handler/create_note_handler.rb b/lib/gitlab/email/handler/create_note_handler.rb
index 31579e94a87..8eea33b9ab5 100644
--- a/lib/gitlab/email/handler/create_note_handler.rb
+++ b/lib/gitlab/email/handler/create_note_handler.rb
@@ -15,7 +15,6 @@ module Gitlab
def execute
raise SentNotificationNotFoundError unless sent_notification
- raise AutoGeneratedEmailError if mail.header.to_s =~ /auto-(generated|replied)/
validate_permission!(:create_note)
diff --git a/lib/gitlab/email/receiver.rb b/lib/gitlab/email/receiver.rb
index 0d6b08b5d29..b3c2a8fad3e 100644
--- a/lib/gitlab/email/receiver.rb
+++ b/lib/gitlab/email/receiver.rb
@@ -26,6 +26,10 @@ module Gitlab
raise EmptyEmailError if @raw.blank?
mail = build_mail
+
+ raise AutoGeneratedEmailError if
+ mail.header.to_s =~ /auto-(generated|replied)/
+
mail_key = extract_mail_key(mail)
handler = Handler.for(mail, mail_key)