PHPackages                             punarinta/email-auth - 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. punarinta/email-auth

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

punarinta/email-auth
====================

Discover IMAP/SMTP settings, authenticate via any email

v1.0(9y ago)359.1k↑20%41MITPHPPHP &gt;=5.4.0

Since Jul 8Pushed 9y ago1 watchersCompare

[ Source](https://github.com/punarinta/email-auth)[ Packagist](https://packagist.org/packages/punarinta/email-auth)[ RSS](/packages/punarinta-email-auth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (1)

EmailAuth
=========

[](#emailauth)

A library to authenticate via an arbitrary email or/and to discover IMAP/SMTP settings by email address. Can be for example used in the projects where one doesn't need to keep a user entity in the database, but for which at the same time an authentication with service providers like Google is not enough.

Installation
============

[](#installation)

- Install Composer:
- Run `php composer.phar require punarinta/email-auth:1.*`
- Assure "autoload.php" file from vendor directory is included

Sample usage
============

[](#sample-usage)

#### Authentication

[](#authentication)

```
use \EmailAuth\Auth;

$auth = new Auth;
if ($auth->login('your@email', 'your-password'))
{
  // You are authenticated.
}
elseif ($auth->status == Auth::STATUS_OAUTH_NEEDED)
{
  // Please authenticate via OAuth.
}
else
{
  // Thou shalt not pass!
}

```

#### Discovery

[](#discovery)

```
use \EmailAuth\Discover;
$discover = new Discover;

$config = $discover->imap('your@email');
echo "IMAP is on {$config['host']}:{$config['port']}, encryption is $config['encryption']}\n";

$config = $discover->smtp('your@email');
echo "SMTP is on {$config['host']}:{$config['port']}, encryption is $config['encryption']}\n";

```

Troubleshooting
===============

[](#troubleshooting)

##### Fatal error: Call to undefined function imap\_open()

[](#fatal-error-call-to-undefined-function-imap_open)

No IMAP module is installed for PHP. Here's an example for PHP7 and Ubuntu how to fix it.

```
sudo apt-get install php7.0-imap
sudo phpenmod imap

```

License
=======

[](#license)

This project is licensed under the terms of [**MIT**](https://github.com/punarinta/email-auth/blob/master/LICENSE) license.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

3602d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/754c799a3ccee283cb079e7753a87e1f876ffb97d846bb1664793681fb635d9f?d=identicon)[punarinta](/maintainers/punarinta)

---

Top Contributors

[![punarinta](https://avatars.githubusercontent.com/u/2189981?v=4)](https://github.com/punarinta "punarinta (41 commits)")

---

Tags

authAuthenticationemaildnsdiscoversmtpimap

### Embed Badge

![Health badge](/badges/punarinta-email-auth/health.svg)

```
[![Health](https://phpackages.com/badges/punarinta-email-auth/health.svg)](https://phpackages.com/packages/punarinta-email-auth)
```

###  Alternatives

[tymon/jwt-auth

JSON Web Token Authentication for Laravel and Lumen

11.5k49.1M350](/packages/tymon-jwt-auth)[ellaisys/aws-cognito

AWS Cognito package that allows Auth and other related features using the AWS SDK for PHP

120220.7k1](/packages/ellaisys-aws-cognito)[lakm/nopass

Provides passwordless authentication for your laravel projects.

2213.6k2](/packages/lakm-nopass)

PHPackages © 2026

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