PHPackages                             hostbrook/laravel-dkim - 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. hostbrook/laravel-dkim

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

hostbrook/laravel-dkim
======================

Laravel 9.x, 10.x, 11.x and 12.x package to sign emails with DKIM

1.5.0(1y ago)07.9k—4.8%1[1 PRs](https://github.com/hostbrook/laravel-dkim/pulls)MITPHP

Since Jul 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/hostbrook/laravel-dkim)[ Packagist](https://packagist.org/packages/hostbrook/laravel-dkim)[ RSS](/packages/hostbrook-laravel-dkim/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (11)Used By (0)

[![GitHub release (latest by date)](https://camo.githubusercontent.com/a0534b6f97fdb5dc575e3780450c1f927859263ded21b20ebc4978552a8f30d8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f686f737462726f6f6b2f6c61726176656c2d646b696d)](https://github.com/hostbrook/laravel-dkim)[![GitHub code size in bytes](https://camo.githubusercontent.com/bd709247fbb9d43d51e20b61feb3eaf98fd269453dedda20afa95a9faa40332e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f686f737462726f6f6b2f6c61726176656c2d646b696d)](https://github.com/hostbrook/laravel-dkim)[![License](https://camo.githubusercontent.com/1c1c545b1ec11caf564cc36a537480c2da381a09738ce4bb56f9a0c1540ff76d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f686f737462726f6f6b2f6c61726176656c2d646b696d)](https://github.com/hostbrook/laravel-dkim)

Laravel 9.x, 10.x, 11.x and 12.x DKIM signature
===============================================

[](#laravel-9x-10x-11x-and-12x-dkim-signature)

Sign all outgoing emails in Laravel 9.x, 10.x, 11.x and 12.x with a DKIM signature.

> **IMPORTANT!** The package version that supports Laravel 10.x starts from 1.2.5

> **IMPORTANT!** The package version that supports Laravel 11.x starts from 1.4

> **IMPORTANT!** The package version that supports Laravel 12.x starts from 1.5

Installation and setup
----------------------

[](#installation-and-setup)

1. Get the latest version of the package via Composer:

```
composer require hostbrook/laravel-dkim

```

2. In `config/app.php` comment the line with the original mail service provider (if exists) and add the line with the new mail service provider:

```
// Illuminate\Mail\MailServiceProvider::class,
HostBrook\LaravelDkim\DkimMailServiceProvider::class,

```

3. Add your DKIM private key settings in `/.env` or in `/config/mail.php`. The priority of DKIM settings is from `/.env` file.

    3.1. The syntax, if you want to add DKIM private key settings in `/.env` file:

    ```
    DKIM_SELECTOR="selector1"
    DKIM_DOMAIN="domain.name"
    DKIM_PASSPHRASE=""
    DKIM_PRIVATE_KEY="/storage/app/dkim/private_key.txt"

    ```

    As an option, you can add the full RSA Private Key to the `.env` file, for example:

    ```
    DKIM_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----
    MIIEowIBAAKCAQEAq1SCAScet736Rr/f36OYUo8cRziq4v2uq6kNs5wzEaaqUAoh
    ...
    ENwDlqtgpM9D7YznrL6W9NH7fdSwmz2Ux0frY6weuBx/VSeJn1fb
    -----END RSA PRIVATE KEY-----"

    ```

    3.2. The syntax, if you want to add DKIM private key settings in `/config/mail.php` file:

    ```
    'dkim_selector' => 'selector1',
    'dkim_domain' => 'domain.name',
    'dkim_passphrase' => '', // leave empty if you didn’t protect the private key
    'dkim_private_key' => '/storage/app/dkim/private_key.txt',

    ```

    As an option, you can add the full RSA Private Key to the `/config/mail.php` file, for example:

    ```
    'dkim_private_key' => '-----BEGIN RSA PRIVATE KEY-----
    MIIEowIBAAKCAQEAq1SCAScet736Rr/f36OYUo8cRziq4v2uq6kNs5wzEaaqUAoh
    ...
    ENwDlqtgpM9D7YznrL6W9NH7fdSwmz2Ux0frY6weuBx/VSeJn1fb
    -----END RSA PRIVATE KEY-----',

    ```

Notes and recommendations
-------------------------

[](#notes-and-recommendations)

- No matter where you keep the RSA Private Key, in `/.env` file or in `/config/mail.php` file or in a text file, everything between two instances `'-----BEGIN RSA PRIVATE KEY-----'` and `'-----END RSA PRIVATE KEY-----'` must be right up to the start of the line!
- It is not recommended to keep private key directly in the `/config/mail.php` file for security reasons especially if your project is not in the private repository.
- If you would like to keep RSA Private key in a text file, the path to the text file must be relative to the project base path (like in the example above).

Upgrading
---------

[](#upgrading)

Whenever there is a new release, then from the command line in your ***project root***:

```
composer update
```

Deleting package
----------------

[](#deleting-package)

Running the following command will remove the package from vendor folder:

```
composer remove hostbrook/laravel-dkim
```

DKIM info
---------

[](#dkim-info)

Read more how to:

- [Generate DKIM Public and Private Keys](https://tools.socketlabs.com/dkim/generator)
- [Check if DKIM record is shown and has a correct format](https://dmarcly.com/tools/dkim-record-checker)
- [Test the Spammyness of your Emails](https://www.mail-tester.com)

References
----------

[](#references)

- [DUDU54/laravel-dkim](https://github.com/DUDU54/laravel-dkim)
- [simonschaufi/laravel-dkim](https://github.com/simonschaufi/laravel-dkim)

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance46

Moderate activity, may be stable

Popularity24

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70% 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 ~149 days

Recently: every ~240 days

Total

10

Last Release

419d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0c707f620b47059c1ae4ccbb4f9a81a3e6bfba09f0ede96c6e38ecdc5f7a3bc4?d=identicon)[hostbrook](/maintainers/hostbrook)

---

Top Contributors

[![hostbrook](https://avatars.githubusercontent.com/u/42077512?v=4)](https://github.com/hostbrook "hostbrook (21 commits)")[![fabio-desimone](https://avatars.githubusercontent.com/u/113911934?v=4)](https://github.com/fabio-desimone "fabio-desimone (3 commits)")[![rdanklof](https://avatars.githubusercontent.com/u/271785?v=4)](https://github.com/rdanklof "rdanklof (2 commits)")[![vitalybaev](https://avatars.githubusercontent.com/u/724423?v=4)](https://github.com/vitalybaev "vitalybaev (1 commits)")[![jamestel](https://avatars.githubusercontent.com/u/7420764?v=4)](https://github.com/jamestel "jamestel (1 commits)")[![henriklippke](https://avatars.githubusercontent.com/u/4739705?v=4)](https://github.com/henriklippke "henriklippke (1 commits)")[![langemeijer](https://avatars.githubusercontent.com/u/1193933?v=4)](https://github.com/langemeijer "langemeijer (1 commits)")

---

Tags

dkimdkim-signaturelaravel

### Embed Badge

![Health badge](/badges/hostbrook-laravel-dkim/health.svg)

```
[![Health](https://phpackages.com/badges/hostbrook-laravel-dkim/health.svg)](https://phpackages.com/packages/hostbrook-laravel-dkim)
```

###  Alternatives

[spatie/laravel-failed-job-monitor

Get notified when a queued job fails

1.0k2.6M4](/packages/spatie-laravel-failed-job-monitor)[vemcogroup/laravel-sparkpost-driver

SparkPost driver to use with Laravel 6.x|7.x|8.x|9.x|10.x

421.7M1](/packages/vemcogroup-laravel-sparkpost-driver)[illuminate/mail

The Illuminate Mail package.

5910.1M391](/packages/illuminate-mail)[therobfonz/laravel-mandrill-driver

Mandrill Driver for Laravel

773.5M](/packages/therobfonz-laravel-mandrill-driver)[symfony/mailjet-mailer

Symfony Mailjet Mailer Bridge

484.7M12](/packages/symfony-mailjet-mailer)[mailersend/laravel-driver

MailerSend Laravel Driver

87732.8k4](/packages/mailersend-laravel-driver)

PHPackages © 2026

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