simonschaufi/laravel-dkim
Larablocks Analysis
simonschaufi/laravel-dkim works with Laravel 9 to 13 (latest release v3.6.0, Mar 5, 2026).
Laravel 7 and 8 in earlier releases.
Recommendation checks
Solid choiceSolid choice: maintained and up to date, meets 2 of 4 checks; below the bar for Recommended on use.
- Works with Laravel 13, the current version
- Released in the last 12 months (Mar 5, 2026)
- 9,558 downloads a month (needs 10,000)
- 29 GitHub stars (needs 100)
State
Maintained- Last stable release: Mar 5, 2026.
- 1 release in the last 12 months.
- First released: Apr 29, 2020.
- Monthly downloads: 9,558.
- 1 open issue on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Nov 27, 2026.
| Install | |
|---|---|
composer require simonschaufi/laravel-dkim |
|
| Latest Version: | v3.6.0 |
| Laravel: | 9 – 13 |
| Older releases: | 7 · 8 |
| License: | MIT |
| Last Updated: | Mar 5, 2026 |
| Links: | GitHub · Packagist |
Laravel DKIM
A Laravel package, that allows signing emails with DKIM.
Installation
composer require simonschaufi/laravel-dkim
In Laravel version before 11, the providers array in config/app.php has an entry with Illuminate\Mail\MailServiceProvider::class. Comment this
line out and add your own service provider entry (in the "Package Service Providers" section):
/*
* Package Service Providers...
*/
SimonSchaufi\LaravelDKIM\DKIMMailServiceProvider::class,
In Laravel 11/12, add this to your bootstrap/app.php:
->withProviders([
\SimonSchaufi\LaravelDKIM\DKIMMailServiceProvider::class,
])
The DKIMMailServiceProvider extends the MailServiceProvider and overwrites a method that we need for our own behavior.
After that, you should publish the config file with:
php artisan vendor:publish --provider="SimonSchaufi\LaravelDKIM\DKIMMailServiceProvider" --tag dkim-config
Next we need to create a private and public key pair for signing and verifying the email.
There are many tools available to generate the necessary keys but here is one which is easy to use:
https://tools.socketlabs.com/dkim/generator
Enter your domain and in the "selector" field enter default, or adjust the "selector" in the laravel config file accordingly. Leave the remaining fields as they are.
After you have generated the keys and added the public key to your dns record, here is a tool to validate it:
https://www.mail-tester.com/spf-dkim-check
Finally, store the private key for example in storage/app/dkim/private_key.txt and configure your settings in .env:
DKIM_DOMAIN=example.com
If you placed the private key somewhere else, you need to set the full absolute path in the environment variable or adjust the storage path in the config file.
If you find this package helpful, please consider a donation! Links are on top of this file.
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.
Version History
| Version | Released | Laravel | License |
|---|---|---|---|
| v3.6.0 | ^9.0 || | MIT | |
| v3.5.0 | ^9.0 || | MIT | |
| v3.4.2 | ^9.0 || | MIT | |
| v3.4.1 | ^9.0 || | MIT | |
| v3.4.0 | ^9.0 || | MIT | |
| v3.0.3 | ^9.0 || | MIT | |
| v3.0.2 | ^9.0 || | MIT | |
| v3.0.1 | ^9.0 || | MIT | |
| v3.0.0 | ^9.0 || | MIT | |
| v2.0.1 | ^9.0 | MIT | |
| v2.0.0 | ^9.0 | MIT | |
| v1.1.0 | ^7.0 || | MIT | |
| v1.0.0 | ^7.0 | MIT |