Closed bardolf69 closed 10 months ago
Good day, sorry for the delay in response. Can you please provide the following info:
Sorry, for the delay in my response I got stuck with other problems and DKIM support got pushed to the rear. I'm back on it again now.
added the following to config/app.php
HostBrook\LaravelDkim\DkimMailServiceProvider::class,
couldn't comment this line out as it doesn't exist
// Illuminate\Mail\MailServiceProvider::class,
here is the full list of my service providers
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\HorizonServiceProvider::class,
App\Providers\RouteServiceProvider::class,
App\Providers\FortifyServiceProvider::class,
App\Providers\JetstreamServiceProvider::class,
App\Providers\ViewServiceProvider::class,
HostBrook\LaravelDkim\DkimMailServiceProvider::class
You can see my config/mail.php settings in my original post.
originally I was using a keypair generated by the Socketlabs tool that you list in your docs, I then tried generating it a second time in the same tool. Finally I generated the keypair myself with openssl using the following commands.
openssl genrsa -out dkim_private.pem 2048
openssl rsa -in dkim_private.pem -pubout -outform der 2> nul | openssl base64 -A
any thoughts?
checking...
Ok, I have completed tests on two projects. One was recently upgraded from Laravel 9.x to 10.31.0, and another one was made from scratch on Laravel 10.30.0. Both work perfectly with the package. You can test it by yourself if fill out the "Contact Us" form at the website hostbrook.com and put your email in the form. You will receive a confirmation email, so check just the headers, should be something like this:
Authentication-Results: spf=pass (sender IP is 198.71.225.122)
smtp.mailfrom=hostbrook.com; dkim=pass (signature was verified)
header.d=hostbrook.com;dmarc=pass action=none
header.from=hostbrook.com;compauth=pass reason=100
Received-SPF: Pass (protection.outlook.com: domain of hostbrook.com designates
Also, another contributor confirmed this package works without errors on his side. Moreover, there were not any changes for the mailer between Laravel 9.x and Laravel 10.x versions.
I would suggest checking in composer.json
file the version of package, for Laravel 10.x it should be:
"hostbrook/laravel-dkim": "^1.2.5"
And again, the most often issue I met is hidden symbols at the beginning of lines between two instances '-----BEGIN RSA PRIVATE KEY-----' and '-----END RSA PRIVATE KEY-----'. They must be right up to the start of the line. Be sure at the end of the line no hidden symbols (like TAB). This is a copy from hostbrook.com config:
'dkim_selector' => 'selector1',
'dkim_domain' => 'hostbrook.com',
'dkim_passphrase' => '', // leave empty if you didn’t protect the private key
'dkim_private_key' => '-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAq1SCAScdt736Rr/f36OYUo8cRziq4v2uq6kNs5wzEaaqUAoh
SKGzonNp6Pis4AalVId633E/9QLnnxfA19Ne7tIewfK9Wug91iY16+3r9CTSGCTT
...
u4DsesAgyr1uJ6jhEPfgAbRxWfiJ0dQ6RtTXJAxYZZOuH8h2XdGqsfrk5D6WuopP
ENwDlqtgpM9D7YdnrL6W9NH7fdSwmz2Ux0frY6weuBx/VSeJn1fb
-----END RSA PRIVATE KEY-----',
To be honest, I do not know what else you can check. It is a very simple package and it works perfectly on at least 3 projects I have checked today.
You know what, try one more step to publish the config file; in the terminal:
php artisan vendor:publish --provider="HostBrook\LaravelDkim\DkimMailServiceProvider"
please let me know the status. Also, in the next version I'm planning to add the option to load the private key from the txt file. Maybe this will work for you.
I've just installed your package but I'm getting an error
Unable to load DKIM private key: error:1E08010C:DECODER routines::unsupported {"exception":"[object] (Symfony\\Component\\Mime\\Exception\\InvalidArgumentException(code: 0): Unable to load DKIM private key: error:1E08010C:DECODER routines::unsupported at /app/vendor/symfony/mime/Crypto/DkimSigner.php:47)
, any ideas on what the problem may be?I have double-checked and my config is exactly as you said in your docs.