1716078451.0.0 • Published 2 days ago

@fnando/email_data v1716078451.0.0

Weekly downloads
1,065
License
MIT
Repository
github
Last release
2 days ago

email_data

Tests Code Climate Gem version Gem downloads NPM version NPM downloads

This project is a compilation of datasets related to emails.

  • Disposable emails
  • Disposable domains
  • Free email services
  • Roles (e.g. info, spam, etc)

The data is compiled from several different sources, so thank you all for making this data available.

Ruby

Installation

gem install email_data

Or add the following line to your project's Gemfile:

gem "email_data"

Usage

require "email_data"

# <Pathname /> instance pointing to the data directory.
EmailData.data_dir

# List of disposable domains. Punycode is expanded into ASCII domains.
EmailData.disposable_domains
EmailData.disposable_domains_with_mx
EmailData.disposable_domains_without_mx

# List of disposable emails. Some services use free email like Gmail to create
# disposable emails.
EmailData.disposable_emails

# List of free email services.
EmailData.free_email_domains

# List of roles. Can be used to filter out emails like info@ or all@.
EmailData.roles

# List of private relays like Apple's Hide My Email.
EmailData.private_relays

# List of country tlds.
EmailData.country_tlds

# List of official tlds.
EmailData.tlds

# List of second-level domains.
EmailData.slds

# A list of DNSBL providers.
EmailData.dnsbls

Data sources

By default, Ruby will load data from filesystem. You may want to load this data from the database instead. email-data has support for ActiveRecord out of the box. To use the ActiveRecord adapter, you must load email_data/source/active_record.rb. You can easily do it so with Bundler's require key.

gem "email_data", require: "email_data/source/active_record"

Then, you need to assign the new data source.

EmailData.source = EmailData::Source::ActiveRecord

If you need to configure a different database connection than the one defined by ActiveRecord::Base, use EmailData::Source::ActiveRecord::ApplicationRecord for that.

Creating the tables

To create the tables, use the migration code below (tweak it accordingly if you use something different than PostgreSQL, or don't want to use citext).

class SetupEmailData < ActiveRecord::Migration[6.1]
  def change
    enable_extension "citext"

    create_table :tlds do |t|
      t.citext :name, null: false
    end

    add_index :tlds, :name, unique: true

    create_table :slds do |t|
      t.citext :name, null: false
    end

    add_index :slds, :name, unique: true

    create_table :country_tlds do |t|
      t.citext :name, null: false
    end

    add_index :country_tlds, :name, unique: true

    create_table :disposable_emails do |t|
      t.citext :name, null: false
    end

    add_index :disposable_emails, :name, unique: true

    create_table :disposable_domains do |t|
      t.citext :name, null: false
    end

    add_index :disposable_domains, :name, unique: true

    create_table :disposable_domains_with_mx do |t|
      t.citext :name, null: false
    end

    add_index :disposable_domains_with_mx, :name, unique: true

    create_table :disposable_domains_without_mx do |t|
      t.citext :name, null: false
    end

    add_index :disposable_domains_without_mx, :name, unique: true

    create_table :free_email_domains do |t|
      t.citext :name, null: false
    end

    add_index :free_email_domains, :name, unique: true

    create_table :roles do |t|
      t.citext :name, null: false
    end

    add_index :roles, :name, unique: true

    create_table :private_relays do |t|
      t.citext :name, null: false
    end

    add_index :private_relays, :name, unique: true

    create_table :dnsbls do |t|
      t.citext :name, null: false
    end

    add_index :dnsbls, :name, unique: true
  end
end
Loading the data

With PostgreSQL, you load the data using the COPY command. First, you'll need to discover where your gems are being installed. Use gem list for that.

$ gem list email_data -d

*** LOCAL GEMS ***

email_data (1601479967, 1601260789)
    Author: Nando Vieira
    Homepage: https://github.com/fnando/email_data
    License: MIT
    Installed at (1601479967): /usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0
    This project is a compilation of datasets related to emails.
    Includes disposable emails, disposable domains, and free email
    services.

The you can load each dataset using COPY:

COPY tlds (name) FROM '/usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/email_data-1601479967/data/tlds.txt';
COPY slds (name) FROM '/usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/email_data-1601479967/data/slds.txt';
COPY country_tlds (name) FROM '/usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/email_data-1601479967/data/country_tlds.txt';
COPY disposable_emails (name) FROM '/usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/email_data-1601479967/data/disposable_emails.txt';
COPY disposable_domains (name) FROM '/usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/email_data-1601479967/data/disposable_domains.txt';
COPY disposable_domains_with_mx (name) FROM '/usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/email_data-1601479967/data/disposable_domains_with_mx.txt';
COPY disposable_domains_without_mx (name) FROM '/usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/email_data-1601479967/data/disposable_domains_without_mx.txt';
COPY free_email_domains (name) FROM '/usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/email_data-1601479967/data/free_email_domains.txt';
COPY roles (name) FROM '/usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/email_data-1601479967/data/roles.txt';
COPY private_relays (name) FROM '/usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/email_data-1601479967/data/private_relays.txt';
COPY dnsbls (name) FROM '/usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/email_data-1601479967/data/dnsbls.txt';

Alternatively, you could create a migration that executes that same command; given that you'd be running Ruby code, you can replace the steps to find the gem path with EmailData.data_dir.

class LoadEmailData < ActiveRecord::Migration[6.1]
  def change
    copy = lambda do |table_name|
      connection = ActiveRecord::Base.connection
      data_path = EmailData.data_dir

      connection.execute <<~PG
        COPY #{table_name} (name)
        FROM '#{data_path.join(table_name)}.txt'
        (FORMAT CSV)
      PG
    end

    copy.call(:tlds)
    copy.call(:slds)
    copy.call(:country_tlds)
    copy.call(:disposable_emails)
    copy.call(:disposable_domains)
    copy.call(:disposable_domains_with_mx)
    copy.call(:disposable_domains_without_mx)
    copy.call(:free_email_domains)
    copy.call(:roles)
    copy.call(:private_relays)
    copy.call(:dnsbls)
  end
end

Node.js

Installation

$ yarn add @fnando/email_data

or

$ npm install @fnando/email_data

Usage

const disposableEmails = require("@fnando/email_data/data/json/disposable_emails.json");
const disposableDomains = require("@fnando/email_data/data/json/disposable_domains.json");
const disposableDomainsWithMx = require("@fnando/email_data/data/json/disposable_domains_with_mx.json");
const disposableDomainsWithoutMx = require("@fnando/email_data/data/json/disposable_domains_without_mx.json");
const freeEmailDomains = require("@fnando/email_data/data/json/free_email_domains.json");
const roles = require("@fnando/email_data/data/json/roles.json");
const privateRelays = require("@fnando/email_data/data/json/private_relays.json");
const tlds = require("@fnando/email_data/data/json/tlds.json");
const slds = require("@fnando/email_data/data/json/slds.json");
const cctlds = require("@fnando/email_data/data/json/country_tlds.json");
const dnsbls = require("@fnando/email_data/data/json/dnsbls.json");

Dataset

The dataset is updated automatically. If you have any manual entries you would like to add, please make a pull request against the files data/manual/*.txt.

  • data/manual/disposable_domains.txt: only domains from disposable servers must go here.
  • data/manual/disposable_emails.txt: only normalized email addresses that use free email services must go here. E.g. d.i.s.p.o.s.a.b.l.e+1234@gmail.com must be added as disposable@gmail.com.
  • data/manual/free_email_domains.txt: only free email services must go here.
  • data/manual/roles.txt: list of role-based user names like info or no-reply.
  • data/manual/private_relays.txt: list of private relay services, like Apple's Hide My Email.

Maintainer

Contributors

Contributing

For more details about how to contribute, please read https://github.com/fnando/email_data/blob/main/CONTRIBUTING.md.

License

The gem is available as open source under the terms of the MIT License. A copy of the license can be found at https://github.com/fnando/email_data/blob/main/LICENSE.md.

Code of Conduct

Everyone interacting in the email_data project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

1716078451.0.0

2 days ago

1715473663.0.0

9 days ago

1714868851.0.0

16 days ago

1714264088.0.0

23 days ago

1713659230.0.0

1 month ago

1713054653.0.0

1 month ago

1712449687.0.0

1 month ago

1711844871.0.0

2 months ago

1711240075.0.0

2 months ago

1710635221.0.0

2 months ago

1710030441.0.0

2 months ago

1709425613.0.0

3 months ago

1708820814.0.0

3 months ago

1708216007.0.0

3 months ago

1707611231.0.0

3 months ago

1707006417.0.0

4 months ago

1706401639.0.0

4 months ago

1705796851.0.0

4 months ago

1705192048.0.0

4 months ago

1704587245.0.0

5 months ago

1703982427.0.0

5 months ago

1703377628.0.0

5 months ago

1702772829.0.0

5 months ago

1702168032.0.0

5 months ago

1689467392.0.0

10 months ago

1697934462.0.0

7 months ago

1700353605.0.0

6 months ago

1692491201.0.0

9 months ago

1698539286.0.0

7 months ago

1696724921.0.0

8 months ago

1696120045.0.0

8 months ago

1694305650.0.0

8 months ago

1695515208.0.0

8 months ago

1699144068.0.0

7 months ago

1690072122.0.0

10 months ago

1691886470.0.0

9 months ago

1694910495.0.0

8 months ago

1691281706.0.0

10 months ago

1695406680.0.0

8 months ago

1688257664.0.0

11 months ago

1693700838.0.0

9 months ago

1696494936.0.0

8 months ago

1700958398.0.0

6 months ago

1701563194.0.0

6 months ago

1699748906.0.0

6 months ago

1690676894.0.0

10 months ago

1697647319.0.0

7 months ago

1693096010.0.0

9 months ago

1697329714.0.0

7 months ago

1688862479.0.0

11 months ago

1686443234.0.0

12 months ago

1687048036.0.0

11 months ago

1687652927.0.0

11 months ago

1685838438.0.0

12 months ago

1683419196.0.0

1 year ago

1684024035.0.0

1 year ago

1680999980.0.0

1 year ago

1684628879.0.0

1 year ago

1681604707.0.0

1 year ago

1685233635.0.0

12 months ago

1682209522.0.0

1 year ago

1682814418.0.0

1 year ago

1667089718.0.0

2 years ago

1666485056.0.0

2 years ago

1668299237.0.0

2 years ago

1667694455.0.0

2 years ago

1665880193.0.0

2 years ago

1665275402.0.0

2 years ago

1664670732.0.0

2 years ago

1662855993.0.0

2 years ago

1658622342.0.0

2 years ago

1657412872.0.0

2 years ago

1662251192.0.0

2 years ago

1660436768.0.0

2 years ago

1655598278.0.0

2 years ago

1656203061.0.0

2 years ago

1661646510.0.0

2 years ago

1664065671.0.0

2 years ago

1656807964.0.0

2 years ago

1659227281.0.0

2 years ago

1663460858.0.0

2 years ago

1659831989.0.0

2 years ago

1661041677.0.0

2 years ago

1658017524.0.0

2 years ago

1653783929.0.0

2 years ago

1653179119.0.0

2 years ago

1654993445.0.0

2 years ago

1652574371.0.0

2 years ago

1654388780.0.0

2 years ago

1651969670.0.0

2 years ago

1650759894.0.0

2 years ago

1651364852.0.0

2 years ago

1650155050.0.0

2 years ago

1649550297.0.0

2 years ago

1648945498.0.0

2 years ago

1647735777.0.0

2 years ago

1648340621.0.0

2 years ago

1643503752.0.0

2 years ago

1645318633.0.0

2 years ago

1640479855.0.0

2 years ago

1646526232.0.0

2 years ago

1645921443.0.0

2 years ago

1642294286.0.0

2 years ago

1642898877.0.0

2 years ago

1647131067.0.0

2 years ago

1641084676.0.0

2 years ago

1644713622.0.0

2 years ago

1641689574.0.0

2 years ago

1644108986.0.0

2 years ago

1639270185.0.0

2 years ago

1638060421.0.0

2 years ago

1639875066.0.0

2 years ago

1638665377.0.0

2 years ago

1637455647.0.0

2 years ago

1636850828.0.0

3 years ago

1636246001.0.0

3 years ago

1635641195.0.0

3 years ago

1635036401.0.0

3 years ago

1634949660.0.0

3 years ago

1634863554.0.0

3 years ago

1633912876.0.0

3 years ago

1634690558.0.0

3 years ago

1634517710.0.0

3 years ago

1634172014.0.0

3 years ago

1634431321.0.0

3 years ago

1634604152.0.0

3 years ago

1633653651.0.0

3 years ago

1634085607.0.0

3 years ago

1633826560.0.0

3 years ago

1634258553.0.0

3 years ago

1634777040.0.0

3 years ago

1633567291.0.0

3 years ago

1633999372.0.0

3 years ago

1634344953.0.0

3 years ago

1633308186.0.0

3 years ago

1633480857.0.0

3 years ago

1633394485.0.0

3 years ago

1633221717.0.0

3 years ago

1633135180.0.0

3 years ago

1633048926.0.0

3 years ago

1632875880.0.0

3 years ago

1632962546.0.0

3 years ago

1632789636.0.0

3 years ago

1632703197.0.0

3 years ago

1632616981.0.0

3 years ago

1632530386.0.0

3 years ago

1632357667.0.0

3 years ago

1632444003.0.0

3 years ago

1632271240.0.0

3 years ago

1632184599.0.0

3 years ago

1632098530.0.0

3 years ago

1631925416.0.0

3 years ago

1632012031.0.0

3 years ago

1631839301.0.0

3 years ago

1631752979.0.0

3 years ago

1631666353.0.0

3 years ago

1631580022.0.0

3 years ago

1631493692.0.0

3 years ago

1631407290.0.0

3 years ago

1631320763.0.0

3 years ago

1631234429.0.0

3 years ago

1631061457.0.0

3 years ago

1630975040.0.0

3 years ago

1630802378.0.0

3 years ago

1630629441.0.0

3 years ago

1630715858.0.0

3 years ago

1630456736.0.0

3 years ago

1630370197.0.0

3 years ago

1630283933.0.0

3 years ago

1630197604.0.0

3 years ago

1630110987.0.0

3 years ago

1630024792.0.0

3 years ago

1629938228.0.0

3 years ago

1629765497.0.0

3 years ago

1629851904.0.0

3 years ago

1629419839.0.0

3 years ago

1629333310.0.0

3 years ago

1629506214.0.0

3 years ago

1629592699.0.0

3 years ago

1629246997.0.0

3 years ago

1629160600.0.0

3 years ago

1629074316.0.0

3 years ago

1628901415.0.0

3 years ago

1628987845.0.0

3 years ago

1628815217.0.0

3 years ago

1628728470.0.0

3 years ago

1628555917.0.0

3 years ago

1628469583.0.0

3 years ago

1628296572.0.0

3 years ago

1628210201.0.0

3 years ago

1628123836.0.0

3 years ago

1627951127.0.0

3 years ago

1627778465.0.0

3 years ago

1627691837.0.0

3 years ago

1627605436.0.0

3 years ago

1627518939.0.0

3 years ago

1627432771.0.0

3 years ago

1627346241.0.0

3 years ago

1627259852.0.0

3 years ago

1627173460.0.0

3 years ago

1626914268.0.0

3 years ago

1626827937.0.0

3 years ago

1627087076.0.0

3 years ago

1626655059.0.0

3 years ago

1626741320.0.0

3 years ago

1626568685.0.0

3 years ago

1626395864.0.0

3 years ago

1626482219.0.0

3 years ago

1626309470.0.0

3 years ago

1618359706.0.0

3 years ago

1618273438.0.0

3 years ago

1618186944.0.0

3 years ago

1618100556.0.0

3 years ago

1617928153.0.0

3 years ago

1618014169.0.0

3 years ago

1617841862.0.0

3 years ago

1617755322.0.0

3 years ago

1617668900.0.0

3 years ago

1617582173.0.0

3 years ago

1617495950.0.0

3 years ago

1617409388.0.0

3 years ago

1617236585.0.0

3 years ago

1617150053.0.0

3 years ago

1617063382.0.0

3 years ago

1616977292.0.0

3 years ago

1616890891.0.0

3 years ago

1616804361.0.0

3 years ago

1616718259.0.0

3 years ago

1616631663.0.0

3 years ago

1616459305.0.0

3 years ago

1616545712.0.0

3 years ago

1616113740.0.0

3 years ago

1616286604.0.0

3 years ago

1615940818.0.0

3 years ago

1616027290.0.0

3 years ago

1615854402.0.0

3 years ago

1615768059.0.0

3 years ago

1615681687.0.0

3 years ago

1615508871.0.0

3 years ago

1615249728.0.0

3 years ago

1615076922.0.0

3 years ago

1614904095.0.0

3 years ago

1614817634.0.0

3 years ago

1614731202.0.0

3 years ago

1614644760.0.0

3 years ago

1614558460.0.0

3 years ago

1614472179.0.0

3 years ago

1614385630.0.0

3 years ago

1614299156.0.0

3 years ago

1614039907.0.0

3 years ago

1613953594.0.0

3 years ago

1613867235.0.0

3 years ago

1613694388.0.0

3 years ago

1613521937.0.0

3 years ago

1613435771.0.0

3 years ago

1613348773.0.0

3 years ago

1613262423.0.0

3 years ago

1613176087.0.0

3 years ago

1613089470.0.0

3 years ago

1613003305.0.0

3 years ago

1612916911.0.0

3 years ago

1612830351.0.0

3 years ago

1612743978.0.0

3 years ago

1612657625.0.0

3 years ago

1612571428.0.0

3 years ago

1612484641.0.0

3 years ago

1612398159.0.0

3 years ago

1612312138.0.0

3 years ago

1612225823.0.0

3 years ago

1612139539.0.0

3 years ago

1612053082.0.0

3 years ago

1611966503.0.0

3 years ago

1611880259.0.0

3 years ago

1611793691.0.0

3 years ago

1611707562.0.0

3 years ago

1611620961.0.0

3 years ago

1611536305.0.0

3 years ago

1611449894.0.0

3 years ago

1611363652.0.0

3 years ago

1611276970.0.0

3 years ago

1611190867.0.0

3 years ago

1611104550.0.0

3 years ago

1611017335.0.0

3 years ago

1610930792.0.0

3 years ago

1610844319.0.0

3 years ago

1610671449.0.0

3 years ago

1610498496.0.0

3 years ago

1610412447.0.0

3 years ago

1610238772.0.0

3 years ago

1610065864.0.0

3 years ago

1609980353.0.0

3 years ago

1609893767.0.0

3 years ago

1609807348.0.0

3 years ago

1609720910.0.0

3 years ago

1609634456.0.0

3 years ago

1609547943.0.0

3 years ago

1609461627.0.0

3 years ago

1609375253.0.0

3 years ago

1609288797.0.0

3 years ago

1609202270.0.0

3 years ago

1609115790.0.0

3 years ago

1609029410.0.0

3 years ago

1608942920.0.0

3 years ago

1608856628.0.0

3 years ago

1608770333.0.0

3 years ago

1608683762.0.0

3 years ago

1608597215.0.0

3 years ago

1608510727.0.0

3 years ago

1608424188.0.0

3 years ago

1608337863.0.0

3 years ago

1608251444.0.0

3 years ago

1608165089.0.0

3 years ago

1608078554.0.0

3 years ago

1607992140.0.0

3 years ago

1607905685.0.0

3 years ago

1607819360.0.0

3 years ago

1607674945.0.0

3 years ago

1607672976.0.0

3 years ago

1607653226.0.0

3 years ago

1607560144.0.0

3 years ago

1607565761.0.0

3 years ago

1607473695.0.0

3 years ago

1607452424.0.0

3 years ago

1607321830.0.0

3 years ago

1607200035.0.0

3 years ago

1607057940.0.0

3 years ago

1606953034.0.0

3 years ago

1606845461.0.0

3 years ago

1606718902.0.0

3 years ago

1606620725.0.0

3 years ago

1606495330.0.0

3 years ago

1606361847.0.0

3 years ago

1606172235.0.0

3 years ago

1606065366.0.0

3 years ago

1605927397.0.0

3 years ago

1605814579.0.0

4 years ago

1605671224.0.0

4 years ago

1605588714.0.0

4 years ago

1605432951.0.0

4 years ago

1605483437.0.0

4 years ago

1605293459.0.0

4 years ago

1605067682.0.0

4 years ago

1604907377.0.0

4 years ago

1604944785.0.0

4 years ago

1604799858.0.0

4 years ago

1604735754.0.0

4 years ago

1604703468.0.0

4 years ago

1604569392.0.0

4 years ago

1604444717.0.0

4 years ago

1604325875.0.0

4 years ago

1604239223.0.0

4 years ago

1604097095.0.0

4 years ago

1604010434.0.0

4 years ago

1603923660.0.0

4 years ago

1603817241.0.0

4 years ago

1603707709.0.0

4 years ago

1603621117.0.0

4 years ago

1603499092.0.0

4 years ago

1603398147.0.0

4 years ago

1603311369.0.0

4 years ago

1603224590.0.0

4 years ago

1603137851.0.0

4 years ago

1603054658.0.0

4 years ago

1603050808.0.0

4 years ago

1602964602.0.0

4 years ago

1602274654.0.0

4 years ago

1601711723.0.0

4 years ago

1601601018.0.0

4 years ago

1601479967.0.0

4 years ago

1601260789.0.0

4 years ago

1601260238.0.0

4 years ago

1601253725.0.0

4 years ago

1601164089.0.0

4 years ago

1601161287.0.0

4 years ago