PHPackages                             draliragab/filament-cloudflare-mail-monitor - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. draliragab/filament-cloudflare-mail-monitor

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

draliragab/filament-cloudflare-mail-monitor
===========================================

Cloudflare Email Service outbound metrics and logs monitor for Filament.

v1.2.0(2w ago)06MITPHPPHP ^8.4CI passing

Since Apr 25Pushed 2w agoCompare

[ Source](https://github.com/DrAliRagab/filament-cloudflare-mail-monitor)[ Packagist](https://packagist.org/packages/draliragab/filament-cloudflare-mail-monitor)[ Docs](https://github.com/DrAliRagab/filament-cloudflare-mail-monitor)[ RSS](/packages/draliragab-filament-cloudflare-mail-monitor/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (23)Versions (5)Used By (0)

Cloudflare Mail Monitor for Filament
====================================

[](#cloudflare-mail-monitor-for-filament)

Monitor outbound Cloudflare Email Service activity in Laravel and Filament.

This package syncs outbound Email Sending analytics and zone-scoped suppression lists from Cloudflare, stores normalized records locally, and provides Filament 5 pages, resources, and widgets for delivery monitoring, failures, authentication health, recent logs, and suppressions.

Features
--------

[](#features)

- Sync outbound email events into your database
- View searchable email logs in Filament
- Sync zone-scoped Email Sending suppressions into your database
- View searchable suppression records in Filament
- Inspect delivery failures and authentication health
- Refresh logs manually from the dashboard, list, or detail views
- Prune old records with Laravel `model:prune`
- Backfill recent history on the first run, then keep syncing daily

Requirements
------------

[](#requirements)

- PHP 8.4+
- Laravel 12 or 13
- Filament 5
- Cloudflare Email Service enabled for outbound sending
- Cloudflare API token with `Analytics Read` and Email Sending suppression read access for the configured zones

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

[](#installation)

```
composer require draliragab/filament-cloudflare-mail-monitor

php artisan vendor:publish --tag="cloudflare-mail-monitor-config"
php artisan vendor:publish --tag="cloudflare-mail-monitor-migrations"
php artisan migrate
```

Register the plugin in your Filament panel provider:

```
use DrAliRagab\FilamentCloudflareMailMonitor\CloudflareMailMonitorPlugin;
use Filament\Panel;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugin(CloudflareMailMonitorPlugin::make());
}
```

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

[](#configuration)

Set the required environment variables:

```
CLOUDFLARE_MAIL_MONITOR_API_TOKEN=your-cloudflare-api-token
CLOUDFLARE_MAIL_MONITOR_ZONE_ID=your-zone-id
CLOUDFLARE_MAIL_MONITOR_ZONE_NAME=example.com
```

Optional settings include retention, fetch lookback, privacy masking, and Filament navigation labels/icons. Use `CLOUDFLARE_MAIL_MONITOR_SUPPRESSIONS_PAGE_SIZE` to tune suppression API pagination, up to Cloudflare's documented maximum of 1000.

Scheduling
----------

[](#scheduling)

Add the fetch and prune commands to your Laravel scheduler:

```
use Illuminate\Support\Facades\Schedule;

Schedule::command('cloudflare-mail-monitor:fetch')->daily();
Schedule::command('cloudflare-mail-monitor:prune')->daily();
```

After installation, run a one-time backfill with a longer lookback, then let the daily schedule keep syncing new events and suppressions:

```
php artisan cloudflare-mail-monitor:fetch --days=30
```

Event records older than 90 days are pruned by default. Suppression records are pruned after their `expires_at` date. Publish the config to customize retention and other package options.

Commands
--------

[](#commands)

Fetch recent Cloudflare email events and zone suppressions synchronously:

```
php artisan cloudflare-mail-monitor:fetch
```

Fetch a specific lookback window:

```
php artisan cloudflare-mail-monitor:fetch --days=7
```

Dispatch the fetch through your queue:

```
php artisan cloudflare-mail-monitor:fetch --queue
```

Prune old records immediately:

```
php artisan cloudflare-mail-monitor:prune
```

What It Provides
----------------

[](#what-it-provides)

The plugin registers:

- A Cloudflare Mail Monitor dashboard page with a manual refresh action
- An Email Suppressions resource backed by stored Cloudflare suppression records
- An Email Logs resource backed by stored Cloudflare events
- A stats widget for total events, delivered events, failed events, and spam/NDR signals
- A delivery failure analytics widget for rejected/NDR events and top failure causes
- An authentication health widget for DKIM, DMARC, and SPF failure counts

The Email Logs resource includes filters for configured zones, delivery status, DKIM/DMARC/SPF results, spam/NDR flags, and occurred-at date ranges.

You can disable plugin parts fluently if your panel only needs some screens:

```
CloudflareMailMonitorPlugin::make()
    ->dashboard()
    ->suppressionsResource()
    ->logsResource()
    ->statsWidget();
```

Pass `false` to any of these methods to disable that part.

Events
------

[](#events)

The package dispatches `CloudflareMailSuppressionCreated` after a new suppression row is committed locally. Existing suppression rows updated during later syncs do not dispatch the event again.

```
use DrAliRagab\FilamentCloudflareMailMonitor\Events\CloudflareMailSuppressionCreated;
use Illuminate\Support\Facades\Event;

Event::listen(CloudflareMailSuppressionCreated::class, function (CloudflareMailSuppressionCreated $event): void {
    $suppression = $event->suppression;

    // Sync your local allow/block list, notify a team, or update another system.
});
```

Programmatic Metrics
--------------------

[](#programmatic-metrics)

The package stores individual events locally through `CloudflareMailEventFetcher`. It also exposes `CloudflareMailAggregateFetcher` for on-demand aggregate status counts from Cloudflare's `emailSendingAdaptiveGroups` dataset.

```
use DrAliRagab\FilamentCloudflareMailMonitor\Services\CloudflareMailAggregateFetcher;

$metrics = app(CloudflareMailAggregateFetcher::class)->statusCounts();
```

Aggregate metrics are returned as `EmailAggregateMetricData` objects and are not persisted by default.

Cloudflare Notes
----------------

[](#cloudflare-notes)

Cloudflare Email Service is evolving. This package uses the documented GraphQL Analytics datasets for outbound sending:

- `emailSendingAdaptiveGroups`
- `emailSendingAdaptive`

The Email Suppressions resource is populated by the existing `cloudflare-mail-monitor:fetch` command using the zone-scoped REST endpoint `GET /zones/{zone_id}/email/sending/suppression` for each configured zone. It does not require a Cloudflare account ID.

Cloudflare currently documents a 31-day analytics retention window, so scheduled fetching should run at least monthly. Daily fetching is recommended.

Troubleshooting
---------------

[](#troubleshooting)

- `Cloudflare API token is not configured`: set `CLOUDFLARE_MAIL_MONITOR_API_TOKEN` and clear cached config with `php artisan config:clear`.
- Empty dashboard or logs: confirm `CLOUDFLARE_MAIL_MONITOR_ZONE_ID` is a zone ID, not an account ID, and that the token has `Analytics Read` for that zone.
- Empty suppressions resource: run `php artisan cloudflare-mail-monitor:fetch`, confirm the zone has Email Sending enabled, and confirm the token can read Email Sending suppressions for that zone.
- Missing older events: Cloudflare currently documents a 31-day retention window for Email Service analytics; schedule daily fetching to preserve events locally for longer retention.
- GraphQL errors from Cloudflare: verify Email Service is enabled for the sending domain and that the configured zone has outbound sending activity.
- Slow or timed-out fetches: lower `CLOUDFLARE_MAIL_MONITOR_FETCH_PAGE_SIZE` or increase `CLOUDFLARE_MAIL_MONITOR_API_TIMEOUT` in the published config.

###  Health Score

43

—

FairBetter than 89% of packages

Maintenance97

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community6

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

Total

3

Last Release

17d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/12db7cd56d176fc60e72ea9f055f8b9eae5bfd4afdf5076355b3d693dd6bd09c?d=identicon)[DrAliRagab](/maintainers/DrAliRagab)

---

Top Contributors

[![DrAliRagab](https://avatars.githubusercontent.com/u/37520558?v=4)](https://github.com/DrAliRagab "DrAliRagab (31 commits)")

---

Tags

laravelmonitoringmailcloudflarefilamentemail-service

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/draliragab-filament-cloudflare-mail-monitor/health.svg)

```
[![Health](https://phpackages.com/badges/draliragab-filament-cloudflare-mail-monitor/health.svg)](https://phpackages.com/packages/draliragab-filament-cloudflare-mail-monitor)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

88011.3M149](/packages/spatie-laravel-health)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.4k](/packages/larastan-larastan)[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k14.1M120](/packages/laravel-pulse)[laravel/ai

The official AI SDK for Laravel.

9782.1M153](/packages/laravel-ai)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

719160.4k12](/packages/tallstackui-tallstackui)

PHPackages © 2026

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