From f244805c012c5cf5826cca71f63f01e0cf9e1f61 Mon Sep 17 00:00:00 2001 From: Ilia Ross Date: Fri, 12 Jan 2024 13:34:13 +0200 Subject: [PATCH] Fix to default to `mail_location` https://forum.virtualmin.com/t/bug-in-webmin-dovecot-mail-files-config/124425?u=ilia --- dovecot/edit_mail.cgi | 6 +++--- dovecot/save_mail.cgi | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dovecot/edit_mail.cgi b/dovecot/edit_mail.cgi index d306055f3c..f102cc5098 100755 --- a/dovecot/edit_mail.cgi +++ b/dovecot/edit_mail.cgi @@ -10,11 +10,11 @@ print &ui_table_start($text{'mail_header'}, "width=100%", 4); # Mail file location. Old versions used default_mail_env, new uses mail_location $envmode = 4; -if (&find("mail_location", $conf, 2)) { - $env = &find_value("mail_location", $conf); +if (&find("default_mail_env", $conf, 2)) { + $env = &find_value("default_mail_env", $conf); } else { - $env = &find_value("default_mail_env", $conf); + $env = &find_value("mail_location", $conf); } if ($env =~ s/:INDEX=([^:]+)//) { $index = $1; diff --git a/dovecot/save_mail.cgi b/dovecot/save_mail.cgi index 57248b0201..023d5a6158 100755 --- a/dovecot/save_mail.cgi +++ b/dovecot/save_mail.cgi @@ -31,11 +31,11 @@ if ($in{'controlmode'}) { $env .= ":CONTROL=".$in{'control'}; } -if (&find("mail_location", $conf, 2)) { - &save_directive($conf, "mail_location", $env eq "" ? undef : $env); +if (&find("default_mail_env", $conf, 2)) { + &save_directive($conf, "default_mail_env", $env eq "" ? undef : $env); } else { - &save_directive($conf, "default_mail_env", $env eq "" ? undef : $env); + &save_directive($conf, "mail_location", $env eq "" ? undef : $env); } # Idle intervals