- Is ddeboer/imap a Laravel package?
- No. ddeboer/imap is a framework-agnostic, object-oriented IMAP client: it ships no service provider, no publishable config, and no facade. In Laravel you wire it yourself, typically by binding a configured Server factory as a singleton and injecting it into queued jobs. That extra wiring is a small cost and keeps the library out of your controllers and domain models.
- How do I install ddeboer/imap with Composer?
- Install it with composer require ddeboer/imap; the package requires PHP 8.x and a modern Composer version. Version 2 no longer depends on ext-imap, so no PECL build step is added to your container image. Check the released Composer constraint against your application's PHP floor before upgrading.
- Does ddeboer/imap work with Gmail and Microsoft 365 mailboxes?
- It can connect to any IMAP server, but authentication is the deciding factor. Microsoft 365 has disabled basic auth for IMAP and Google requires app passwords or OAuth2/XOAUTH2, so confirm the version you install supports XOAUTH2 before committing. If it does not, that is a blocker for most business mailboxes and you should evaluate an inbound-email provider instead.
- Does ddeboer/imap still require the PHP ext-imap extension?
- No, version 2 dropped the dependency on ext-imap, which is unbundled and deprecated in current PHP releases. That removes a PECL install from your container and a recurring upgrade hazard. Note that any other package in the same image still using ext-imap will keep that dependency alive regardless.
- How do I fetch, search, and flag messages with ddeboer/imap?
- The API follows a small domain model of Server, Mailbox, Message, and Part or Attachment objects. You connect to a Server, select a Mailbox, run search criteria, then read message headers, bodies, and attachments as objects. The same model exposes move, copy, delete, and flag operations, plus mailbox listing, creation, renaming, and deletion.
- How do I store attachments from ddeboer/imap in Laravel?
- Read one message at a time and stream each attachment part straight to S3 through Flysystem rather than buffering whole messages in memory. Map the library's Part and Attachment objects into your own DTOs or models so persistence logic stays independent of the package. Expect MIME edge cases in production, including malformed headers, undeclared charsets, RFC 2231 filenames, and winmail.dat.
- How do I poll an IMAP mailbox reliably in a Laravel queue job?
- Track a UID watermark using UIDVALIDITY and UIDNEXT, never sequence numbers, and deduplicate on Message-ID so retries stay idempotent. Build an explicit error taxonomy around connection failures, throttling, and malformed messages, and make processing safe to re-run. Budget one to two weeks for a production-grade poller; the library integration itself is only a day or two of work.
- Can ddeboer/imap send email through SMTP?
- Yes, it includes optional SMTP support so you can compose and send messages through a separate transport. In a Laravel application you will usually prefer the framework's built-in mailer, which already handles drivers, templates, and testing fakes. Treat the SMTP feature as a convenience for standalone PHP usage rather than a replacement for Laravel's mail layer.
- What are the alternatives to ddeboer/imap in Laravel?
- webklex/laravel-imap is the common Laravel-specific option, and inbound-email providers such as Postmark, Mailgun, or SES inbound are usually cheaper and less brittle for greenfield inbound mail. Adopt ddeboer/imap behind an internal MailboxReader interface so the dependency stays swappable. When migrating from webklex, implement the interface against ddeboer/imap, run both in shadow mode against a test mailbox, diff the parsed output, then cut over per mailbox.
- Is ddeboer/imap actively maintained and safe to depend on?
- It is a solid but niche library with a small contributor base and effectively single-maintainer risk. The MIT license makes forking viable, so treat that as your mitigation rather than a reason to avoid it. Pin the version, keep the wrapper thin, and watch for releases affecting PHP compatibility and authentication support.