parent
8e68051fde
commit
821a2bde33
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue