# New signup with old email including + doesnt work in rest API

**URL:** <https://meta.discourse.org/t/new-signup-with-old-email-including-doesnt-work-in-rest-api/267594>\
**Category:** Product Support\
**Created:** [June 7, 2023, 8:39pm UTC](https://meta.discourse.org/t/new-signup-with-old-email-including-doesnt-work-in-rest-api/267594 "2023-06-07T20:39:29Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)\
**Post date:** [June 8, 2023, 12:55am UTC](https://meta.discourse.org/t/new-signup-with-old-email-including-doesnt-work-in-rest-api/267594/14 "2023-06-08T00:55:35Z")

</div>

Back at my desk I took a look at the actual code that does this rejection:

> <https://github.com/discourse/discourse/blob/699f3e701471ad794994c665aa63916d832b27de/app/models/screened_email.rb#L32>

Right at the top we’re checking the canonical email against the blocklist:

```ruby
  def self.canonical(email)
    name, domain = email.split("@", 2)
    name = name.gsub(/\+.*/, "")
    name = name.gsub(".", "") if %w[gmail.com googlemail.com].include?(domain.downcase)
    "#{name}@#{domain}".downcase
  end

```

And even if that didn’t catch it, it would be caught by the [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) check here:

```plaintext
[1] pry(main)> ScreenedEmail.levenshtein('fakezabanshenas@gmail.com', 'fakezabanshenas+1@gmail.com')
=> 2

```

as the default for `SiteSetting.levenshtein_distance_spammer_emails` is `2`.

---

_[View the full topic](https://meta.discourse.org/t/new-signup-with-old-email-including-doesnt-work-in-rest-api/267594)._
