- How do I install ImapEngine for Laravel?
- Run composer require directorytree/imapengine-laravel. The service provider is auto-discovered, so you can publish the config with php artisan vendor:publish and add your host, port, username, and password values to .env. The package requires PHP 8.1+, Laravel 10 through 13, and imapengine core v1.19 or newer. A basic single-mailbox demo is usually a one-day proof of concept.
- Does ImapEngine for Laravel require the PHP IMAP extension?
- No. It is a pure PHP implementation built on the ImapEngine core library, so ext-imap does not need to be installed. That matters in slim container images and on managed hosts where the extension is missing or awkward to enable. You still need outbound network access to the mail server on the relevant IMAP port.
- Which Laravel and PHP versions does this package support?
- The package targets PHP 8.1+ and Laravel 10 through 13; Laravel 13 support was added in v1.2.1. It also depends on the imapengine core library at v1.19 or newer. Check the Composer constraints and pin versions in your lockfile before rolling out.
- How do I configure multiple IMAP accounts?
- Use the publishable config file to define several connections, each with its own host, port, username, and password or environment variables. You can then resolve a named account through the facade or Laravel's container and keep the connections side by side in one application. Keep credentials out of source control and scope them per mailbox in your secret store.
- Does ImapEngine for Laravel support OAuth2 for Gmail and Microsoft 365?
- The documentation provided describes host, port, username, and password configuration; OAuth flows, token refresh, and expiry handling are not evidenced. That is a critical gap because Microsoft has retired basic-auth IMAP for Exchange Online and Gmail expects OAuth or app passwords. Confirm the auth path for your target mailboxes in week one before committing.
- How do I watch a mailbox for new messages in Laravel?
- Run php artisan imap:watch --method=idle as a long-running process or scheduled poller. The package emits events such as MailboxSynced, MessageReceived (added in v1.3.0), and MailboxWatchAttemptsExceeded, which fits a watch to event to queued job pattern. You are responsible for supervising the process, so plan for a daemon or scheduler from day one.
- How should I test an ImapEngine Laravel integration?
- Real-time IDLE and reconnect behavior need a containerized IMAP server such as Dovecot or GreenMail, or carefully scoped mocks. Plain unit tests will not cover protocol edge cases, provider quirks, or MIME parsing depth. Budget test infrastructure early rather than assuming existing unit test patterns will be enough.
- Can I use ImapEngine for Laravel in serverless or short-lived requests?
- It is a poor fit for serverless or short-lived request lifecycles because mailbox watching assumes a process that stays alive or a scheduled poller. You would own the supervisor or daemon and the reconnect logic. For request-driven sending or occasional fetching, keep the watch pattern out of the request path.
- Does the package handle retries, reconnects, and duplicate message processing?
- The available information shows a MailboxWatchAttemptsExceeded event but no built-in retry, backoff, connection budgeting, or idempotency. IMAP connections drop and providers throttle, so reliability engineering stays with your application. Define a dedupe key such as Message-ID, UID, or UIDVALIDITY to prevent product-visible duplicate processing.
- Is ImapEngine for Laravel production-ready and what is the maintenance risk?
- It is a young package with roughly 38 stars and no dependents, so external production validation is thin and you will be an early adopter. The maintainer, DirectoryTree, is an established Laravel vendor with LdapRecord lineage, which offsets some bus-factor risk. The license is MIT, distribution is Composer-only, and pinning versions with fork rights is adequate supply-chain cover.