BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
be73838b
Commit
be73838b
authored
May 11, 2018
by
Chantal Rollison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add anchor for incoming email regex, closes 44989
parent
aa3004c4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
ccr-incoming-email-regex-anchor.yml
changelogs/unreleased/ccr-incoming-email-regex-anchor.yml
+3
-0
incoming_email.rb
lib/gitlab/incoming_email.rb
+1
-1
incoming_email_spec.rb
spec/lib/gitlab/incoming_email_spec.rb
+4
-0
No files found.
changelogs/unreleased/ccr-incoming-email-regex-anchor.yml
0 → 100644
View file @
be73838b
title
:
Add anchor for incoming email regex
merge_request
:
!18917
type
:
added
lib/gitlab/incoming_email.rb
View file @
be73838b
...
...
@@ -57,7 +57,7 @@ module Gitlab
regex
=
Regexp
.
escape
(
wildcard_address
)
regex
=
regex
.
sub
(
Regexp
.
escape
(
WILDCARD_PLACEHOLDER
),
'(.+)'
)
Regexp
.
new
(
regex
).
freeze
Regexp
.
new
(
/\A
#{
regex
}
\z/
).
freeze
end
end
end
...
...
spec/lib/gitlab/incoming_email_spec.rb
View file @
be73838b
...
...
@@ -83,6 +83,10 @@ describe Gitlab::IncomingEmail do
it
"returns reply key"
do
expect
(
described_class
.
key_from_address
(
"replies+key@example.com"
)).
to
eq
(
"key"
)
end
it
'does not match emails with extra bits'
do
expect
(
described_class
.
key_from_address
(
'somereplies+somekey@example.com.someotherdomain.com'
)).
to
be
nil
end
end
context
'self.key_from_fallback_message_id'
do
...
...
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