454 $imap->login( "$uid*" . $Cf->imap_admin, $imap_password ) or die $@; |
454 $imap->login( "$uid*" . $Cf->imap_admin, $imap_password ) or die $@; |
455 |
455 |
456 my %q; |
456 my %q; |
457 if ($imap->capability->{quota}) { |
457 if ($imap->capability->{quota}) { |
458 |
458 |
|
459 # prepare patterns for shared folders - we want to ignore them in |
|
460 # quota calculations (TODO: what happens if a user has/attempts to |
|
461 # create a folder with the name of a namespace? he could avoid |
|
462 # quota limits that way?) |
|
463 my $ns = $imap->namespace() or die $@; |
|
464 my @p = map qr{^\Q$_->[0]\E}, (@{$ns->[1]}, @{$ns->[2]}); |
|
465 |
459 my $folders = $imap->list( '', '*' ) or die $@; |
466 my $folders = $imap->list( '', '*' ) or die $@; |
460 |
467 |
461 for my $f ( @{$folders} ) { |
468 for my $f ( @{$folders} ) { |
462 |
469 |
463 # single folder sieht wie folgt aus: [[flag1, flag2, ...], separator, foldername] |
470 # single folder sieht wie folgt aus: [[flag1, flag2, ...], separator, foldername] |
464 next if '\\Noselect' ~~ $f->[0]; |
471 #next if '\\Noselect' ~~ $f->[0]; |
|
472 # ignore shared folders |
|
473 map { next if ( $f->[2] . $f->[1]) =~ $_ } @p; |
465 my $q = $imap->getquotaroot( $f->[2] ) |
474 my $q = $imap->getquotaroot( $f->[2] ) |
466 or $@ eq q{IMAP Command : 'getquotaroot' failed. Response was : no - Not showing other users' quota.} |
475 or $@ eq q{IMAP Command : 'getquotaroot' failed. Response was : no - Not showing other users' quota.} |
467 or die $@; |
476 or die $@; |
468 delete $q->{quotaroot}; |
477 delete $q->{quotaroot}; |
469 %q = ( %q, %{$q} ); |
478 %q = ( %q, %{$q} ); |