From 371619c6d3296ae05c3736e51897fa3e932db6ba Mon Sep 17 00:00:00 2001 From: Bozhidar Date: Thu, 3 Oct 2024 13:07:23 +0300 Subject: [PATCH] update --- web/Modules/Email/App/Http/Livewire/DkimSetup.php | 1 + web/Modules/Email/DkimDomainSetup.php | 7 ++++++- .../Email/resources/views/livewire/dkim-setup.blade.php | 8 ++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/web/Modules/Email/App/Http/Livewire/DkimSetup.php b/web/Modules/Email/App/Http/Livewire/DkimSetup.php index d459e4a..8827fc8 100644 --- a/web/Modules/Email/App/Http/Livewire/DkimSetup.php +++ b/web/Modules/Email/App/Http/Livewire/DkimSetup.php @@ -21,6 +21,7 @@ class DkimSetup extends Component 'secure' => $secure, 'verify' => $verify, 'mainDomain' => $mainDomain, + 'serverIp' => $_SERVER['SERVER_ADDR'], ]); } diff --git a/web/Modules/Email/DkimDomainSetup.php b/web/Modules/Email/DkimDomainSetup.php index 60e4767..9761b55 100644 --- a/web/Modules/Email/DkimDomainSetup.php +++ b/web/Modules/Email/DkimDomainSetup.php @@ -11,9 +11,13 @@ class DkimDomainSetup $dkimTextFile = '/etc/opendkim/keys/'.$domain.'/mail.txt'; if (is_file($dkimPrivateKeyFile)) { + + $dkimText = file_get_contents($dkimTextFile); + $dkimText = str_replace("\r\n", "\n", $dkimText); + return [ 'privateKey' => file_get_contents($dkimPrivateKeyFile), - 'text' => file_get_contents($dkimTextFile), + 'text' => $dkimText, ]; } @@ -25,6 +29,7 @@ class DkimDomainSetup $dkimPrivateKey = file_get_contents($dkimPrivateKeyFile); $dkimText = file_get_contents($dkimTextFile); + $dkimText = str_replace("\r\n", "\n", $dkimText); return [ 'privateKey' => $dkimPrivateKey, diff --git a/web/Modules/Email/resources/views/livewire/dkim-setup.blade.php b/web/Modules/Email/resources/views/livewire/dkim-setup.blade.php index 9f18cfa..2572102 100644 --- a/web/Modules/Email/resources/views/livewire/dkim-setup.blade.php +++ b/web/Modules/Email/resources/views/livewire/dkim-setup.blade.php @@ -8,7 +8,7 @@
@@ -39,15 +39,15 @@ @endif
- You do not have a DMARC record, please add a TXT record to your domain _dmarc.{{$mainDomain}} with the following value: + Please add DMARC TXT record to your domain _dmarc.{{$mainDomain}} with the following value:
v=DMARC1; p=none
- You do not have a SPF record, please add the following one to your domain {{$mainDomain}}: + Please add SPF record to your domain {{$mainDomain}}:
- v=spf1 a mx ip4:91.107.217.103 ~all + v=spf1 a mx ip4:{{$serverIp}} ~all