PHPackages                             thefox/imapd - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. thefox/imapd

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

thefox/imapd
============

IMAP server (library) written in pure PHP.

v0.5.0(8y ago)5349514[3 issues](https://github.com/TheFox/imapd/issues)1GPL-3.0PHPPHP ^7.0CI failing

Since Aug 1Pushed 6y ago3 watchersCompare

[ Source](https://github.com/TheFox/imapd)[ Packagist](https://packagist.org/packages/thefox/imapd)[ Docs](https://fox21.at)[ RSS](/packages/thefox-imapd/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (13)Versions (11)Used By (1)

IMAPd
=====

[](#imapd)

IMAP server (library) to serve emails to an email client, written in pure PHP.

The `d` in `SMTPd` stands for [Daemon](https://en.wikipedia.org/wiki/Daemon_(computing)). This script can run in background like any other daemon process. It's not meant for running as a webapplication.

Why this project?
-----------------

[](#why-this-project)

Believe it or not, **email is still the killer feature of the Internet**. There are tons of projects for accessing and fetching emails from an IMAP/POP3 server. But there are not so many providing a programmatically interface to serve emails to an email client.

With this interface you can do something like this for your app users:

```
+--------------+     +-------+     +------------------------+     +------+
| Your PHP App +---> | IMAPd +---> | MUA (like Thunderbird) +---> | User |
+--------------+     +-------+     +------------------------+     +------+

```

This is useful when you have a messaging application written in PHP but no graphical user interface for it. So your graphical user interface can be any [email client](http://en.wikipedia.org/wiki/Email_client). [Thunderbird](https://www.mozilla.org/en-US/thunderbird/) for instance.

Project Outlines
----------------

[](#project-outlines)

The project outlines as described in my blog post about [Open Source Software Collaboration](https://blog.fox21.at/2019/02/21/open-source-software-collaboration.html).

- The main purpose of this software is to provide a server-side IMAP API for PHP scripts.
- Although the RFC implementations are not completed yet, they must be strict.
- More features can be possible in the future. In perspective of the protocols the features must be a RFC implementation.
- This list is open. Feel free to request features.

Planned Features
----------------

[](#planned-features)

- Full RFC 3501 Implementation.
- Replace `Zend\Mail` with a better solution.

Installation
------------

[](#installation)

The preferred method of installation is via [Packagist](https://packagist.org/packages/thefox/imapd) and [Composer](https://getcomposer.org/). Run the following command to install the package and add it as a requirement to composer.json:

```
composer require thefox/imapd
```

Usage
-----

[](#usage)

See [`example.php`](example.php) file for more information.

RFC 3501 Implementation
-----------------------

[](#rfc-3501-implementation)

### Complete implementation

[](#complete-implementation)

- 6.1.2 NOOP Command
- 6.1.3 LOGOUT Command
- 6.4.1 CHECK Command
- 6.4.7 COPY Command
- 7.1.1 OK Response
- 7.1.2 NO Response
- 7.1.3 BAD Response
- 7.1.5 BYE Response
- 7.4.1 EXPUNGE Response

### Incomplete implemention

[](#incomplete-implemention)

- 2.3.1.1 Unique Identifier (UID) Message Attribute
- 2.3.1.2 Message Sequence Number Message Attribute
- 2.3.2 Flags Message Attribute
- 6.1.1 CAPABILITY Command
- 6.2.2 AUTHENTICATE Command
- 6.2.3 LOGIN Command
- 6.3.1 SELECT Command
- 6.3.6 SUBSCRIBE Command
- 6.3.7 UNSUBSCRIBE Command
- 6.3.8 LIST Command
- 6.3.9 LSUB Command
- 6.3.11 APPEND Command
- 6.4.2 CLOSE Command
- 6.4.4 SEARCH Command
- 6.4.5 FETCH Command
- 6.4.6 STORE Command
- 6.4.8 UID Command
- 7.1.4 PREAUTH Response
- 7.2.1 CAPABILITY Response
- 7.2.2 LIST Response
- 7.2.3 LSUB Response
- 7.2.5 SEARCH Response
- 7.3.1 EXISTS Response
- 7.3.2 RECENT Response
- 7.4.2 FETCH Response

TODO
----

[](#todo)

- Some tasks are commented with `NOT_IMPLEMENTED`. Implement these.
- `@TODO` are to be complete the PHP Code Sniffer tests before releasing a new version.

Alternatives for `Zend\Mail`
----------------------------

[](#alternatives-for-zendmail)

- [exorus/php-mime-mail-parser](https://packagist.org/packages/exorus/php-mime-mail-parser) (requires ext-mailparse PHP extension)

Related Links
-------------

[](#related-links)

- [RFC 3501](https://tools.ietf.org/html/rfc3501)
- [Email Will Last Forever](http://blog.frontapp.com/email-will-last-forever/)
- [Email Is Still the Best Thing on the Internet](http://www.theatlantic.com/technology/archive/2014/08/why-email-will-never-die/375973/)
- [Believe it or not, email is still the killer app](http://www.digitaltrends.com/mobile/believe-it-or-not-email-is-still-the-killer-app/#!bs4oTU)
- [Developers: stop re-AOLizing the web!](http://technicalfault.net/2014/07/03/developers-stop-re-aolizing-the-web/)
- [Set up your own email server in 5 steps](https://forum.bytemark.co.uk/t/set-up-your-own-email-server-in-5-steps/1864)

Related Projects
----------------

[](#related-projects)

- [SMTPd](https://github.com/TheFox/smtpd)

Project Links
-------------

[](#project-links)

- [Blog Post about IMAPd](http://blog.fox21.at/2014/08/07/imapd.html)
- [Packagist Package](https://packagist.org/packages/thefox/imapd)
- [PHPWeekly - Issue August 7, 2014](http://phpweekly.com/archive/2014-08-07.html)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~116 days

Recently: every ~234 days

Total

10

Last Release

3259d ago

PHP version history (3 changes)v0.1.0PHP &gt;=5.3

v0.3.0PHP ~5.3 || ~7.0

v0.4.0PHP ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b879f8d5879bc5cb3a1bc43287d0b26834ffc0f403e1b076375da977fe308c55?d=identicon)[TheFox](/maintainers/TheFox)

---

Top Contributors

[![TheFox](https://avatars.githubusercontent.com/u/353709?v=4)](https://github.com/TheFox "TheFox (338 commits)")

---

Tags

imapimap-libraryimap-serverimapdmit-licensephpphp-librarymailemailserverimapdaemon

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/thefox-imapd/health.svg)

```
[![Health](https://phpackages.com/badges/thefox-imapd/health.svg)](https://phpackages.com/packages/thefox-imapd)
```

###  Alternatives

[zbateson/mail-mime-parser

MIME email message parser

53949.2M79](/packages/zbateson-mail-mime-parser)[thefox/smtpd

SMTP server (library) written in pure PHP.

1302.4k1](/packages/thefox-smtpd)[ddeboer/imap

Object-oriented IMAP for PHP

9153.9M11](/packages/ddeboer-imap)[henrique-borba/php-sieve-manager

A modern (started in 2022) PHP library for the ManageSieve protocol (RFC5804) to create/edit Sieve scripts (RFC5228). Used by Cypht Webmail.

23125.7k2](/packages/henrique-borba-php-sieve-manager)[benhall14/php-imap-reader

A PHP class that makes working with IMAP in PHP simple.

3516.6k](/packages/benhall14-php-imap-reader)[toteph42/identity_switch

This plugin allows users to switch between different accounts (and check for new mails) in a single Roundcube session.

211.2k](/packages/toteph42-identity-switch)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
