{"id":18103174,"url":"https://github.com/rameerez/nondisposable","last_synced_at":"2026-01-17T22:25:46.545Z","repository":{"id":260391766,"uuid":"862668004","full_name":"rameerez/nondisposable","owner":"rameerez","description":"🗑️ Block disposable emails in your Rails app","archived":false,"fork":false,"pushed_at":"2026-01-17T01:51:17.000Z","size":76,"stargazers_count":68,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-17T06:09:28.404Z","etag":null,"topics":["address-validation","devise","disposable","disposable-email","email","fraud","moderation","rails","ruby","ruby-gem","ruby-on-rails","signup","spam","user-management"],"latest_commit_sha":null,"homepage":"","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/rameerez.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2024-09-25T01:45:29.000Z","updated_at":"2026-01-17T01:51:21.000Z","dependencies_parsed_at":"2024-10-31T03:49:47.960Z","dependency_job_id":"59711b7f-a199-4cb7-99b0-9473282f4c35","html_url":"https://github.com/rameerez/nondisposable","commit_stats":null,"previous_names":["rameerez/nondisposable"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/rameerez/nondisposable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rameerez%2Fnondisposable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rameerez%2Fnondisposable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rameerez%2Fnondisposable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rameerez%2Fnondisposable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rameerez","download_url":"https://codeload.github.com/rameerez/nondisposable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rameerez%2Fnondisposable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28520402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T22:11:28.393Z","status":"ssl_error","status_checked_at":"2026-01-17T22:11:27.841Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["address-validation","devise","disposable","disposable-email","email","fraud","moderation","rails","ruby","ruby-gem","ruby-on-rails","signup","spam","user-management"],"created_at":"2024-10-31T22:10:47.003Z","updated_at":"2026-01-17T22:25:46.539Z","avatar_url":"https://github.com/rameerez.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🗑️ `nondisposable` - Block disposable email addresses from signing up to your Rails app\n\n[![Gem Version](https://badge.fury.io/rb/nondisposable.svg)](https://badge.fury.io/rb/nondisposable) [![Build Status](https://github.com/rameerez/nondisposable/workflows/Tests/badge.svg)](https://github.com/rameerez/nondisposable/actions)\n\n\u003e [!TIP]\n\u003e **🚀 Ship your next Rails app 10x faster!** I've built **[RailsFast](https://railsfast.com/?ref=nondisposable)**, a production-ready Rails boilerplate template that comes with everything you need to launch a software business in days, not weeks. Go [check it out](https://railsfast.com/?ref=nondisposable)!\n\n`nondisposable` is a Ruby gem that prevents users from signing up to your Rails app with disposable email addresses.\n\nSimply add to your User model:\n\n```ruby\nvalidates :email, nondisposable: true\n```\n\nThat's it! You're done.\n\nThe gem also provides a job you can run daily to keep your disposable domain list up to date.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'nondisposable'\n```\n\nAnd then execute:\n\n```bash\nbundle install\n```\n\nAfter installing the gem, run the installation generator:\n\n```bash\nrails generate nondisposable:install\n```\n\nThis will create the necessary migration file, initializer, and a job for scheduled updates. Run the migration:\n\n```bash\nrails db:migrate\n```\n\nFinally, populate the initial list of disposable domains:\n\n```ruby\nNondisposable::DomainListUpdater.update\n```\n\n## Usage\n\nTo use `nondisposable` in your models, simply add the validation:\n\n```ruby\nclass User \u003c ApplicationRecord\n  validates :email, nondisposable: true\nend\n```\n\nYou can customize the error message:\n```ruby\nclass User \u003c ApplicationRecord\n  validates :email, nondisposable: { message: \"is a disposable email address, please use a permanent email address.\" }\nend\n```\n\nThe validation works seamlessly with other Rails validations:\n```ruby\nclass User \u003c ApplicationRecord\n  validates :email,\n            presence: true,\n            format: { with: URI::MailTo::EMAIL_REGEXP },\n            nondisposable: true\nend\n```\n\nIf you're validating a different attribute name:\n```ruby\nclass User \u003c ApplicationRecord\n  validates :backup_email, nondisposable: true\nend\n```\n\n### Configuration\n\nYou can customize the gem's behavior by creating an initializer:\n\n```ruby\n# config/initializers/nondisposable.rb\n\nNondisposable.configure do |config|\n  config.error_message = \"provider is not allowed. Please use a non-disposable email address.\"\n  config.additional_domains = ['custom-disposable-domain.com']\n  config.excluded_domains = ['false-positive-domain.com']\nend\n```\n\n### Direct Check\n\nYou can also check if an email is disposable directly:\n\n```ruby\nNondisposable.disposable?('user@example.com') # =\u003e false\nNondisposable.disposable?('user@disposable-email.com') # =\u003e true\n```\n\n## Updating disposable domains\n\nTo manually update the list of disposable domains, run:\n\n```ruby\nNondisposable::DomainListUpdater.update\n```\n\nIt's important you keep your disposable domain list up to date. `nondisposable` will read from the latest version of the [`disposable-email-domains`](https://github.com/disposable-email-domains/disposable-email-domains) list, which is typically updated every few days.\n\nFor this, `nondisposable` provides you with an Active Job (`DisposableEmailDomainListUpdateJob`) that you can use to schedule daily updates. How you do that, exactly, depends on the queueing system you're using.\n\nIf you're using `solid_queue` (the Rails 8 default), you can easily add it to your schedule in the `config/recurring.yml` file like this:\n```yaml\nproduction:\n  refresh_disposable_domains:\n    class: DisposableEmailDomainListUpdateJob\n    queue: default\n    schedule: every day at 3am US/Pacific\n```\n\n## Troubleshooting\n\n### SSL certificate verify failed (unable to get certificate CRL)\n\nIf you see this error when running `Nondisposable::DomainListUpdater.update`:\n\n```\nSSL_connect returned=1 errno=0 peeraddr=[::1]:10011 state=error: certificate verify failed (unable to get certificate CRL) (OpenSSL::SSL::SSLError)\n```\n\nThis is **not** a bug in `nondisposable`. It's a known incompatibility between OpenSSL 3.6.0 and older versions of Ruby's `openssl` gem (3.3.0 and earlier).\n\nThe fix is to update the `openssl` gem to version 3.3.1 or later **in your Rails project**.\n\nAdd this to your Rails' project `Gemfile`:\n\n```ruby\ngem \"openssl\", \"~\u003e 3.3.2\"\n```\n\nThen run:\n\n```bash\nbundle install\n```\n\nThis issue is unlikely to occur in production, it's mostly a development-only issue. It's likely that the exact same codebase fails in development but works fine in production. It only occurs when you have OpenSSL 3.6.0 system-wide AND something intercepting HTTPS traffic (like Cursor's proxy). Users in production or using a regular terminal won't experience it.\n\nThis issue is more likely to occur if you're running your Rails console from within certain IDEs (like Cursor) that intercept HTTPS traffic through a local proxy. The updated `openssl` gem properly handles certificate verification in these environments.\n\nFor more details, see the [Ruby openssl gem issue](https://github.com/ruby/openssl/issues/949).\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/rameerez/nondisposable. Our code of conduct is: just be nice and make your mom proud of what you do and post online.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frameerez%2Fnondisposable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frameerez%2Fnondisposable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frameerez%2Fnondisposable/lists"}