Coder Social home page Coder Social logo

email_guard's Introduction

EmailGuard hex.pm hexdocs.pm

Elixir library for detecting disposable (burner) or personal email addresses.

Focused on performance and features the largest database of domains availble.

Comes with two lists out of the box:

  • DisposableList - based on mailchecker's list, total 33,606 domains;
  • FreeList - based on this list excl. already listed in DisposableList, total 5009 domains.

You can also plug your own dataset by implementing the EmailGuard.List behaviour โœŒ๏ธ

Installation

Add to your mix.exs:

def deps do
  [
    {:email_guard, "~> 1.0"}
  ]
end

If you're not using application inference, then add :email_guard to your applications list.

Usage

Checks if given email or domain is present in email lists:

iex> EmailGuard.check("[email protected]")
:ok

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

By default it will check against EmailGuard.DisposableList:

iex> EmailGuard.check("[email protected]")
{:error, EmailGuard.DisposableList}

You can specify the email list modules, e.g. including the provided one for free email service providers:

iex> lists = [EmailGuard.DisposableList, EmailGuard.FreeList]
[EmailGuard.DisposableList, EmailGuard.FreeList]

iex> EmailGuard.check("[email protected]", lists)
{:error, EmailGuard.FreeList}

To provide your own custom list see the EmailGuard.List behaviour.

Note that EmailGuard expects a valid email address or domain as input.

Benchmark

MIX_ENV=bench mix run bench/check_bench.exs

License

See LICENSE file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.