Mail: Set domain for EHLO based upon the APP_URL

For #5990
This commit is contained in:
Dan Brown
2026-02-28 18:46:05 +00:00
parent 10c46534e0
commit ec3dd856db
2 changed files with 28 additions and 0 deletions

View File

@@ -65,6 +65,13 @@ class AppServiceProvider extends ServiceProvider
URL::forceScheme($isHttps ? 'https' : 'http');
}
// Set SMTP mail driver to use a local domain matching the app domain,
// which helps avoid defaulting to a 127.0.0.1 domain
if ($appUrl) {
$hostName = parse_url($appUrl, PHP_URL_HOST) ?: null;
config()->set('mail.mailers.smtp.local_domain', $hostName);
}
// Allow longer string lengths after upgrade to utf8mb4
Schema::defaultStringLength(191);