Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Disposable Email

Laravel Disposable Email Laravel Package

propaganistas/laravel-disposable-email

Laravel validator that rejects disposable email addresses from services like Mailinator and Guerillamail. Ships with a built-in blacklist (auto-updated weekly), a config file, the indisposable rule, and an optional command to refresh domains yourself.

View on GitHub
Deep Wiki
Context7

Laravel Disposable Email adds an indisposable validator to Laravel so you can reject signups from throwaway mail services like Mailinator or Guerillamail. It ships with the disposable/disposable blacklist and includes optional MX record inspection to catch rotating front domains.

'field' => ['email', 'indisposable'],
  • Weekly patch releases keep the built-in domains list current
  • disposable:update command for scheduling your own refreshes
  • Publishable config file for customisation
  • Translatable validation message
  • Auto-discovered service provider, zero setup
Frequently asked questions about Laravel Disposable Email
How do I install and use the indisposable validation rule in Laravel?
Run composer require propaganistas/laravel-disposable-email; the service provider is auto-discovered so no manual registration is needed. Optionally run php artisan vendor:publish --tag=laravel-disposable-email to adapt the config and add a language line for the validation message. Then append the rule after email, for example 'field' => ['email', 'indisposable'], in a FormRequest, $request->validate(), or Validator::make() call.
Which Laravel versions does propaganistas/laravel-disposable-email support?
Support is gated by Laravel and PHP tiers: 2.2.x targets Laravel 8 and 9 with PHP 8.0, 2.3.0 and above require Laravel 11 and drop Laravel 8/9 and PHP 8.0, 2.4.11 and above support Laravel 12, and 2.4.25 and above support Laravel 13. Teams on long-lived older branches cannot take domain list updates without a framework upgrade, so pin your constraint deliberately.
How do I keep the disposable email domain list up to date?
Domain list updates are not automatic: they ship as weekly patch releases that you must bump in your composer constraint. Alternatively run or schedule the disposable:update command, for example Schedule::command('disposable:update')->daily() in routes/console.php. Any expectation of zero maintenance is overstated, so plan an update routine either way.
What happens if the disposable domains list fetch or cache warm fails?
The rule fails open. If the remote fetch or cache warm fails you end up with a stale or empty list, which means validation passes and disposable addresses slip through. That is a deliberate policy choice rather than a bug, but you should select it explicitly and monitor update success in production.
Can I use a custom domain list or my own fetcher class?
Yes. Since 2.2.12 you can configure multiple source lists, and you can also supply your own custom lists in the config. The disposable-email.fetcher option lets you swap in a custom fetcher class, which is the escape hatch for proxies, mTLS egress, or replacing file_get_contents with an allowlisted HTTP client in locked-down environments.
Is there a Rule::disposableEmail() helper or a rule called disposable?
No. The rule name and its translation key are both indisposable, so you use the string 'indisposable' in your rules array, not disposable or Rule::disposableEmail(). Add it after the email rule so malformed addresses are rejected first. If you need a graded risk signal instead of binary rejection, this package is only one input.
Does the rule detect subdomains and normalize uppercase email addresses?
Since 2.0.7 the rule lowercases the address before matching, and since 2.4.0 it also matches subdomains, so [email protected] is caught alongside mailinator.com. No other normalization is performed. It does not do MX record inspection, SMTP verification, or risk scoring.
How do I test the indisposable validator in my Laravel test suite?
Because it is a standard Laravel validation rule, you can assert it with normal validation tests, for example Validator::make(['email' => '[email protected]'], ['email' => 'email|indisposable'])->fails(). Keep CI offline by pointing the config at a custom list or custom fetcher instead of hitting the network. Budget roughly half a day for the first surface including tests.
Does this package do MX record or SMTP verification?
No. It answers exactly one question: is this domain on a blacklist. It performs no MX record inspection, no SMTP handshake, and no risk scoring or reputation lookup. Treat the result as a single signal in your email quality strategy rather than a complete defence.
Which cache store should I use in production for the disposable domains list?
Use a shared store such as Redis or Memcached rather than a per-node file cache, so every node sees the same list, and confirm which store is authoritative. Be aware the cache path has historically been the fragile part of the package, evidenced by a unserialize bug with Redis caching fixed in 2.1.16. Monitor cache warm failures, since a failed warm silently means validation passes.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource