mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 14:13:29 +00:00
Fix support for index and control files location with Dovecot 2.4
This commit is contained in:
@@ -22,9 +22,15 @@ else {
|
||||
if ($env =~ s/:INDEX=([^:]+)//) {
|
||||
$index = $1;
|
||||
}
|
||||
elsif (&find("mail_index_path", $conf, 2)) {
|
||||
$index = &find_value("mail_index_path", $conf);
|
||||
}
|
||||
if ($env =~ s/:CONTROL=([^:]+)//) {
|
||||
$control = $1;
|
||||
}
|
||||
elsif (&find("mail_cache_path", $conf, 2)) {
|
||||
$control = &find_value("mail_cache_path", $conf);
|
||||
}
|
||||
for($i=0; $i<@mail_envs; $i++) {
|
||||
$envmode = $i if ($mail_envs[$i] eq $env);
|
||||
}
|
||||
|
||||
@@ -17,19 +17,42 @@ else {
|
||||
}
|
||||
|
||||
# Add index file location
|
||||
$env || !$in{'indexmode'} || &error($text{'mail_eindexmode'});
|
||||
$env || !$in{'controlmode'} || &error($text{'mail_econtrolmode'});
|
||||
if ($in{'indexmode'} == 1) {
|
||||
if (&version_below("2.4")) {
|
||||
$env || !$in{'indexmode'} || &error($text{'mail_eindexmode'});
|
||||
$env || !$in{'controlmode'} || &error($text{'mail_econtrolmode'});
|
||||
if ($in{'indexmode'} == 1) {
|
||||
$env .= ":INDEX=MEMORY";
|
||||
}
|
||||
elsif ($in{'indexmode'} == 2) {
|
||||
elsif ($in{'indexmode'} == 2) {
|
||||
$in{'index'} =~ /^\/\S+$/ || &error($text{'mail_eindex'});
|
||||
$env .= ":INDEX=".$in{'index'};
|
||||
}
|
||||
if ($in{'controlmode'}) {
|
||||
if ($in{'controlmode'}) {
|
||||
$in{'control'} =~ /^\/\S+$/ || &error($text{'mail_econtrol'});
|
||||
$env .= ":CONTROL=".$in{'control'};
|
||||
}
|
||||
}
|
||||
else {
|
||||
# Parse index and control first
|
||||
if ($in{'indexmode'} == 1) {
|
||||
$index = "MEMORY";
|
||||
}
|
||||
elsif ($in{'indexmode'} == 2) {
|
||||
$in{'index'} =~ /^\/\S+$/ || $in{'index'} =~ /^~\S+$/ ||
|
||||
&error($text{'mail_eindex'});
|
||||
$index = $in{'index'};
|
||||
}
|
||||
if ($in{'controlmode'}) {
|
||||
$in{'control'} =~ /^\/\S+$/ || $in{'control'} =~ /^~\S+$/ ||
|
||||
&error($text{'mail_econtrol'});
|
||||
$control = $in{'control'};
|
||||
}
|
||||
# Directly save dedicated mail_cache_path and mail_index_path
|
||||
&save_directive($conf, "mail_index_path",
|
||||
$index eq "" ? undef : $index);
|
||||
&save_directive($conf, "mail_cache_path",
|
||||
$control eq "" ? undef : $control);
|
||||
}
|
||||
|
||||
if (&find("default_mail_env", $conf, 2)) {
|
||||
&save_directive($conf, "default_mail_env", $env eq "" ? undef : $env);
|
||||
|
||||
Reference in New Issue
Block a user