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
Léo-Paul Géneau
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
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
1 deletion
+8
-1
changelogs/unreleased/ccr-incoming-email-regex-anchor.yml
changelogs/unreleased/ccr-incoming-email-regex-anchor.yml
+3
-0
lib/gitlab/incoming_email.rb
lib/gitlab/incoming_email.rb
+1
-1
spec/lib/gitlab/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