parent
8e68051fde
commit
821a2bde33
|
|
@ -31,7 +31,6 @@ if (!function_exists('webmail_host')) {
|
|||
if (!function_exists('mta_host')) {
|
||||
function mta_host(?int $domainId = null): string
|
||||
{
|
||||
// 1️⃣ Vorrang: Datenbankwert (z. B. aus der domains-Tabelle)
|
||||
if ($domainId) {
|
||||
try {
|
||||
$domain = \App\Models\Domain::find($domainId);
|
||||
|
|
@ -39,11 +38,10 @@ if (!function_exists('mta_host')) {
|
|||
return $domain->mta_host;
|
||||
}
|
||||
} 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');
|
||||
if ($sub) {
|
||||
return domain_host($sub);
|
||||
|
|
|
|||
Loading…
Reference in New Issue