leancaptain/lara-email
LeanCaptain Lara Email is a Laravel package that simplifies working with email in your application, offering a lightweight, configurable layer over Laravel's mailer for composing and sending messages with Blade templates and your existing mail drivers.
Architecture fit: Lara Email v0.1.0 is a Laravel-native validation rule intended to sit alongside Laravel’s built-in email rule. It fits cleanly into form requests, validators, and API request validation where the goal is lightweight domain hygiene: blocking reserved example domains, bundled disposable domains and their subdomains, normalizing case/IDN input, and requiring a usable MX record. It does not provide mailbox verification, ownership checks, or deliverability guarantees, so it should be treated as a validation aid rather than an email verification service.
Integration feasibility: Integration is low-friction: composer require leancaptain/lara-email, then add new UsableEmailDomain to the existing email validation chain. No service provider or configuration publishing is required, which reduces setup overhead. The main feasibility constraints are the hard requirements on PHP 8.4/8.5, Laravel / Illuminate Validation 13, and DNS lookup support in the runtime environment.
Technical risk: The package is at v0.1.0, so maturity and long-term support risk should be treated as elevated until usage history and release cadence are established. DNS is now in the request validation path: latency, resolver availability, timeout behavior, and DNS egress policy become product reliability concerns. The rule requires an MX record for the exact email domain and rejects missing/null MX records, which is sensible for null MX but can create false negatives for domains that rely on A/AAAA fallback for mail delivery. The disposable-domain snapshot is useful but will go stale without an update process. Optional caching only covers successful MX checks, bounded by DNS TTL and capped at five minutes; failed checks are never cached, so repeated invalid submissions can repeatedly trigger DNS lookups. The package also does not verify mailbox existence or ownership, which must be explicit in product expectations.
Key questions: Which Laravel/PHP versions are actually supported beyond the stated minimums? What DNS resolver and timeout settings are used, and can they be configured? Does the MX check follow CNAMEs and handle multiple MX records? Does it intentionally reject A/AAAA fallback domains, or is that a future option? How is IDN normalization implemented, including punycode handling? What cache store is used for successful MX checks, and is it shared across processes? How often is the disposable-domain snapshot updated, and what is the process for custom allow/block lists? What validation message is returned on DNS timeout vs. missing MX vs. disposable domain? What is the package license and test coverage? How does it behave under DNS SERVFAIL, resolver outage, or high-volume abuse?
Stack fit: Good fit for greenfield or recently upgraded Laravel 13 applications on PHP 8.4/8.5 with outbound DNS available. Poor fit for older Laravel/PHP stacks without an upgrade, or for environments where synchronous DNS lookups during validation are unacceptable. The rule composes naturally after bail, required, string, and email, e.g. ['bail', 'required', 'string', 'email', new UsableEmailDomain].
Migration path: There is no prior package state to migrate from. Treat v0.1.0 as a pilot: install in a non-production or low-risk environment, attach the rule to a single high-value form such as signup or lead capture, log validation outcomes and DNS latency, then expand after measuring false positives, DNS failure rates, and support impact. Keep the existing email rule in place; this package is additive.
Compatibility: The stated requirements are narrow: PHP 8.4/8.5, Laravel / Illuminate Validation 13, and DNS lookup support. Confirm the application’s composer constraints, runtime DNS egress, resolver configuration, and any IDN/intl extension assumptions before adoption. Because there is no configuration publishing, custom disposable lists or resolver tuning may require wrapping the rule, forking, or upstream feature requests.
Sequencing: First confirm stack and DNS readiness. Second install the package and add the rule to a single non-critical form with logging. Third measure DNS lookup latency, timeout behavior, rejection reasons, and user-facing error messages. Fourth decide whether the MX-only policy creates unacceptable false negatives for your audience. Fifth roll out to higher-risk forms only after establishing monitoring, rate limiting, and a process for updating the disposable-domain snapshot. Finally document that this rule does not verify mailbox existence or ownership.
Maintenance: The code footprint is small and there is no service provider or config to maintain, which keeps operational overhead low. However, the package is v0.1.0 and depends on an upstream disposable-domain snapshot, so release monitoring and periodic dependency review are required. Custom allowlists or blocklists are not exposed via configuration, which may become a maintenance burden if product needs diverge from the bundled list.
Support: Support teams will need clear guidance that the rule blocks example/disposable domains and requires MX records, but does not confirm that a mailbox exists. DNS-related validation failures can be confusing to end users and support agents, especially if the retry message appears during resolver outages. Establish a runbook for “valid user rejected” cases covering disposable list false positives, missing MX, null MX, and DNS timeout/SERVFAIL scenarios.
Scaling: Validation now performs synchronous DNS work on cache misses. Successful MX checks are cached only up to DNS TTL and capped at five minutes; failed checks are never cached. That means invalid or mistyped domains can generate repeated DNS lookups, and bulk or abusive submissions can amplify resolver load. At scale, plan for local DNS caching, rate limiting, monitoring of lookup latency and failure rates, and possibly asynchronous or deferred validation for non-critical flows. The package is not a substitute for email verification or deliverability tooling.
Failure modes: DNS timeout or resolver outage can block legitimate users if validation fails closed. Missing/null MX rejection is intentional, but rejecting domains that rely on A/AAAA fallback may create false negatives. The bundled disposable-domain snapshot can become stale, allowing newly disposable domains through or causing false positives if upstream data is wrong. IDN/case normalization reduces common issues but needs validation against real international domains. Failed checks not being cached increases repeated lookup risk. Most importantly, the rule does not verify mailbox existence, ownership, or catch-all behavior, so product and support expectations must be set accordingly.
Ramp-up: Developer ramp-up is low because usage is a single validation rule and installation is one composer command. TPM and operations ramp-up is moderate: stakeholders need to understand DNS dependency, MX vs. A/AAAA fallback behavior, caching limits, disposable-list freshness, and the boundary between domain validation and mailbox verification. A short pilot with logging and a documented rollback path is appropriate before broad adoption.
How can I help you explore Laravel packages today?