Add support for Dovecot 2.4 in "Mail Files" page

This commit is contained in:
Ilia Ross
2025-09-01 19:49:47 +03:00
parent 0885a17f55
commit 156cb80104
2 changed files with 14 additions and 8 deletions

View File

@@ -30,7 +30,8 @@ for($i=0; $i<@mail_envs; $i++) {
}
print &ui_table_row($text{'mail_env'},
&ui_radio("envmode", $envmode,
[ ( map { [ $_, $text{'mail_env'.$_}."<br>" ] } (0.. 3) ),
[ ( map { [ $_, $text{'mail_env'.$_}."<br>" ] } (
&version_atleast("2.4") ? (0) : (0 .. 3)) ),
[ 4, &text('mail_env4',
&ui_textbox("other", $envmode == 4 ? $env : undef, 40)) ] ],
), 3);
@@ -106,9 +107,11 @@ print &ui_table_row($text{'mail_change'},
[ "", &getdef($dirty, \@opts) ] ]), 3);
# Permissions on files
$umask = &find_value("umask", $conf);
print &ui_table_row($text{'mail_umask'},
&ui_opt_textbox("umask", $umask, 5, &getdef("umask")), 3);
if (&version_atmost("2")) {
$umask = &find_value("umask", $conf);
print &ui_table_row($text{'mail_umask'},
&ui_opt_textbox("umask", $umask, 5, &getdef("umask")), 3);
}
# Allow POP3 last command
if (&find("pop3_enable_last", $conf, 2)) {

View File

@@ -66,10 +66,13 @@ else {
$in{'change'} ? $in{'change'} : undef);
}
# Umask
$in{'umask_def'} || $in{'umask'} =~ /^[0-7]{4}$/ ||&error($text{'mail_eumask'});
&save_directive($conf, "umask",
$in{'umask_def'} ? undef : $in{'umask'});
if (&version_atmost("2")) {
# Umask
$in{'umask_def'} || $in{'umask'} =~ /^[0-7]{4}$/ ||
&error($text{'mail_eumask'});
&save_directive($conf, "umask",
$in{'umask_def'} ? undef : $in{'umask'});
}
# LAST command
&save_directive($conf, "pop3_enable_last",