simonschaufi / laravel-dkim

Laravel package for signing outgoing messages with DKIM
https://www.simonschaufelberger.de/de/projekte/laravel-packages/laravel-dkim.html
MIT License
24 stars 9 forks source link

No private key set #8

Closed Justproof closed 2 years ago

Justproof commented 2 years ago

Hey, Simon. Thanks for creating this package. Perhaps I'm missing something on the final setup because the app isn't locating my private_key.txt?

Laravel Log: production.ERROR: No private key set. {"exception":"[object] (SimonSchaufi\\LaravelDKIM\\Exception\\MissingConfigurationException(code: 1588115551): No private key set.

I followed the documentation on storing the private_key.txt and referencing the absolute path in the .env, however, I'm not sure why this doesn't seem to grab the private key. I also tried updating and clearing the composer cache.

DKIM_PRIVATE_KEY=storage_path('/home/mydomain.com/app/dkim/private_key.txt')

Thanks for the help!

simonschaufi commented 2 years ago

Hi Russell, you cannot put php code in the env file. This is plan text only. In that case you need to put the absolute path in that file or as I mentioned, adjust the configuration file that should be copied over to your app and forget about the .env value. I hope you understood what I mean.

Justproof commented 2 years ago

Thanks, Simon. I appreciate the info. I added the absolute path to the private key in this config file >> vendor/simonschaufi/laravel-dkim/config/dkim.php and removed the values from the .env file.

I believe I'm getting close, but I have the same "No private key set" 'private_key' => storage_path('/home/pcdrama/app/dkim/private_key.txt'),

simonschaufi commented 2 years ago

Either set:

DKIM_PRIVATE_KEY=/home/mydomain.com/app/dkim/private_key.txt

in your .env or

'private_key' => storage_path('app/dkim/private_key.txt'),

in your config file but never change any file in vendor! You need to copy the config file to your own config folder!

Justproof commented 2 years ago

got it. Thanks!

On Sat, Jan 29, 2022 at 5:14 PM Simon Schaufelberger < @.***> wrote:

Either set:

DKIM_PRIVATE_KEY=/home/mydomain.com/app/dkim/private_key.txt

in your .env or

'private_key' => storage_path('app/dkim/private_key.txt'),

in your config file but never change any file in vendor! You need to copy the config file your your own config folder.

— Reply to this email directly, view it on GitHub https://github.com/simonschaufi/laravel-dkim/issues/8#issuecomment-1025004667, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZVNFCU3W3JTAQFLWZ5BGDUYRYFJANCNFSM5M4T7YZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>