Support mail_location
authorJamie Cameron <jcameron@webmin.com>
Mon, 27 Aug 2007 17:12:19 +0000 (17:12 +0000)
committerJamie Cameron <jcameron@webmin.com>
Mon, 27 Aug 2007 17:12:19 +0000 (17:12 +0000)
dovecot/CHANGELOG
dovecot/edit_mail.cgi
dovecot/save_mail.cgi

index bb8b024..0ffdd43 100644 (file)
@@ -10,3 +10,5 @@ Added support for the new configuration file format in Dovecot 1.0 alpha.
 Fixed a bug that causes config file corruption in the userdb section with the default Ubuntu config.
 ---- Changes since 1.330 ----
 Added fields for editing the UIDL format and number of login processes.
+---- Changes since 1.360 ----
+Supported newer versions of Dovecot which use mail_location instead of default_mail_env.
index 9b04d09..779cc78 100755 (executable)
@@ -8,9 +8,14 @@ $conf = &get_config();
 print &ui_form_start("save_mail.cgi", "post");
 print &ui_table_start($text{'mail_header'}, "width=100%", 4);
 
-# Mail file location
+# Mail file location. Old versions used default_mail_env, new uses mail_location
 $envmode = 4;
-$env = &find_value("default_mail_env", $conf);
+if (&find("mail_location", $conf, 2)) {
+       $env = &find_value("mail_location", $conf);
+       }
+else {
+       $env = &find_value("default_mail_env", $conf);
+       }
 for($i=0; $i<@mail_envs; $i++) {
        $envmode = $i if ($mail_envs[$i] eq $env);
        }
index 2b9c77b..83102eb 100755 (executable)
@@ -15,7 +15,12 @@ if ($in{'envmode'} == 4) {
 else {
        $env = $mail_envs[$in{'envmode'}];
        }
-&save_directive($conf, "default_mail_env", $env eq "" ? undef : $env);
+if (&find("mail_location", $conf, 2)) {
+       &save_directive($conf, "mail_location", $env eq "" ? undef : $env);
+       }
+else {
+       &save_directive($conf, "default_mail_env", $env eq "" ? undef : $env);
+       }
 
 # Check and idle intervals
 $in{'check'} != 2 || $in{'checki'} =~ /^\d+$/ || &error($text{'mail_echeck'});