diff --git a/app/Livewire/Ui/System/SettingsForm.php b/app/Livewire/Ui/System/SettingsForm.php index 24ea737..8e6f3c7 100644 --- a/app/Livewire/Ui/System/SettingsForm.php +++ b/app/Livewire/Ui/System/SettingsForm.php @@ -29,6 +29,10 @@ class SettingsForm extends Component private const SSL_STATE_DIR = '/var/lib/mailwolt/wizard'; + // Benachrichtigungen + public string $notify_sender_name = 'System Alert'; + public string $notify_admin_email = ''; + // Sicherheit public int $rate_limit = 5; public int $password_min = 10; @@ -52,8 +56,10 @@ class SettingsForm extends Component 'locale' => 'required|string|max:10', 'timezone' => 'required|string|max:64', 'session_timeout' => 'required|integer|min:5|max:1440', - 'rate_limit' => 'required|integer|min:1|max:100', - 'password_min' => 'required|integer|min:6|max:128', + 'notify_sender_name' => 'nullable|string|max:80', + 'notify_admin_email' => 'nullable|email|max:190', + 'rate_limit' => 'required|integer|min:1|max:100', + 'password_min' => 'required|integer|min:6|max:128', 'backup_enabled' => 'boolean', 'backup_preset' => 'required|in:hourly,daily,weekly,monthly,custom', 'backup_time' => 'required_unless:backup_preset,hourly,custom|regex:/^\d{1,2}:\d{2}$/', @@ -129,8 +135,10 @@ class SettingsForm extends Component } $this->loadSslStatus(); - $this->rate_limit = (int) Setting::get('rate_limit', $this->rate_limit); - $this->password_min = (int) Setting::get('password_min', $this->password_min); + $this->notify_sender_name = (string) Setting::get('notify_sender_name', $this->notify_sender_name); + $this->notify_admin_email = (string) Setting::get('notify_admin_email', $this->notify_admin_email); + $this->rate_limit = (int) Setting::get('rate_limit', $this->rate_limit); + $this->password_min = (int) Setting::get('password_min', $this->password_min); // Backup aus BackupPolicy laden $policy = BackupPolicy::first(); @@ -151,13 +159,20 @@ class SettingsForm extends Component $this->validate(); Setting::setMany([ - 'locale' => $this->locale, - 'timezone' => $this->timezone, - 'session_timeout' => $this->session_timeout, - 'rate_limit' => $this->rate_limit, - 'password_min' => $this->password_min, + 'locale' => $this->locale, + 'timezone' => $this->timezone, + 'session_timeout' => $this->session_timeout, + 'notify_sender_name' => $this->notify_sender_name, + 'notify_admin_email' => $this->notify_admin_email, + 'rate_limit' => $this->rate_limit, + 'password_min' => $this->password_min, ]); + // MAIL_FROM_NAME in .env synchronisieren + if ($this->notify_sender_name) { + $this->writeEnv(['MAIL_FROM_NAME' => $this->notify_sender_name]); + } + // Backup-Policy speichern $cron = $this->buildCron(); BackupPolicy::updateOrCreate([], [ diff --git a/database/seeders/SystemDomainSeeder.php b/database/seeders/SystemDomainSeeder.php index 562df38..c2166da 100644 --- a/database/seeders/SystemDomainSeeder.php +++ b/database/seeders/SystemDomainSeeder.php @@ -28,8 +28,8 @@ class SystemDomainSeeder extends Seeder $mtaSub = strtolower(env('MTA_SUB', 'mx') ?: 'mx'); // z.B. mx $systemSub = strtolower(config('mailpool.platform_system_zone') ?: 'sysmail'); // z.B. sysmail - $serverFqdn = strtolower("{$mtaSub}.{$platformBase}"); // mx.nexlab.at - $systemFqdn = strtolower("{$systemSub}.{$serverFqdn}"); // sysmail.mx.nexlab.at + $serverFqdn = strtolower("{$mtaSub}.{$platformBase}"); // mx.nexlab.at + $systemFqdn = strtolower("{$systemSub}.{$platformBase}"); // sysmail.nexlab.at // ========================================================================= // 1) MAILSERVER-DOMAIN zuerst (mx.), is_server = true diff --git a/resources/views/livewire/ui/system/settings-form.blade.php b/resources/views/livewire/ui/system/settings-form.blade.php index 75e930d..ae6a3d3 100644 --- a/resources/views/livewire/ui/system/settings-form.blade.php +++ b/resources/views/livewire/ui/system/settings-form.blade.php @@ -208,6 +208,38 @@ + {{-- Benachrichtigungen --}} +
+
+
+ Benachrichtigungen +
+
+
+
+
+ + +
Wird als Absender in System-Mails angezeigt
+
+
+ + +
Empfänger für Update- & Systemmeldungen
+
+
+ @php + $sysmailFqdn = \App\Models\Setting::get('notify_from_address') + ?: ('no-reply@' . config('mailpool.platform_system_zone','sysmail') . '.' . config('mailpool.platform_zone','')); + @endphp +
+ + Absenderadresse: + {{ $sysmailFqdn }} +
+
+
+ {{-- Sicherheit --}}