PHPackages                             aegisora/email-rule - 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. aegisora/email-rule

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

aegisora/email-rule
===================

Rule-based email validation in Aegisora ecosystem

v1.0.0(1mo ago)00MITPHPPHP &gt;=7.4

Since Apr 27Pushed 1mo agoCompare

[ Source](https://github.com/Aegisora/email-rule)[ Packagist](https://packagist.org/packages/aegisora/email-rule)[ Docs](https://github.com/Aegisora/email-rule)[ RSS](/packages/aegisora-email-rule/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Aegisora Email Rule
===================

[](#aegisora-email-rule)

[![Code Coverage Badge](./badge.svg)](./badge.svg)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![PHPStan Badge](https://camo.githubusercontent.com/83dd3d35cebed0eab9ee97ff1a5849c1344cda6a8ee9cac2cda20f5aa55b67bd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230392d627269676874677265656e2e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/83dd3d35cebed0eab9ee97ff1a5849c1344cda6a8ee9cac2cda20f5aa55b67bd/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230392d627269676874677265656e2e7376673f7374796c653d666c6174)

Email Rule provides a simple, rule-based `email` validation implementation for the Aegisora ecosystem.

It is built on top of `aegisora/rule-contract` () and follows its strict validation architecture, ensuring consistent and predictable behavior across applications.

---

✨ Features
----------

[](#-features)

- 🔹 Lightweight and dependency-free (except rule contract)
- 🔹 Uses native PHP email validation (`filter_var`)
- 🔹 Fully compatible with Aegisora validation pipeline
- 🔹 Strict `Context → Result` validation flow
- 🔹 No raw booleans — only structured results
- 🔹 Safe execution via base `Rule` abstraction
- 🔹 Ready to use out of the box

---

📦 Installation
--------------

[](#-installation)

```
composer require aegisora/email-rule
```

---

🚀 Core Concept
--------------

[](#-core-concept)

This package implements a single validation rule:

- accepts a value via `Context`
- validates it as an email
- returns a standardized `Result`

Validation is performed using PHP’s built-in:

`filter_var($value, FILTER_VALIDATE_EMAIL)`

---

🏗️ Basic Usage
--------------

[](#️-basic-usage)

### Using `EmailRule`

[](#using-emailrule)

```
use Aegisora\Rules\EmailRule;
use Aegisora\RuleContract\Models\Context;

$rule = EmailRule::create();
$result = $rule->validate(Context::create('user@example.com'));

if ($result->isValid()) {
// email is valid
} else {
// email is invalid
}
```

---

🧠 Implementation Details
------------------------

[](#-implementation-details)

### `EmailRule`

[](#emailrule)

- Uses `filter_var` for validation
- Returns:
    - `Result::valid()` result if email is correct
    - `Result::invalid()` result if email is incorrect
- Does not throw exceptions for invalid emails
- Fully relies on base `Rule` execution guarantees

---

🏛️ Architecture
---------------

[](#️-architecture)

This package relies on `aegisora/rule-contract` ().

Flow:

1. `validate()` is called
2. `executeValidate()` runs
3. Result is returned (`Result`)
4. Errors (if any) are safely handled by base `Rule`

---

⚖️ License
----------

[](#️-license)

This package is open-source and licensed under the MIT License. See the LICENSE for details.

---

🌱 Contributing
--------------

[](#-contributing)

Contributions are welcome and greatly appreciated!. See the CONTRIBUTING for details.

---

🌟 Support
---------

[](#-support)

If you find this project useful, please consider giving it a star on GitHub!

It helps the project grow and motivates further development.

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance91

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 81.5% 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

43d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/81402dcd0a07ad550b7f80f5871e7c302770b29d4c73a52fc35ba697f702d56e?d=identicon)[arslanim](/maintainers/arslanim)

---

Top Contributors

[![arslanim](https://avatars.githubusercontent.com/u/22678154?v=4)](https://github.com/arslanim "arslanim (88 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (20 commits)")

---

Tags

aegisoraaegisora-ecosystememailemail-rulephprule-based-email-predicate-checkphpemailemail validationaegisoraaegisora-ecosystememail-rule

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/aegisora-email-rule/health.svg)

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

###  Alternatives

[daveearley/daves-email-validation-tool

An easy to use, accurate-ish &amp; extensible email validation library for PHP 7+

279335.8k2](/packages/daveearley-daves-email-validation-tool)[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.

28137.9k3](/packages/henrique-borba-php-sieve-manager)[hafael/azure-mailer-driver

Supercharge your Laravel or Symfony app with Microsoft Azure Communication Services (ACS)! Effortlessly add email, chat, voice, video, and telephony-over-IP for next-level communication. 🚀

15122.2k](/packages/hafael-azure-mailer-driver)[martian/spammailchecker

A laravel package that protect users from entering non-existing/spam email addresses.

422.1k](/packages/martian-spammailchecker)[naif/php-cpanel-email

Manage cPanel Email Addresses

211.3k](/packages/naif-php-cpanel-email)

PHPackages © 2026

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