PHPackages                             notifiablehq/receive-email - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. notifiablehq/receive-email

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

notifiablehq/receive-email
==========================

Let your Laravel app receive emails.

0.18.1(2mo ago)3207MITPHPPHP ^8.2CI passing

Since May 1Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/NotifiableHQ/receive-email)[ Packagist](https://packagist.org/packages/notifiablehq/receive-email)[ RSS](/packages/notifiablehq-receive-email/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (12)Versions (53)Used By (0)

Receive Email
=============

[](#receive-email)

Let your Laravel app receive emails.

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

[](#installation)

```
composer require notifiablehq/receive-email
```

Usage
-----

[](#usage)

### 1. Publish Config and Migrations

[](#1-publish-config-and-migrations)

Publish the configuration and migration files:

```
php artisan vendor:publish --provider="Notifiable\\ReceiveEmail\\ReceiveEmailServiceProvider" --tag=receive-email
```

Then run the migrations:

```
php artisan migrate
```

### 2. Listen for Incoming Emails

[](#2-listen-for-incoming-emails)

Whenever an email is received, the package will dispatch the `Notifiable\\ReceiveEmail\\Events\\EmailReceived` event. On Laravel 11 and above, you should use a listener class:

#### Create the Listener

[](#create-the-listener)

Generate a listener class:

```
php artisan make:listener HandleIncomingEmail
```

Then implement the `handle` method:

```
namespace App\Listeners;

use Notifiable\ReceiveEmail\Events\EmailReceived;

class HandleIncomingEmail
{
    public function handle(EmailReceived $event): void
    {
        $email = $event->email;

        \Log::info('Received email with subject: ' . $email->parsedMail()->subject());
    }
}
```

### 3. Accessing Email Data

[](#3-accessing-email-data)

The `Email` model gives you access to sender, recipients, subject, and body through the `parsedMail` method. Example:

```
/** @var \Notifiable\ReceiveEmail\Contracts\ParsedMailContract $mail */
$mail = $email->parsedMail();

$subject = $mail->subject();
$textBody = $mail->text();
$htmlBody = $mail->html();
$recipients = $mail->recipients();
```

Forge Deployment
----------------

[](#forge-deployment)

1. Add this to your recipes, you can name it `Install Mailparse`. Make sure the user is `root`.

```
apt-get update
apt-get install -y php-cli php-mailparse
```

2. If you already have an existing server, run this recipe on that server. Otherwise, create a new server and make sure to select this recipe as a `Post-Provision Recipe`. You'll have to show `Advance Settings` to select this.
3. Once you have the server ready, open up `Port 25`, add your site, and deploy your Laravel app.
4. Activate an SSL certificate for your site in Forge (Sites &gt; your site &gt; SSL). Forge uses Let's Encrypt and places certs at:

    - Certificate: `/etc/nginx/ssl/your-application-domain.com/server.crt`
    - Private key: `/etc/nginx/ssl/your-application-domain.com/server.key`
5. SSH into your Forge server and go to your site directory. Then run the setup command as a `super user`:

```
sudo php artisan notifiable:setup-postfix domain-that-receives-email.com \
    --user=forge \
    --tls-cert=/etc/nginx/ssl/your-application-domain.com/server.crt \
    --tls-key=/etc/nginx/ssl/your-application-domain.com/server.key \
    --with-spf
```

> **Important:** Always pass `--user=forge` (or your deploy user) when running with `sudo`. Without it, the pipe transport will run as `root`.

**Available options:**

OptionDescription`--user=forge`The system user Postfix runs the pipe command as. Required when using `sudo`.`--tls-cert=`Path to the TLS certificate file (PEM format). Enables opportunistic TLS for inbound SMTP.`--tls-key=`Path to the TLS private key file (PEM format). Must be provided together with `--tls-cert`.`--with-spf`Installs `postfix-policyd-spf-python` and configures SPF verification for inbound mail.6. Add the following DNS records to your domain:

    TypeHostValueAyour-application-domain.comyour.forge.ip.addressTypeHostValuePriorityMXdomain-that-receives-email.comyour-application-domain.com10TypeHostValueTXTdomain-that-receives-email.comv=spf1 mx -allThe SPF TXT record tells other mail servers that only your MX host is authorized to send mail for this domain. Even though this is a receive-only server, publishing an SPF record prevents others from spoofing your domain.

Configuration
-------------

[](#configuration)

After publishing the config file, you can tune the following settings in `config/receive_email.php`:

KeyDefaultDescription`message-size-limit``26214400` (25MB)Maximum inbound email size in bytes. Written to Postfix's `message_size_limit`.`pipe-concurrency``4`Maximum concurrent pipe processes. Maps to `maxproc` in `master.cf`.`storage-disk``local`Filesystem disk for storing raw email files.`email-table``emails`Table name for the Email model.`sender-table``senders`Table name for the Sender model.To apply changes to `message-size-limit` or `pipe-concurrency`, re-run the setup command.

Research References
-------------------

[](#research-references)

- [How Postfix receives email](https://www.postfix.org/OVERVIEW.html#receiving)
- [Installing and configuring Postfix on Ubuntu](https://ubuntu.com/server/docs/install-and-configure-postfix)

Credits
-------

[](#credits)

The solutions in this package are inspired by the following projects:

- [Mailcare](https://gitlab.com/mailcare/mailcare)
- [Laravel Mailbox](https://github.com/beyondcode/laravel-mailbox)

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance84

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

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 ~15 days

Recently: every ~95 days

Total

47

Last Release

80d ago

PHP version history (2 changes)0.12.0PHP ^8.2

0.16.0PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/4eff78899d39d79e9eaf65df18ae55e18ff4be026524d311fdb178f9f2f1d0df?d=identicon)[princejohnsantillan](/maintainers/princejohnsantillan)

---

Top Contributors

[![princejohnsantillan](https://avatars.githubusercontent.com/u/60916966?v=4)](https://github.com/princejohnsantillan "princejohnsantillan (73 commits)")

---

Tags

laravelmailboxinbound emailreceive email

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/notifiablehq-receive-email/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M10](/packages/renatomarinho-laravel-page-speed)[vinkius-labs/laravel-page-speed

Laravel Page Speed

2.5k12.5k1](/packages/vinkius-labs-laravel-page-speed)[emargareten/inertia-modal

Inertia Modal is a Laravel package that lets you implement backend-driven modal dialogs for Inertia apps.

90142.9k](/packages/emargareten-inertia-modal)[wearepixel/laravel-cart

A cart implementation for Laravel

1374.8k](/packages/wearepixel-laravel-cart)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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