svilen

svilen

Author of Concurrent Data Processing in Elixir

EmailGuard — library for detecting disposable or personal email addresses

EmailGuard is a simple utility library for detecting disposable (burner) or personal email addresses. Comes with two big data sets ready to use:

  • DisposableList (source) containing 3846 domains of temporary email providers and is the default list to use if no params are provided;
  • FreeList (source) containing 5072 domains of free email providers (with domains already in disposable data set removed)

Example usage:

iex> EmailGuard.check("svilen@gmail.com")
:ok 

iex> EmailGuard.check("svilen@mailinator.com")
{:error, "EmailGuard.DisposableList"}

iex> alias EmailGuard.{DisposableList, FreeList}

iex> EmailGuard.check("svilen@gmail.com", [DisposableList, FreeList])
{:error, "EmailGuard.FreeList"}

Hope it’s useful :v:

For more info:

Most Liked

gon782

gon782

I can’t help but think this is a bit user hostile if action is taken based on it, if it’s not one point in a total risk assessment or something.

gon782

gon782

That’s an incredibly off-base analogy. An e-mail address isn’t a payment form and receiving spam from a company that for no reason wants your e-mail isn’t the same as trading money for a product. I’m sorry if I offended anyone who uses this mildly dark pattern and wants to rationalize it, but you’re definitely moving towards user hostility in doing so, unless you can prove value to your users and show that value as an imperative to using a real e-mail address.

idi527

idi527

The lookup process seems a bit inefficient, I would pattern match on function heads instead.

for bad_domain <- File.stream!("bad_domains") do
  def lookup(unquote(bad_domain)), do: "EmailGuard.BadDomainList"
end

def lookup(_unmatched), do: nil

def check(email) do
  domain = extract_domain(email)
  if resp = lookup(domain) do
    {:error, resp}
  else
    :ok 
  end 
end
idi527

idi527

svilen

svilen

Author of Concurrent Data Processing in Elixir

Published 1.1.0 with significant performance improvements, thanks to @idi527 :tada:

See CHANGELOG.md for more info.

Where Next?

Popular in Libraries Top

tmbb
I’ve been working on two packages (not on hex.pm yet) to build admin interfaces for phoenix apps: bureaucrat - which contains a bunch ...
New
pkrawat1
Hey guyz We at @aviabird are working on a payment library in elixir/phoenix. We are targeting March 2018 to add 56 Gateways to it. Have...
New
oltarasenko
Dear Elixir community, After a year of development, bug fixes, and improvements, we are proudly ready to share the release of Crawly 0.1...
New
josevalim
EDIT: since Ecto 3.0 final version is out, this post was amended to use the final versions in the instructions below. Hi everyone, We a...
New
mcrumm
If you would like to migrate away from node/npm/webpack while still using sass, the dart_sass package provides a installer and runner for...
New
New
Crowdhailer
I have been updating a library that allows you to pipe between functions that use the erlang result tuple convention. Assuming you have...
New
martinthenth
Hello everybody :wave: Recently, some of my colleagues talked about database ids and uuids and their problems, and I remembered the pain...
New
zorbash
I created Kitto a framework for dashboards inspired by Dashing. [demo] The distributed characteristics of Elixir and the low memory foo...
New
Eiji
ExApi is a library that I’m developing now and hope release soon This library will allow to: list all apis list all api implementation...
New

Other popular topics Top

vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

Sub Categories:

We're in Beta

About us Mission Statement