PHPackages                             phpfui/php-imap - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. phpfui/php-imap

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

phpfui/php-imap
===============

PHP IMAP with OAUTH2 for drop in replacement in PHP 8.4

0.5.1(6mo ago)038GPL-3.0-or-laterPHPPHP &gt;=8.2CI failing

Since Jan 20Pushed 2mo agoCompare

[ Source](https://github.com/phpfui/php-imap2)[ Packagist](https://packagist.org/packages/phpfui/php-imap)[ Docs](https://github.com/phpfui/php-imap2)[ RSS](/packages/phpfui-php-imap/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (8)Versions (7)Used By (0)

PHP IMAP Drop in Replacement for PHP 8.4
========================================

[](#php-imap-drop-in-replacement-for-php-84)

A drop in PHP replacement for the imap\_ functions removed from PHP 8.4. If imap\_ functions are detected, then the built in functions are used. So you can install this on PHP 8.2 or 8.3 and when you upgrade to PHP 8.4, it will continue to work.

Usage
-----

[](#usage)

```
include 'vendor/phpfui/php-imap2/src/Imap2/IMAPStubs.php
// continue to use imap_ functions. Example:
//$mbh = \imap_open($server, $username, $token, OP_XOAUTH2);
```

This package is based on arbor-education/php-imap2 and jaavanile/php-imap2
--------------------------------------------------------------------------

[](#this-package-is-based-on-arbor-educationphp-imap2-and-jaavanilephp-imap2)

It has been updated to modern PHP 8 standards and simplified. Since this a just a wrapper around the imap\_ functions, it can easily be updated to a better IMAP library if needed.

Unimplemented functions
-----------------------

[](#unimplemented-functions)

The following functions were not implemented in the original source and will be undefined:

- function imap\_mail(string $to, string $subject, string $message, ?string $additional\_headers = null, ?string $cc = null, ?string $bcc = null, ?string $return\_path = null) : bool
- function imap\_mail\_compose(array $envelope, array $bodies) : string|false
- function imap\_mime\_header\_decode(string $string) : array
- function imap\_set\_quota(IMAP\\Connection $imap,string $quota\_root): array|false
- function imap\_listsubscribed(\\IMAP\\Connection $imap, string $reference, string $pattern) : array|false
- function imap\_lsub(\\IMAP\\Connection $imap, string $reference, string $pattern) : array|false

The following functions have no effect:

- function imap\_mutf7\_to\_utf8(string $string) : string

Testing
-------

[](#testing)

Due to the complexities of setting up and running an actual IMAP server in GitHub Actions, test is confined to testing on live sites.

Anyone interested in contributing tests should look into updating the original tests in javanile/php-imap2 and get them to run under GitHub Actions. PRs welcome.

The following functions seem to work on live sites:

- imap\_close()
- imap\_delete()
- imap\_errors()
- imap\_num\_msg()
- imap\_open()
- imap\_savebody()

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance78

Regular maintenance activity

Popularity9

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.6% 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 ~58 days

Recently: every ~72 days

Total

6

Last Release

192d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7434059?v=4)[Bruce Wells](/maintainers/PHPFUI)[@phpfui](https://github.com/phpfui)

---

Top Contributors

[![francescobianco](https://avatars.githubusercontent.com/u/472171?v=4)](https://github.com/francescobianco "francescobianco (242 commits)")[![phpfui](https://avatars.githubusercontent.com/u/7434059?v=4)](https://github.com/phpfui "phpfui (21 commits)")[![kosta90s](https://avatars.githubusercontent.com/u/9103223?v=4)](https://github.com/kosta90s "kosta90s (17 commits)")[![dicode-nl](https://avatars.githubusercontent.com/u/4663575?v=4)](https://github.com/dicode-nl "dicode-nl (10 commits)")[![fatihfth](https://avatars.githubusercontent.com/u/17280290?v=4)](https://github.com/fatihfth "fatihfth (8 commits)")[![kevdms](https://avatars.githubusercontent.com/u/118255444?v=4)](https://github.com/kevdms "kevdms (7 commits)")[![SiebeVE](https://avatars.githubusercontent.com/u/14889418?v=4)](https://github.com/SiebeVE "SiebeVE (3 commits)")[![tnaumann-wecg](https://avatars.githubusercontent.com/u/72196040?v=4)](https://github.com/tnaumann-wecg "tnaumann-wecg (1 commits)")[![glensc](https://avatars.githubusercontent.com/u/199095?v=4)](https://github.com/glensc "glensc (1 commits)")[![pjio](https://avatars.githubusercontent.com/u/6034781?v=4)](https://github.com/pjio "pjio (1 commits)")[![cherrmann89](https://avatars.githubusercontent.com/u/22745448?v=4)](https://github.com/cherrmann89 "cherrmann89 (1 commits)")

---

Tags

oauthoauth2imap

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phpfui-php-imap/health.svg)

```
[![Health](https://phpackages.com/badges/phpfui-php-imap/health.svg)](https://phpackages.com/packages/phpfui-php-imap)
```

###  Alternatives

[league/oauth2-server

A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.

6.6k136.0M248](/packages/league-oauth2-server)[league/oauth2-client

OAuth 2.0 Client Library

3.8k118.6M1.2k](/packages/league-oauth2-client)[bshaffer/oauth2-server-php

OAuth2 Server for PHP

3.3k15.2M106](/packages/bshaffer-oauth2-server-php)[hwi/oauth-bundle

Support for authenticating users using both OAuth1.0a and OAuth2 in Symfony.

2.4k21.5M69](/packages/hwi-oauth-bundle)[knpuniversity/oauth2-client-bundle

Integration with league/oauth2-client to provide services

83416.7M61](/packages/knpuniversity-oauth2-client-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

42121.2M118](/packages/league-oauth2-google)

PHPackages © 2026

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