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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
32eae15f
Commit
32eae15f
authored
May 20, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
It's for Message-ID so it should be message_id
parent
c2bc15a7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
lib/gitlab/email/receiver.rb
lib/gitlab/email/receiver.rb
+1
-1
lib/gitlab/incoming_email.rb
lib/gitlab/incoming_email.rb
+3
-3
spec/lib/gitlab/incoming_email_spec.rb
spec/lib/gitlab/incoming_email_spec.rb
+2
-2
No files found.
lib/gitlab/email/receiver.rb
View file @
32eae15f
...
...
@@ -60,7 +60,7 @@ module Gitlab
def
key_from_additional_headers
Array
(
mail
.
references
).
find
do
|
mail_id
|
key
=
Gitlab
::
IncomingEmail
.
key_from_fallback_
reply_mail
_id
(
mail_id
)
key
=
Gitlab
::
IncomingEmail
.
key_from_fallback_
message
_id
(
mail_id
)
break
key
if
key
end
end
...
...
lib/gitlab/incoming_email.rb
View file @
32eae15f
module
Gitlab
module
IncomingEmail
class
<<
self
FALLBACK_
REPLY_MAIL
_ID_REGEX
=
/\Areply\-(.+)@
#{
Gitlab
.
config
.
gitlab
.
host
}
\Z/
.
freeze
FALLBACK_
MESSAGE
_ID_REGEX
=
/\Areply\-(.+)@
#{
Gitlab
.
config
.
gitlab
.
host
}
\Z/
.
freeze
def
enabled?
config
.
enabled
&&
config
.
address
...
...
@@ -21,8 +21,8 @@ module Gitlab
match
[
1
]
end
def
key_from_fallback_
reply_mail
_id
(
mail_id
)
match
=
mail_id
.
match
(
FALLBACK_
REPLY_MAIL
_ID_REGEX
)
def
key_from_fallback_
message
_id
(
mail_id
)
match
=
mail_id
.
match
(
FALLBACK_
MESSAGE
_ID_REGEX
)
return
unless
match
match
[
1
]
...
...
spec/lib/gitlab/incoming_email_spec.rb
View file @
32eae15f
...
...
@@ -43,9 +43,9 @@ describe Gitlab::IncomingEmail, lib: true do
end
end
context
'self.key_from_fallback_
reply_mail
_id'
do
context
'self.key_from_fallback_
message
_id'
do
it
'returns reply key'
do
expect
(
described_class
.
key_from_fallback_
reply_mail
_id
(
'reply-key@localhost'
)).
to
eq
(
'key'
)
expect
(
described_class
.
key_from_fallback_
message
_id
(
'reply-key@localhost'
)).
to
eq
(
'key'
)
end
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