This commit is contained in:
Bozhidar 2024-10-03 13:07:23 +03:00
parent 732606270a
commit 371619c6d3
3 changed files with 11 additions and 5 deletions

View file

@ -21,6 +21,7 @@ class DkimSetup extends Component
'secure' => $secure, 'secure' => $secure,
'verify' => $verify, 'verify' => $verify,
'mainDomain' => $mainDomain, 'mainDomain' => $mainDomain,
'serverIp' => $_SERVER['SERVER_ADDR'],
]); ]);
} }

View file

@ -11,9 +11,13 @@ class DkimDomainSetup
$dkimTextFile = '/etc/opendkim/keys/'.$domain.'/mail.txt'; $dkimTextFile = '/etc/opendkim/keys/'.$domain.'/mail.txt';
if (is_file($dkimPrivateKeyFile)) { if (is_file($dkimPrivateKeyFile)) {
$dkimText = file_get_contents($dkimTextFile);
$dkimText = str_replace("\r\n", "\n", $dkimText);
return [ return [
'privateKey' => file_get_contents($dkimPrivateKeyFile), 'privateKey' => file_get_contents($dkimPrivateKeyFile),
'text' => file_get_contents($dkimTextFile), 'text' => $dkimText,
]; ];
} }
@ -25,6 +29,7 @@ class DkimDomainSetup
$dkimPrivateKey = file_get_contents($dkimPrivateKeyFile); $dkimPrivateKey = file_get_contents($dkimPrivateKeyFile);
$dkimText = file_get_contents($dkimTextFile); $dkimText = file_get_contents($dkimTextFile);
$dkimText = str_replace("\r\n", "\n", $dkimText);
return [ return [
'privateKey' => $dkimPrivateKey, 'privateKey' => $dkimPrivateKey,

View file

@ -39,15 +39,15 @@
@endif @endif
<div> <div>
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:
<br /> <br />
v=DMARC1; p=none v=DMARC1; p=none
</div> </div>
<div> <div>
You do not have a SPF record, please add the following one to your domain {{$mainDomain}}: Please add SPF record to your domain {{$mainDomain}}:
<br /> <br />
v=spf1 a mx ip4:91.107.217.103 ~all v=spf1 a mx ip4:{{$serverIp}} ~all
</div> </div>
<x-filament::button wire:click="verify"> <x-filament::button wire:click="verify">