Skip to content

Commit

Permalink
Simplify and fix ADMIN_EMAIL verification regex. Fixes #2841 (#2890)
Browse files Browse the repository at this point in the history
* Email addresses start with something other than "@", have arbitrary characters,
   at least one "@", at least one character after that.
  • Loading branch information
henryk authored and engelgabriel committed Apr 14, 2016
1 parent 0b75c41 commit 1767003
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/startup/initialData.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Meteor.startup ->
console.log "Name: #{adminUser.name}".green

if process.env.ADMIN_EMAIL?
re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
re = /^[^@].*@[^@]+$/i
if re.test process.env.ADMIN_EMAIL
if not RocketChat.models.Users.findOneByEmailAddress process.env.ADMIN_EMAIL
adminUser.emails = [
Expand Down

0 comments on commit 1767003

Please sign in to comment.