redberry/mailbox-for-laravel
Redberry Mailbox for Laravel adds inbound email handling to your app. Receive messages via webhook drivers, store them with Eloquent models, manage attachments and addresses, and process incoming mail using familiar Laravel conventions.
Architecture fit
MailboxTransport → MessageNormalizer → CaptureService → MessageStore, with CaptureService as the single storage entry point and all bindings centralized in MailboxServiceProvider. That is a clean, testable architecture and a good citizen in a Laravel codebase.public/vendor/mailbox/), which minimizes collision with the host app's frontend. This is the right trade-off for a package that must not interfere with the host.Mail::fake() does not provide. That is a genuine gap-filler for teams that currently assert on raw Mailable state or spin up Mailpit.Integration feasibility
composer require, run mailbox:install (publishes config/assets, runs migrations), define the viewMailbox gate, and point the mailbox transport at non-production environments.uses(InteractsWithMailbox::class) plus Mailbox::assertSentTo() / firstSent()->assertSeeInHtml().MessageStore + AttachmentStore pairs and config resolvers make custom backends feasible without forking, provided both halves are implemented.Technical risk
mailbox:upgrade (v1 → v2 config/env rewriter) confirms breaking changes have occurred. Pin versions and budget for upgrade work.mailbox transport is left enabled in production, outgoing mail is captured instead of delivered — a silent mail blackhole. This must be environment-gated and reviewed.viewMailbox gate exposes an inbox; retention is manual (mailbox:clear --outdated).Key questions
Mail::fake(), queued mail, and multi-tenant mailers?MessageStore/AttachmentStore drivers a supported extension point with a stability guarantee?mailbox:upgrade actually absorb?Stack fit
Mail::fake(): use fakes for dispatch/branching assertions and Mailbox for rendered-content and attachment assertions.local, testing, and optionally staging; never in production.Migration path
Mail::fake() assertions should port assertion-by-assertion, starting with subject/recipient checks and moving to rendered HTML/attachment assertions.mailbox:upgrade in a branch and diff the resulting config/env before merging.Compatibility
declare(strict_types=1), readonly properties, and constructor promotion, implying a modern PHP floor.cid: images (CidRewriter path) — these are the likely edge cases.Sequencing
local, validate the dashboard and one rendered-HTML assertion.InteractsWithMailbox to a single test suite, prove parity with existing assertions, measure CI runtime and storage growth.viewMailbox gate definition, retention policy, .gitignore for the SQLite/attachment paths.composer.json.Maintenance
composer update, republishing assets after upgrades, and pruning stored mail.Support
Scaling
mailbox:clear --outdated) and monitor disk usage on any shared/staging deployment.Failure modes
viewMailbox gate exposes captured PII.Ramp-up
assertSentTo, firstSent()->assertSeeInHtml(), assertHasAttachment()) is discoverable and reads well in Pest tests.How can I help you explore Laravel packages today?