Fix: Dovecot24-Migration ergänzt mail_location → mail_driver + mail_path
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>main v1.1.388
parent
4671909e14
commit
ea7dc3b94d
|
|
@ -19,7 +19,10 @@ class MigrateDovecot24 extends Command
|
|||
// 2) 10-auth.conf: disable_plaintext_auth → auth_allow_cleartext
|
||||
$this->fixAuthConf($dry);
|
||||
|
||||
// 3) auth-sql.conf.ext: neue passdb/userdb-Syntax
|
||||
// 3) 10-mail.conf: mail_location → mail_driver + mail_path
|
||||
$this->fixMailConf($dry);
|
||||
|
||||
// 4) auth-sql.conf.ext: neue passdb/userdb-Syntax
|
||||
$this->fixAuthSqlConf($dry);
|
||||
|
||||
if (!$dry) {
|
||||
|
|
@ -56,6 +59,27 @@ class MigrateDovecot24 extends Command
|
|||
$this->info(" aktualisiert: {$file}");
|
||||
}
|
||||
|
||||
private function fixMailConf(bool $dry): void
|
||||
{
|
||||
$file = '/etc/dovecot/conf.d/10-mail.conf';
|
||||
$content = @file_get_contents($file);
|
||||
if ($content === false) { $this->warn("Nicht gefunden: {$file}"); return; }
|
||||
|
||||
$new = preg_replace_callback(
|
||||
'/^mail_location\s*=\s*(\w+):(.+)$/m',
|
||||
function ($m) {
|
||||
return "mail_driver = {$m[1]}\nmail_path = {$m[2]}";
|
||||
},
|
||||
$content
|
||||
);
|
||||
|
||||
if ($new === $content) { $this->line(" ok (unverändert): {$file}"); return; }
|
||||
|
||||
if ($dry) { $this->line(" [dry-run] würde mail_location aufteilen in {$file}"); return; }
|
||||
file_put_contents($file, $new);
|
||||
$this->info(" aktualisiert: {$file}");
|
||||
}
|
||||
|
||||
private function fixAuthConf(bool $dry): void
|
||||
{
|
||||
$file = '/etc/dovecot/conf.d/10-auth.conf';
|
||||
|
|
|
|||
Loading…
Reference in New Issue