Support mail_location

This commit is contained in:
Jamie Cameron
2007-08-27 17:12:19 +00:00
parent 90b8eb1cc1
commit df54bbb51b
3 changed files with 15 additions and 3 deletions

View 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.

View File

@@ -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);
}

View File

@@ -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'});