show required dns entries to admin and customer for a domain if nameserver-feature is not used

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2024-06-22 12:43:09 +02:00
parent 820326a7e0
commit 0a3caa9f9b
6 changed files with 37 additions and 2 deletions

View File

@@ -91,7 +91,7 @@ class SysLog extends ApiCommand implements ResourceEntity
Database::pexecute($result_stmt, $query_fields, true, true);
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
// clean log-text
$row['text'] = preg_replace("/[^\w @#\"':.()\[\]+\-_\/\\\!]/i", "_", $row['text']);
$row['text'] = preg_replace("/[^\w @#\"':.,()\[\]+\-_\/\\\!]/i", "_", $row['text']);
$result[] = $row;
}
$this->logger()->logAction($this->isAdmin() ? FroxlorLogger::ADM_ACTION : FroxlorLogger::USR_ACTION, LOG_INFO, "[API] list log-entries");

View File

@@ -46,6 +46,7 @@ final class ConfigServices extends CliCommand
'bullseye',
'focal',
'jammy',
'noble',
];
protected function configure()

View File

@@ -446,7 +446,25 @@ return [
'desc' => lng('admin.bindzonewarning'),
'type' => 'text',
'value' => $result['zonefile']
]
],
'spf_entry' => [
'visible' => (Settings::Get('system.bind_enable') == '0' && Settings::Get('spf.use_spf') == '1' && $result['isemaildomain'] == '1'),
'label' => lng('antispam.required_spf_dns'),
'type' => 'longtext',
'value' => (string)(new \Froxlor\Dns\DnsEntry('@', 'TXT', \Froxlor\Dns\Dns::encloseTXTContent(Settings::Get('spf.spf_entry'))))
],
'dmarc_entry' => [
'visible' => (Settings::Get('system.bind_enable') == '0' && Settings::Get('dmarc.use_dmarc') == '1' && $result['isemaildomain'] == '1'),
'label' => lng('antispam.required_dmarc_dns'),
'type' => 'longtext',
'value' => (string)(new \Froxlor\Dns\DnsEntry('_dmarc', 'TXT', \Froxlor\Dns\Dns::encloseTXTContent(Settings::Get('dmarc.dmarc_entry'))))
],
'dkim_entry' => [
'visible' => (Settings::Get('system.bind_enable') == '0' && Settings::Get('antispam.activated') == '1' && $result['dkim'] == '1' && $result['dkim_pubkey'] != ''),
'label' => lng('antispam.required_dkim_dns'),
'type' => 'longtext',
'value' => (string)(new \Froxlor\Dns\DnsEntry('dkim' . $result['dkim_id'] . '._domainkey', 'TXT', \Froxlor\Dns\Dns::encloseTXTContent('v=DKIM1; k=rsa; p='.trim($result['dkim_pubkey']))))
],
]
]
]

View File

@@ -116,6 +116,18 @@ return [
'type' => 'hidden',
'value' => '0'
],
'spf_entry' => [
'visible' => (Settings::Get('system.bind_enable') == '0' && Settings::Get('spf.use_spf') == '1' && $result['isemaildomain'] == '1'),
'label' => lng('antispam.required_spf_dns'),
'type' => 'longtext',
'value' => (string)(new \Froxlor\Dns\DnsEntry('@', 'TXT', \Froxlor\Dns\Dns::encloseTXTContent(Settings::Get('spf.spf_entry'))))
],
'dmarc_entry' => [
'visible' => (Settings::Get('system.bind_enable') == '0' && Settings::Get('dmarc.use_dmarc') == '1' && $result['isemaildomain'] == '1'),
'label' => lng('antispam.required_dmarc_dns'),
'type' => 'longtext',
'value' => (string)(new \Froxlor\Dns\DnsEntry('_dmarc', 'TXT', \Froxlor\Dns\Dns::encloseTXTContent(Settings::Get('dmarc.dmarc_entry'))))
],
'dkim_entry' => [
'visible' => (Settings::Get('system.bind_enable') == '0' && Settings::Get('antispam.activated') == '1' && $result['dkim'] == '1' && $result['dkim_pubkey'] != ''),
'label' => lng('antispam.required_dkim_dns'),

View File

@@ -632,6 +632,8 @@ return [
'title' => 'Verwende greylisting',
'description' => 'Eingehende E-Mails mittels <a href="https://de.wikipedia.org/wiki/Greylisting" target="_blank">Greylisting</a> schützen.<br/>Standard: Ja'
],
'required_spf_dns' => 'Erforderlicher SPF DNS Eintrag',
'required_dmarc_dns' => 'Erforderlicher DMARC DNS Eintrag',
'required_dkim_dns' => 'Erforderlicher DKIM DNS Eintrag',
],
'dns' => [

View File

@@ -681,6 +681,8 @@ return [
'title' => 'Use greylisting',
'description' => 'Incoming emails will be protected by <a href="https://en.wikipedia.org/wiki/Greylisting_(email)" target="_blank">greylisting</a>.<br/>Default: yes'
],
'required_spf_dns' => 'Required SPF DNS entry',
'required_dmarc_dns' => 'Required DMARC DNS entry',
'required_dkim_dns' => 'Required DKIM DNS entry',
],
'dns' => [