IMAP folder separator option

This commit is contained in:
Jamie Cameron
2008-11-28 16:43:56 +00:00
parent 588d8b4efc
commit 19fd0e793a
17 changed files with 24 additions and 7 deletions

View File

@@ -61,3 +61,5 @@ Added support for LDAP SSHA passwords, thanks to Bill Moyers and John Gray.
---- Changes since 1.430 ----
The order of the first name and surname in the real name can be changed by a new Module Config setting.
Coverted all pages to use the new Webmin UI library, for a more consistent look. Also updated the groups chooser to use a left-right selector.
---- Changes since 1.440 ----
Added a Module Config option to allow / as an IMAP folder separator, thanks to Bas van den Heuvel.

View File

@@ -18,3 +18,4 @@ alias_same=0
given_class=inetOrgPerson
person=1
given_order=0
imap_foldersep=.

View File

@@ -18,3 +18,4 @@ alias_same=0
given_class=inetOrgPerson
person=1
given_order=0
imap_foldersep=.

View File

@@ -17,3 +17,4 @@ alias_same=0
given_class=inetOrgPerson
person=1
given_order=0
imap_foldersep=.

View File

@@ -17,3 +17,4 @@ alias_same=0
given_class=inetOrgPerson
person=1
given_order=0
imap_foldersep=.

View File

@@ -17,3 +17,4 @@ alias_same=0
given_class=inetOrgPerson
person=1
given_order=0
imap_foldersep=.

View File

@@ -17,3 +17,4 @@ alias_same=0
other_class=inetOrgPerson
person=1
given_order=0
imap_foldersep=.

View File

@@ -23,3 +23,4 @@ alias_same=0
given_class=inetOrgPerson
person=1
given_order=0
imap_foldersep=.

View File

@@ -18,3 +18,4 @@ alias_same=0
given_class=inetOrgPerson
person=1
given_order=0
imap_foldersep=.

View File

@@ -17,3 +17,4 @@ alias_same=0
given_class=inetOrgPerson
person=1
given_order=0
imap_foldersep=.

View File

@@ -17,3 +17,4 @@ alias_same=0
given_class=inetOrgPerson
person=1
given_order=0
imap_foldersep=.

View File

@@ -17,3 +17,4 @@ alias_same=0
given_class=inetOrgPerson
person=1
given_order=0
imap_foldersep=.

View File

@@ -17,3 +17,4 @@ alias_same=0
given_class=inetOrgPerson
person=1
given_order=0
imap_foldersep=.

View File

@@ -17,3 +17,4 @@ alias_same=0
given_class=inetOrgPerson
person=1
given_order=0
imap_foldersep=.

View File

@@ -17,3 +17,4 @@ alias_same=0
given_class=inetOrgPerson
person=1
given_order=0
imap_foldersep=.

View File

@@ -72,6 +72,7 @@ imap_pass=Administration password for IMAP server,0
imap_props=LDAP properties for new IMAP users,9,40,5,\t
imap_folders=Folders to create for new IMAP users,9,30,3,\t
imap_folderalt=Path for folders,1,1-user.$user.$folder,0-$folder
imap_foldersep=Folder separator,1,.-.,/-/
domain=Email domain for mail attribute,0,Don't add mail attributes
mailfmt=Email address format,1,0-firstname.surname@domain,1-username@domain
addressbook=Address book base,3,None

View File

@@ -871,26 +871,26 @@ local ($user, $quota) = @_;
# Check if the user already exists
local $imap = &imap_connect();
local $rv = $imap->status("user.".$user->{'user'}, "messages");
local $rv = $imap->status("user".$user{'imap_foldersep'}.$user->{'user'}, "messages");
if ($rv->{'Status'} eq 'ok') {
# Already exists, so do nothing
$imap->logout();
}
else {
# Create the user on the IMAP server
$rv = $imap->create("user.".$user->{'user'});
$rv = $imap->create("user".$config{'imap_foldersep'}.$user->{'user'});
$rv->{'Status'} eq 'ok' ||
&imap_error($text{'usave_eicreate'}, $rv);
# Grant all rights to admin user
$rv = $imap->setacl("user.".$user->{'user'},
$rv = $imap->setacl("user".$config{'imap_foldersep'}.$user->{'user'},
$config{'imap_login'}, "lrswipcda");
$rv->{'Status'} eq 'ok' ||
&imap_error($text{'usave_eiacl'}, $rv);
if (defined($quota)) {
# Set his IMAP quota
$rv = $imap->setquota("user.".$user->{'user'},
$rv = $imap->setquota("user".$config{'imap_foldersep'}.$user->{'user'},
"STORAGE", $quota);
$rv->{'Status'} eq 'ok' ||
&imap_error($text{'usave_eiquota'}, $rv);
@@ -909,7 +909,7 @@ else {
foreach $f (split(/\t+/, $config{'imap_folders'})) {
local $fp = $config{'imap_folderalt'} ?
"user.$user->{'user'}.$f" : $f;
"user$config{'imap_foldersep'}$user->{'user'}$config{'imap_foldersep'}$f" : $f;
$rv = $uimap->create($fp);
$rv->{'Status'} eq 'ok' ||
&imap_error(&text('usave_eifolder',$f),$rv);
@@ -933,10 +933,10 @@ local ($user, $quota) = @_;
# Check if the user already exists
local $imap = &imap_connect();
local $rv = $imap->status("user.".$user->{'user'}, "messages");
local $rv = $imap->status("user".$config{'imap_foldersep'}.$user->{'user'}, "messages");
if ($rv->{'Status'} eq 'ok') {
# Set his IMAP quota
$rv = $imap->setquota("user.".$user->{'user'},
$rv = $imap->setquota("user".$config{'imap_foldersep'}.$user->{'user'},
"STORAGE", $quota);
$rv->{'Status'} eq 'ok' ||
&imap_error($text{'usave_eiquota'}, $rv);