diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-08-02 23:13:27 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-08-03 00:40:10 +0800 |
commit | f097e4dbcd26a0d122776b72ca4370890a0a3f76 (patch) | |
tree | d8529785410ea37dc0e546966373ddf522ead26c /lib/gitlab | |
parent | 8ec089f3324ca6e181b575560c636c93bde6b52d (diff) | |
download | gitlab-ce-f097e4dbcd26a0d122776b72ca4370890a0a3f76.tar.gz |
Don't send rejection mails for all auto-generated mails28472-ignore-auto-generated-mails
Also make it easier to have mailer helper
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/email/handler/create_note_handler.rb | 1 | ||||
-rw-r--r-- | lib/gitlab/email/receiver.rb | 4 |
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) |