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

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

Symfony bundle to easy integrate php-imap into your Symfony application

Frequently asked questions about Mailbox Bundle
Can I install knyk/mailbox-bundle in a Laravel application?
No, not as a normal Composer package for Laravel. knyk/mailbox-bundle is a Symfony bundle that registers a PhpImap\Mailbox service through Symfony's bundle kernel and DI service definitions, and Laravel has no equivalent bundle registration or YAML/XML service loading. Installing it would also pull Symfony framework-bundle constraints that can conflict with Laravel's pinned Symfony components. Reuse the factory logic in a Laravel service provider instead.
Is knyk/mailbox-bundle a Laravel package or a Symfony bundle?
It is explicitly a Symfony bundle designed to integrate php-imap into a Symfony application. Its main job is to package mailbox configuration and register a mailbox service in Symfony's container. The reusable part for Laravel is small: a thin factory that maps host, port, flags, credentials, and attachment path onto a PhpImap\Mailbox constructor call.
How do I integrate php-imap into Laravel without using this bundle?
Depend directly on php-imap/php-imap and create a config/mailbox.php file plus a MailboxServiceProvider. Bind a MailboxManager class that lazily resolves named mailbox connections instead of registering one global singleton, and wrap access behind a repository interface such as MailboxReader::fetchNew(string $account, int $sinceUid). Consume mailboxes from queued jobs rather than HTTP request handlers to avoid timeout and duplicate-processing problems.
What Laravel alternative should I use for IMAP mailbox handling?
webklex/php-imap is the usual Laravel-native alternative and is actively maintained. It avoids the Symfony bundle impedance mismatch and provides a driver-based approach that fits Laravel's container and configuration style. The tradeoff is that you give up some direct control over the low-level PhpImap\Mailbox wrapper, but you gain ongoing maintenance you do not own.
Does knyk/mailbox-bundle support Gmail and Microsoft 365 OAuth2 or XOAUTH2?
There is no clear evidence that the bundle supports XOAUTH2 for Gmail or Microsoft 365. Its reusable surface is a configuration-to-PhpImap\Mailbox factory covering host, port, flags, credentials, and attachment path, which suggests basic authentication rather than modern OAuth flows. Several providers have disabled basic auth, so verify this before choosing it. If you need OAuth, use a driver that explicitly supports it.
Does knyk/mailbox-bundle support multiple mailbox accounts?
The bundle appears to register a mailbox instance from configuration rather than providing a full multi-account abstraction. That makes it a poor fit if your Laravel application needs several named mailbox connections. In Laravel, implement a MailboxManager that resolves named accounts lazily and keeps credentials in environment variables or an encrypted settings table, never in committed files.
What PHP version and ext-imap requirements does knyk/mailbox-bundle have?
The bundle sits on top of php-imap/php-imap, so it inherits the underlying ext-imap requirement. PHP removed ext-imap from core in PHP 8.4, so it now requires a PECL install, which affects base images, CI pipelines, and future PHP upgrades. Check the bundle's Composer constraints because it may also pin an older php-imap major version whose API differs from current releases.
Is knyk/mailbox-bundle maintained and production-ready?
At the time of evaluation it showed zero stars and zero dependents, which means no evidence of production use, no community review, and no clear signal on maintenance cadence or security posture. Licensing is MIT, so there is no legal friction, but there is also no vendor backing. Treat it as a reference implementation rather than a production dependency, and check for test coverage and recent commits.
How are attachments handled by knyk/mailbox-bundle?
The bundle's factory maps an attachment path into the PhpImap\Mailbox constructor, so attachment behavior is largely determined by php-imap rather than by the bundle itself. You need to verify whether attachments are streamed to disk or buffered in memory, because large messages can otherwise cause memory growth in queue workers. Test this against your expected attachment sizes before relying on it.
Can I reuse knyk/mailbox-bundle code in a Laravel service provider?
Yes, the MIT license permits vendoring the useful factory logic with attribution. The practical path is to extract the configuration schema and mailbox factory, then reimplement them idiomatically as a Laravel config array, service provider, and manager class. Do not install the bundle itself, and keep the underlying driver behind an interface so you can swap from php-imap to a pure-PHP or Laravel-native IMAP driver later.
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.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect