Added support for SPF

This commit is contained in:
Mr Sleeps
2026-07-02 01:48:06 +01:00
parent 1ef8f39c3b
commit 5859d1f17f
6 changed files with 111 additions and 106 deletions
@@ -301,6 +301,7 @@ class GenerateSpfPage extends Page
{
$data = $this->form->getState();
\Log::debug('SPF Form data:' . json_encode($data));
\Log::debug('Update dms state:' . $data['update_dns']);
// Generate the SPF record
$result = $spf->generate($this->domain, $data);
@@ -313,19 +314,20 @@ class GenerateSpfPage extends Page
// Log the generated record
\Log::debug('SPF Event data:', [
'zone' => $this->dnsName,
'name' => '_dmarc',
'name' => '',
'content' => $this->generatedRecord
]);
// Dispatch event
event(new \App\Events\SpfKeyGenerated(
zone: $this->dnsName,
name: '_dmarc',
type: 'TXT',
content: $this->generatedRecord,
ttl: (int) ($data['ttl'] ?? 3600),
operation: 'create'
));
if($data['update_dns']) {
event(new \App\Events\SpfRecordGenerated(
zone: $this->dnsName,
name: '',
type: 'TXT',
content: $this->generatedRecord,
ttl: (int) ($data['ttl'] ?? 3600),
operation: 'create'
));
};
// Show the modal with the generated record
$this->dispatch('open-modal', id: 'spf-record-modal');