@opts = ( [ 'yes', $text{'yes'} ], [ 'no', $text{'no'} ] );
print &ui_table_row($text{'mail_last'},
&ui_radio("pop3_enable_last", $last,
- [ @opts,
- [ '', &getdef("pop3_enable_last", \@opts) ] ]), 3);
+ [ [ '', &getdef("pop3_enable_last", \@opts) ],
+ @opts ]), 3);
+ }
+
+# Index lock method
+if (&find("lock_method", $conf, 2)) {
+ $method = &find_value("lock_method", $conf);
+ @opts = map { [ $_, $text{'mail_'.$_} ] } &list_lock_methods(1);
+ print &ui_table_row($text{'mail_lock'},
+ &ui_select("lock_method", $method,
+ [ @opts,
+ [ '', &getdef("lock_method", \@opts) ] ],
+ 1, 0, 1), 3);
+ }
+
+# Mailbox lock methods
+@opts = map { [ $_, $text{'mail_'.$_} ] } &list_lock_methods(0);
+foreach $l ("mbox_read_locks", "mbox_write_locks") {
+ next if (!&find($l, $conf, 2));
+ $def = &find_value($l, $conf, 1);
+ $defmsg = join(", ", map { $text{'mail_'.$_} || $_ }
+ split(/\s+/, $def));
+ $defmsg = " ($defmsg)" if ($defmsg);
+ $method = &find_value($l, $conf);
+ $defsel = &ui_radio($l."_def", $method ? 0 : 1,
+ [ [ 1, $text{'default'}.$defmsg ],
+ [ 0, $text{'mail_sel'} ] ]);
+ $methsel = "";
+ @methods = split(/\s+/, $method);
+ for(my $i=0; $i<@opts; $i++) {
+ $methsel .= &ui_select($l."_".$i, $methods[$i],
+ [ [ '', "<$text{'mail_none'}>" ],
+ @opts ], 1, 0, 1);
+ }
+ print &ui_table_row($text{'mail_'.$l},
+ $defsel."<br>\n".$methsel, 3);
}
print &ui_table_end();
mail_uidl_tpop3d=tpop3d
mail_euidl=Missing or invalid UIDL format
mail_last=Allow use of POP3 LAST command?
+mail_lock=Index files locking method
+mail_fcntl=fcntl function
+mail_flock=flock function
+mail_dotlock=.lock files
+mail_lockf=lockf function
+mail_mbox_read_locks=Mailbox read locking method
+mail_mbox_write_locks=Mailbox write locking method
+mail_none=None
+mail_sel=Selected below, in order ..
+mail_embox_read_locks=No read locking methods selected
+mail_embox_write_locks=No write locking methods selected
log_net=Changed Networking and Protocols
log_login=Changed User and Login Options
&save_directive($conf, "pop3_enable_last",
$in{'last'} ? $in{'last'} : undef);
+# Index lock method
+if (&find("lock_method", $conf, 2)) {
+ &save_directive($conf, "lock_method",
+ $in{'lock_method'} ? $in{'lock_method'} : undef);
+ }
+
+# Mailbox lock method
+foreach $l ("mbox_read_locks", "mbox_write_locks") {
+ next if (!&find($l, $conf, 2));
+ if ($in{$l."_def"}) {
+ &save_directive($conf, $l, undef);
+ }
+ else {
+ @methods = ( );
+ for(my $i=0; defined($m = $in{$l."_".$i}); $i++) {
+ push(@methods, $m) if ($m);
+ }
+ @methods || &error($text{'mail_e'.$l});
+ &save_directive($conf, $l, join(" ", @methods));
+ }
+ }
+
&flush_file_lines();
&unlock_file($config{'dovecot_config'});
&webmin_log("mail");