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 :victory_hand:

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

Last Post!

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 Announcing Top

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
mathieuprog
Hello :waving_hand: Allow me to introduce you to Tz, an alternative time zone database support to Tzdata. Why another library? First a...
New
wojtekmach
Hey everyone! Req is an HTTP client for Elixir that I’ve been working on for quite some time. There is already a lot of HTTP clients out...
New
restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 10719 134
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
brainlid
LangChain is short for Language Chain. An LLM, or Large Language Model, is the “Language” part. This library makes it easier for Elixir a...
New
scohen
Lexical Lexical is a next-generation language server for the Elixir programming language. Features Context aware code completion As-you...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New

We're in Beta

About us Mission Statement