Rechtebechebung für User mit Sudorechte
parent
98ccb68a34
commit
28129cb989
|
|
@ -17,9 +17,12 @@ class DkimService
|
||||||
{
|
{
|
||||||
$selector = $selector ?: (string) config('mailpool.defaults.dkim_selector', 'mwl1');
|
$selector = $selector ?: (string) config('mailpool.defaults.dkim_selector', 'mwl1');
|
||||||
|
|
||||||
$dirKey = $this->safeKey($domain->domain);
|
// $dirKey = $this->safeKey($domain->domain);
|
||||||
$selKey = $this->safeKey($selector, 32);
|
// $selKey = $this->safeKey($selector, 32);
|
||||||
|
|
||||||
|
$dirKey = $this->dirKeyFor($domain);
|
||||||
|
$selKey = preg_replace('/[^A-Za-z0-9._-]/', '_', substr($selector, 0, 32)); // schlicht & stabil
|
||||||
|
|
||||||
// Disk "local" zeigt bei dir auf storage/app/private (siehe Kommentar in deinem Code)
|
// Disk "local" zeigt bei dir auf storage/app/private (siehe Kommentar in deinem Code)
|
||||||
$disk = Storage::disk('local');
|
$disk = Storage::disk('local');
|
||||||
$baseRel = "dkim/{$dirKey}";
|
$baseRel = "dkim/{$dirKey}";
|
||||||
|
|
@ -145,6 +148,17 @@ class DkimService
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function dirKeyFor(Domain $domain, int $max = 64): string
|
||||||
|
{
|
||||||
|
$raw = $domain->domain; // <<< WICHTIG: Domain-String, NICHT die ID!
|
||||||
|
$san = preg_replace('/[^A-Za-z0-9._-]/', '_', $raw);
|
||||||
|
if ($san === '') $san = 'unknown';
|
||||||
|
if (strlen($san) > $max) {
|
||||||
|
$san = substr($san, 0, $max - 13) . '_' . substr(sha1($raw), 0, 12);
|
||||||
|
}
|
||||||
|
return $san;
|
||||||
|
}
|
||||||
|
|
||||||
protected function safeKey($value, int $max = 64): string
|
protected function safeKey($value, int $max = 64): string
|
||||||
{
|
{
|
||||||
if (is_object($value)) {
|
if (is_object($value)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue