Fix: DNS-Modal zeigt .. statt MTA-FQDN wenn env() gecacht ist

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 <noreply@anthropic.com>
main v1.1.377
boban 2026-04-27 00:33:31 +02:00
parent 486166c05a
commit 8a546f4f3d
2 changed files with 9 additions and 4 deletions

View File

@ -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',

View File

@ -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 %