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

Mailbox Bundle Laravel Package

knyk/mailbox-bundle

knyk/mailbox-bundle is a Symfony bundle for PHP applications that packages mailbox-related configuration and services, helping you integrate mailbox handling with less boilerplate. It keeps mailbox setup organized and makes email workflow code easier to maintain.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This is a Symfony bundle, not a Laravel package — an important distinction for a Laravel/PHP stack. knyk/mailbox-bundle exists to register a PhpImap\Mailbox instance in the Symfony DI container via a Bundle class plus service definitions. Laravel has no bundle kernel, no Bundle::class registration, and no XML/YAML service-definition loading, so the artifact cannot be installed and used as-is. The genuinely reusable surface is small: a thin factory that maps configuration keys (host, port, flags, credentials, attachment path) onto a PhpImap\Mailbox constructor call. That is roughly a day of work to reimplement idiomatically in a Laravel service provider.

Integration feasibility. Two viable paths. (1) Treat the bundle as a reference implementation, depend directly on php-imap/php-imap, and expose mailboxes through Laravel's container. (2) Evaluate webklex/php-imap, which is Laravel-native, actively maintained, driver-based, and avoids the Symfony-bundle impedance mismatch entirely. Path 1 is low-effort and gives full control; path 2 trades a small amount of control for ongoing maintenance that we do not own. Either is feasible within a single sprint; the bundle itself is not a deliverable.

Technical risk. Elevated, and not primarily because of the package's code. Score 0 with 0 stars and 0 dependents means no evidence of production use, no community review, and no signal on maintenance cadence or security posture. More consequentially, the underlying dependency chain rests on PHP's ext-imap, which was removed from core in PHP 8.4 and now requires a PECL install — an infrastructure constraint that affects base images, CI, and any future PHP upgrade. IMAP itself is a stateful, chatty, timeout-prone protocol; long-lived mailbox handles in a queue worker are a well-known source of stuck processes, memory growth, and duplicate processing. Licensing is MIT, so there is no legal friction, but also no vendor backing.

Key questions. Is the bundle maintained, and what PHP/Symfony versions does it pin? Does it support XOAUTH2 for Gmail and Microsoft 365, or only basic auth (which several providers have now disabled)? How are attachments handled — streamed to disk or buffered in memory? Does it expose UID/Message-ID for idempotent processing? What are the TLS verification defaults? Is there multi-account support, or one global mailbox? Is there any test coverage at all? And critically: is ext-imap available and supportable in our target runtime, or do we need a pure-PHP IMAP driver instead?

Integration Approach

Stack fit. Assume Laravel 10/11 on PHP 8.2/8.3 with ext-imap compiled in. The bundle's three useful files — the factory, the config schema, and the service definition — map cleanly onto a config/mailbox.php array, a MailboxServiceProvider, and a MailboxManager class that lazily resolves named connections. Do not install the bundle itself; it will pull symfony/framework-bundle constraints that conflict with Laravel's pinned Symfony components.

Migration path. Start by vendoring the bundle's factory logic as a starting point (MIT permits this, with attribution), then bind PhpImap\Mailbox through a manager rather than a single global singleton, so multiple accounts can coexist. Credentials go through config() sourced from environment or, better, an encrypted settings table — never committed. Wrap mailbox access behind a repository interface (MailboxReader::fetchNew(string $account, int $sinceUid)) so the underlying driver can be swapped later without touching call sites. Consume mailboxes from queued jobs, not from HTTP request handlers.

Compatibility. The main incompatibility is structural, not version-related: no bundle registration, no ContainerAwareInterface, no YAML/XML service loading, no Symfony console commands. Configuration semantics translate easily; the service wiring does not. Watch for the bundle pinning an old php-imap/php-imap major version whose API differs from current releases (constructor signature and exception types have changed across majors). Verify PHP version constraints before assuming the code compiles on our runtime.

Sequencing. (1) Spike branch: confirm ext-imap presence in the Docker base image and CI matrix. (2) Port the factory into a service provider; prove a single-account fetch against a throwaway mailbox. (3) Introduce the manager/repository abstraction and a queued fetch job with a sinceUid cursor. (4) Harden: timeouts, retry/backoff, idempotency on Message-ID, attachment streaming to object storage. (5) Add observability — per-account fetch counts, auth failures, connection durations. (6) Roll out account-by-account behind a feature flag.

Operational Impact

Maintenance. We own this code from day one. Upstream has no apparent activity and no dependent base, so plan to fork the small amount we vendor and treat it as internal. Set a calendar review to reassess the IMAP driver choice — ext-imap's removal from PHP core means the foundation is moving, and a pure-PHP driver may become mandatory rather than optional at the next PHP upgrade.

Support. No vendor, no community, no security advisories to subscribe to. Support burden falls on whoever on the team develops IMAP literacy — and provider-specific quirks (Gmail label semantics, Microsoft 365 throttling and OAuth token refresh) are where the real time goes, not in the code. Budget for that knowledge residing in one or two people, with a written runbook.

Scaling. IMAP is connection-bound, not request-bound. Gmail caps simultaneous connections per account (roughly 15) and Microsoft throttles aggressively, so horizontal scaling has to happen by sharding mailboxes across workers, not by adding workers to one mailbox. Use a supervised worker per account or a small pool with strict concurrency limits. Large attachments are the memory risk — stream to disk or object storage and never hold a full message body plus attachments in a request-scoped process.

Failure modes. Absent ext-imap the application fails at boot, which is at least loud. More insidious: connection drops mid-fetch causing duplicate or skipped messages (mitigate with a persisted UID cursor plus Message-ID deduplication); OAuth token expiry surfacing as generic auth errors; TLS/certificate mismatches on internal relays; worker processes hanging on socket timeouts and silently consuming queue capacity; UTF-7 folder names and charset decoding producing mojibake in stored bodies. Each needs an explicit alert, not just a log line.

Ramp-up. The wrapper is a half-day read. The operational competency — idempotent fetching, connection lifecycle, provider throttling, attachment handling — is one to two sprints including hardening and dashboards. Treat the 0-star score as a signal to spend the effort on the wrapper and the observability rather than on evaluating the package, and make the driver abstraction the first thing built so the ext-imap question stays a reversible decision.

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.
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
noith/settings
kda/laravel-package