Fix: Mailbox Stats über Dovecot mit config/mailpool.php

main v1.0.135
boban 2025-11-08 12:43:52 +01:00
parent 8e68051fde
commit 821a2bde33
1 changed files with 1 additions and 3 deletions

View File

@ -31,7 +31,6 @@ if (!function_exists('webmail_host')) {
if (!function_exists('mta_host')) { if (!function_exists('mta_host')) {
function mta_host(?int $domainId = null): string function mta_host(?int $domainId = null): string
{ {
// 1⃣ Vorrang: Datenbankwert (z. B. aus der domains-Tabelle)
if ($domainId) { if ($domainId) {
try { try {
$domain = \App\Models\Domain::find($domainId); $domain = \App\Models\Domain::find($domainId);
@ -39,11 +38,10 @@ if (!function_exists('mta_host')) {
return $domain->mta_host; return $domain->mta_host;
} }
} catch (\Throwable $e) { } catch (\Throwable $e) {
// DB evtl. noch nicht migriert — fallback auf env // DB evtl. noch nicht migriert — fallback auf env
} }
} }
// 2⃣ ENV-Variante (z. B. MTA_SUB=mail01)
$sub = env('MTA_SUB'); $sub = env('MTA_SUB');
if ($sub) { if ($sub) {
return domain_host($sub); return domain_host($sub);