Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a89e9736
Commit
a89e9736
authored
Feb 11, 2017
by
Semyon Pupkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set `Auto-Submitted: auto-generated` header to emails
Closes
https://gitlab.com/gitlab-org/gitlab-ce/issues/20305
parent
5e952962
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
0 deletions
+25
-0
changelogs/unreleased/add-auto-submited-header.yml
changelogs/unreleased/add-auto-submited-header.yml
+4
-0
config/initializers/additional_headers_interceptor.rb
config/initializers/additional_headers_interceptor.rb
+1
-0
lib/additional_email_headers_interceptor.rb
lib/additional_email_headers_interceptor.rb
+8
-0
spec/lib/additional_email_headers_interceptor_spec.rb
spec/lib/additional_email_headers_interceptor_spec.rb
+12
-0
No files found.
changelogs/unreleased/add-auto-submited-header.yml
0 → 100644
View file @
a89e9736
---
title
:
Set Auto-Submitted header to mails
merge_request
:
author
:
Semyon Pupkov
config/initializers/additional_headers_interceptor.rb
0 → 100644
View file @
a89e9736
ActionMailer
::
Base
.
register_interceptor
(
AdditionalEmailHeadersInterceptor
)
lib/additional_email_headers_interceptor.rb
0 → 100644
View file @
a89e9736
class
AdditionalEmailHeadersInterceptor
def
self
.
delivering_email
(
message
)
message
.
headers
(
'Auto-Submitted'
=>
'auto-generated'
,
'X-Auto-Response-Suppress'
=>
'All'
)
end
end
spec/lib/additional_email_headers_interceptor_spec.rb
0 → 100644
View file @
a89e9736
require
'spec_helper'
describe
AdditionalEmailHeadersInterceptor
do
it
'adds Auto-Submitted header'
do
mail
=
ActionMailer
::
Base
.
mail
(
to:
'test@mail.com'
,
from:
'info@mail.com'
,
body:
'hello'
).
deliver
expect
(
mail
.
header
[
'To'
].
value
).
to
eq
(
'test@mail.com'
)
expect
(
mail
.
header
[
'From'
].
value
).
to
eq
(
'info@mail.com'
)
expect
(
mail
.
header
[
'Auto-Submitted'
].
value
).
to
eq
(
'auto-generated'
)
expect
(
mail
.
header
[
'X-Auto-Response-Suppress'
].
value
).
to
eq
(
'All'
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment