diff --git a/dovecot/CHANGELOG b/dovecot/CHANGELOG index bb8b024cf..0ffdd4355 100644 --- a/dovecot/CHANGELOG +++ b/dovecot/CHANGELOG @@ -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. diff --git a/dovecot/edit_mail.cgi b/dovecot/edit_mail.cgi index 9b04d09fc..779cc7821 100755 --- a/dovecot/edit_mail.cgi +++ b/dovecot/edit_mail.cgi @@ -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); } diff --git a/dovecot/save_mail.cgi b/dovecot/save_mail.cgi index 2b9c77bc2..83102ebbe 100755 --- a/dovecot/save_mail.cgi +++ b/dovecot/save_mail.cgi @@ -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'});