{"id":13879119,"url":"https://github.com/fnando/email_data","last_synced_at":"2025-04-16T03:44:19.522Z","repository":{"id":43046405,"uuid":"298902985","full_name":"fnando/email_data","owner":"fnando","description":"This project is a compilation of datasets related to emails. Includes disposable emails, disposable domains, and free email services.","archived":false,"fork":false,"pushed_at":"2025-04-13T00:54:58.000Z","size":294206,"stargazers_count":32,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-13T01:02:25.784Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fnando.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":["fnando"],"custom":["https://paypal.me/nandovieira/🍕"]}},"created_at":"2020-09-26T21:32:54.000Z","updated_at":"2025-04-13T00:55:03.000Z","dependencies_parsed_at":"2023-02-08T03:46:07.569Z","dependency_job_id":"0f3842c4-e478-4021-8bce-83d992e8c8d9","html_url":"https://github.com/fnando/email_data","commit_stats":{"total_commits":385,"total_committers":2,"mean_commits":192.5,"dds":0.02857142857142858,"last_synced_commit":"3db7f44fa6828cdcb613cf6a47faea5745008f30"},"previous_names":[],"tags_count":366,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnando%2Femail_data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnando%2Femail_data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnando%2Femail_data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnando%2Femail_data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fnando","download_url":"https://codeload.github.com/fnando/email_data/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249191933,"owners_count":21227683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T08:02:10.449Z","updated_at":"2025-04-16T03:44:19.503Z","avatar_url":"https://github.com/fnando.png","language":"Ruby","readme":"# email_data\n\n[![Tests](https://github.com/fnando/email_data/workflows/ruby-tests/badge.svg)](https://github.com/fnando/email_data)\n[![Gem version](https://img.shields.io/gem/v/email_data.svg?label=Gem%20version)](https://rubygems.org/gems/email_data)\n[![Gem downloads](https://img.shields.io/gem/dt/email_data.svg?label=Gem%20downloads)](https://rubygems.org/gems/email_data)\n[![NPM version](https://img.shields.io/npm/v/%40fnando%2Femail_data.svg?label=NPM%20version)](https://npmjs.org/package/@fnando/email_data)\n[![NPM downloads](https://img.shields.io/npm/dt/%40fnando%2Femail_data.svg?label=NPM%20downloads)](https://npmjs.org/package/@fnando/email_data)\n\nThis project is a compilation of datasets related to emails.\n\n- Disposable emails\n- Disposable domains\n- Free email services\n- Roles (e.g. info, spam, etc)\n\nThe data is compiled from several different sources, so thank you all for making\nthis data available.\n\n## Ruby\n\n### Installation\n\n```bash\ngem install email_data\n```\n\nOr add the following line to your project's Gemfile:\n\n```ruby\ngem \"email_data\"\n```\n\n### Usage\n\n```ruby\nrequire \"email_data\"\n\n# \u003cPathname /\u003e instance pointing to the data directory.\nEmailData.data_dir\n\n# List of disposable domains. Punycode is expanded into ASCII domains.\nEmailData.disposable_domains\nEmailData.disposable_domains_with_mx\nEmailData.disposable_domains_without_mx\n\n# List of disposable emails. Some services use free email like Gmail to create\n# disposable emails.\nEmailData.disposable_emails\n\n# List of free email services.\nEmailData.free_email_domains\n\n# List of roles. Can be used to filter out emails like info@ or all@.\nEmailData.roles\n\n# List of private relays like Apple's Hide My Email.\nEmailData.private_relays\n\n# List of country tlds.\nEmailData.country_tlds\n\n# List of official tlds.\nEmailData.tlds\n\n# List of second-level domains.\nEmailData.slds\n\n# A list of DNSBL providers.\nEmailData.dnsbls\n```\n\n#### Data sources\n\nBy default, Ruby will load data from filesystem. You may want to load this data\nfrom the database instead. `email-data` has support for ActiveRecord out of the\nbox. To use the ActiveRecord adapter, you must load\n`email_data/source/active_record.rb`. You can easily do it so with Bundler's\n`require` key.\n\n```ruby\ngem \"email_data\", require: \"email_data/source/active_record\"\n```\n\nThen, you need to assign the new data source.\n\n```ruby\nEmailData.source = EmailData::Source::ActiveRecord\n```\n\nIf you need to configure a different database connection than the one defined by\n`ActiveRecord::Base`, use `EmailData::Source::ActiveRecord::ApplicationRecord`\nfor that.\n\n##### Creating the tables\n\nTo create the tables, use the migration code below (tweak it accordingly if you\nuse something different than PostgreSQL, or don't want to use `citext`).\n\n```ruby\nclass SetupEmailData \u003c ActiveRecord::Migration[6.1]\n  def change\n    enable_extension \"citext\"\n\n    create_table :tlds do |t|\n      t.citext :name, null: false\n    end\n\n    add_index :tlds, :name, unique: true\n\n    create_table :slds do |t|\n      t.citext :name, null: false\n    end\n\n    add_index :slds, :name, unique: true\n\n    create_table :country_tlds do |t|\n      t.citext :name, null: false\n    end\n\n    add_index :country_tlds, :name, unique: true\n\n    create_table :disposable_emails do |t|\n      t.citext :name, null: false\n    end\n\n    add_index :disposable_emails, :name, unique: true\n\n    create_table :disposable_domains do |t|\n      t.citext :name, null: false\n    end\n\n    add_index :disposable_domains, :name, unique: true\n\n    create_table :disposable_domains_with_mx do |t|\n      t.citext :name, null: false\n    end\n\n    add_index :disposable_domains_with_mx, :name, unique: true\n\n    create_table :disposable_domains_without_mx do |t|\n      t.citext :name, null: false\n    end\n\n    add_index :disposable_domains_without_mx, :name, unique: true\n\n    create_table :free_email_domains do |t|\n      t.citext :name, null: false\n    end\n\n    add_index :free_email_domains, :name, unique: true\n\n    create_table :roles do |t|\n      t.citext :name, null: false\n    end\n\n    add_index :roles, :name, unique: true\n\n    create_table :private_relays do |t|\n      t.citext :name, null: false\n    end\n\n    add_index :private_relays, :name, unique: true\n\n    create_table :dnsbls do |t|\n      t.citext :name, null: false\n    end\n\n    add_index :dnsbls, :name, unique: true\n  end\nend\n```\n\n##### Loading the data\n\nWith PostgreSQL, you load the data using the `COPY` command. First, you'll need\nto discover where your gems are being installed. Use `gem list` for that.\n\n```console\n$ gem list email_data -d\n\n*** LOCAL GEMS ***\n\nemail_data (1601479967, 1601260789)\n    Author: Nando Vieira\n    Homepage: https://github.com/fnando/email_data\n    License: MIT\n    Installed at (1601479967): /usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0\n    This project is a compilation of datasets related to emails.\n    Includes disposable emails, disposable domains, and free email\n    services.\n```\n\nThe you can load each dataset using `COPY`:\n\n```sql\nCOPY tlds (name) FROM '/usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/email_data-1601479967/data/tlds.txt';\nCOPY slds (name) FROM '/usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/email_data-1601479967/data/slds.txt';\nCOPY country_tlds (name) FROM '/usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/email_data-1601479967/data/country_tlds.txt';\nCOPY disposable_emails (name) FROM '/usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/email_data-1601479967/data/disposable_emails.txt';\nCOPY disposable_domains (name) FROM '/usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/email_data-1601479967/data/disposable_domains.txt';\nCOPY 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';\nCOPY 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';\nCOPY 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';\nCOPY roles (name) FROM '/usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/email_data-1601479967/data/roles.txt';\nCOPY private_relays (name) FROM '/usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/email_data-1601479967/data/private_relays.txt';\nCOPY dnsbls (name) FROM '/usr/local/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/email_data-1601479967/data/dnsbls.txt';\n```\n\nAlternatively, you could create a migration that executes that same command;\ngiven that you'd be running Ruby code, you can replace the steps to find the gem\npath with `EmailData.data_dir`.\n\n```ruby\nclass LoadEmailData \u003c ActiveRecord::Migration[6.1]\n  def change\n    copy = lambda do |table_name|\n      connection = ActiveRecord::Base.connection\n      data_path = EmailData.data_dir\n\n      connection.execute \u003c\u003c~PG\n        COPY #{table_name} (name)\n        FROM '#{data_path.join(table_name)}.txt'\n        (FORMAT CSV)\n      PG\n    end\n\n    copy.call(:tlds)\n    copy.call(:slds)\n    copy.call(:country_tlds)\n    copy.call(:disposable_emails)\n    copy.call(:disposable_domains)\n    copy.call(:disposable_domains_with_mx)\n    copy.call(:disposable_domains_without_mx)\n    copy.call(:free_email_domains)\n    copy.call(:roles)\n    copy.call(:private_relays)\n    copy.call(:dnsbls)\n  end\nend\n```\n\n## Node.js\n\n### Installation\n\n```console\n$ yarn add @fnando/email_data\n```\n\nor\n\n```console\n$ npm install @fnando/email_data\n```\n\n### Usage\n\n```js\nconst disposableEmails = require(\"@fnando/email_data/data/json/disposable_emails.json\");\nconst disposableDomains = require(\"@fnando/email_data/data/json/disposable_domains.json\");\nconst disposableDomainsWithMx = require(\"@fnando/email_data/data/json/disposable_domains_with_mx.json\");\nconst disposableDomainsWithoutMx = require(\"@fnando/email_data/data/json/disposable_domains_without_mx.json\");\nconst freeEmailDomains = require(\"@fnando/email_data/data/json/free_email_domains.json\");\nconst roles = require(\"@fnando/email_data/data/json/roles.json\");\nconst privateRelays = require(\"@fnando/email_data/data/json/private_relays.json\");\nconst tlds = require(\"@fnando/email_data/data/json/tlds.json\");\nconst slds = require(\"@fnando/email_data/data/json/slds.json\");\nconst cctlds = require(\"@fnando/email_data/data/json/country_tlds.json\");\nconst dnsbls = require(\"@fnando/email_data/data/json/dnsbls.json\");\n```\n\n## Dataset\n\nThe dataset is updated automatically. If you have any manual entries you would\nlike to add, please make a pull request against the files `data/manual/*.txt`.\n\n- `data/manual/disposable_domains.txt`: only domains from disposable servers\n  must go here.\n- `data/manual/disposable_emails.txt`: only normalized email addresses that use\n  free email services must go here. E.g. `d.i.s.p.o.s.a.b.l.e+1234@gmail.com`\n  must be added as `disposable@gmail.com`.\n- `data/manual/free_email_domains.txt`: only free email services must go here.\n- `data/manual/roles.txt`: list of role-based user names like `info` or\n  `no-reply`.\n- `data/manual/private_relays.txt`: list of private relay services, like Apple's\n  Hide My Email.\n\n## Maintainer\n\n- [Nando Vieira](https://github.com/fnando)\n\n## Contributors\n\n- https://github.com/fnando/email_data/contributors\n\n## Contributing\n\nFor more details about how to contribute, please read\nhttps://github.com/fnando/email_data/blob/main/CONTRIBUTING.md.\n\n## License\n\nThe gem is available as open source under the terms of the\n[MIT License](https://opensource.org/licenses/MIT). A copy of the license can be\nfound at https://github.com/fnando/email_data/blob/main/LICENSE.md.\n\n## Code of Conduct\n\nEveryone interacting in the email_data project's codebases, issue trackers, chat\nrooms and mailing lists is expected to follow the\n[code of conduct](https://github.com/fnando/email_data/blob/main/CODE_OF_CONDUCT.md).\n","funding_links":["https://github.com/sponsors/fnando","https://paypal.me/nandovieira/🍕"],"categories":["Ruby","Security"],"sub_categories":["Disposable emails domain list"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffnando%2Femail_data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffnando%2Femail_data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffnando%2Femail_data/lists"}