directorytree/imapengine
IMAPEngine is a Laravel-friendly PHP package for working with IMAP mailboxes. Connect to servers, list folders, fetch messages and attachments, search and manage mail, and handle common IMAP operations through a clean, high-level API.
Strengths:
illuminate/collections and symfony/mime for seamless integration, reducing boilerplate code.BackedEnum), PHPStan compliance, and RFC822 adherence ensure maintainability and reliability.Gaps:
idle() and polling exist, they lack native Laravel queue integration, which could complicate real-time email processing.Laravel Compatibility:
SwiftMailer for IMAP-based email ingestion (e.g., parsing inbound emails into Eloquent models).Non-Laravel Dependencies:
symfony/mime, nesbot/carbon, and zbateson/mail-mime-parser, which are compatible with Laravel but may require version alignment in composer.json.spatie/ray or Laravel Debugbar).idle() and polling are supported, they lack native Laravel queue integration, which could lead to race conditions or inconsistent state in distributed systems.idle() or polling be integrated with Laravel’s queue system?Laravel Ecosystem:
illuminate/collections and symfony/mime natively. It can be seamlessly integrated into Laravel services, controllers, or jobs.Storage facade) to handle attachment storage (e.g., S3, local disk).EmailFetched, EmailProcessed) to decouple email handling from business logic.| Component | Laravel Integration | Notes |
|---|---|---|
| ImapEngine | Service class injected via IoC | Wrap in a Laravel service for config. |
| Queue | Laravel Queues (Redis/Database) | Process emails async (e.g., polling). |
| Storage | Laravel Filesystem (S3, local) | Save attachments. |
| Events | Laravel Events + Listeners | Decouple email processing. |
| Caching | Redis/Memcached | Cache connection states or metadata. |
Non-Laravel Considerations:
symfony/mime, carbon).Phased Adoption:
SwiftMailer, custom IMAP scripts) with ImapEngine.Backward Compatibility:
ext-imap, design adapters to translate between old and new APIs during the transition.symfony/mime).symfony/mime, carbon, or zbateson/mail-mime-parser in composer.json.platform-check or platform-repo in composer.json to enforce version constraints.composer require directorytree/imapengine).How can I help you explore Laravel packages today?