From 8a546f4f3deb0ff2abfa070bbea2f5d80c81aa20 Mon Sep 17 00:00:00 2001 From: boban Date: Mon, 27 Apr 2026 00:33:31 +0200 Subject: [PATCH] Fix: DNS-Modal zeigt .. statt MTA-FQDN wenn env() gecacht ist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit env('MTA_SUB') und env('BASE_DOMAIN') liefern null bei config:cache. Jetzt: Setting::get('mail_domain') als primäre Quelle, config() als Fallback. MTA_SUB in mailpool.php als config-Key ergänzt. Co-Authored-By: Claude Sonnet 4.6 --- app/Livewire/Ui/Domain/Modal/DomainDnsModal.php | 12 ++++++++---- config/mailpool.php | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/Livewire/Ui/Domain/Modal/DomainDnsModal.php b/app/Livewire/Ui/Domain/Modal/DomainDnsModal.php index fea3170..722be57 100644 --- a/app/Livewire/Ui/Domain/Modal/DomainDnsModal.php +++ b/app/Livewire/Ui/Domain/Modal/DomainDnsModal.php @@ -62,9 +62,13 @@ class DomainDnsModal extends ModalComponent $ipv6 = $ips['ipv6']; $this->zone = $this->extractZone($d->domain); - $mta_sub = env('MTA_SUB'); - $base = env('BASE_DOMAIN'); - $mailServerFqdn = "{$mta_sub}.{$base}"; + + // Setting::get('mail_domain') liefert den vollen MTA-FQDN (z.B. mail.example.com) + // Fallback auf config-Werte, die env() sicher kapseln + $mailDomainSetting = strtolower(trim((string) \App\Models\Setting::get('mail_domain', ''))); + $mta_sub = config('mailpool.mta_sub', 'mail'); + $base = config('mailpool.platform_zone', 'example.com'); + $mailServerFqdn = $mailDomainSetting ?: "{$mta_sub}.{$base}"; // --- Infrastruktur (global) --- $this->static = [ @@ -167,7 +171,7 @@ class DomainDnsModal extends ModalComponent // --- Komfort / Web --- [ 'type' => 'CNAME', - 'name' => env('WEBMAIL_SUB') . ".{$this->domainName}", + 'name' => (config('mailwolt.domain.webmail') ?: env('WEBMAIL_SUB', 'webmail')) . ".{$this->domainName}", 'value' => "{$mailServerFqdn}.", 'helpLabel' => 'Webmail Alias', 'helpUrl' => 'https://en.wikipedia.org/wiki/CNAME_record', diff --git a/config/mailpool.php b/config/mailpool.php index 384d613..628710a 100644 --- a/config/mailpool.php +++ b/config/mailpool.php @@ -3,6 +3,7 @@ return [ 'platform_zone' => env('BASE_DOMAIN', 'example.com'), 'platform_system_zone' => env('SYSMAIL_SUB', 'sysmail'), + 'mta_sub' => env('MTA_SUB', 'mail'), 'fixed_reserve_mb' => env('MAILPOOL_FIXED_RESERVE_MB', 2048), // 2 GB 'percent_reserve' => env('MAILPOOL_PERCENT_RESERVE', 10), // 10 %