account.pm
branchfoerste
changeset 43 231984cb81a7
parent 42 b90dc89e8c66
child 45 5f7c647f7cc4
equal deleted inserted replaced
42:b90dc89e8c66 43:231984cb81a7
   411 
   411 
   412 	#if (($e->get_value("iusRestrictedMail")||"") eq "TRUE") {
   412 	#if (($e->get_value("iusRestrictedMail")||"") eq "TRUE") {
   413 	    #print " INTERNAL";
   413 	    #print " INTERNAL";
   414 	#}
   414 	#}
   415 
   415 
       
   416 
   416         $imap->login("$uid*" . $Cf->imap_admin, $imap_password ) or die $@;
   417         $imap->login("$uid*" . $Cf->imap_admin, $imap_password ) or die $@;
   417         my $m = $imap->list('', '*') or die $@;
   418         my $folders = $imap->list('', '*') or die $@;
   418         use Data::Dumper;
   419         my %q;
   419 verbose Dumper $m;
   420         for my $f(@{$folders}) {
   420         my $q = $imap->getquotaroot($m->[0]->[2]) or die $@;
   421             # single folder sieht wie folgt aus: [[flag1, flag2, ...], separator, foldername]
   421 verbose Dumper $q;
   422             my $q = $imap->getquotaroot($f->[2]) or die $@;
   422         $q = $imap->getquota($m->[0]->[2]) or die $@;
   423             delete $q->{quotaroot};
   423 verbose Dumper $q;
   424             %q = ( %q, %{$q} );
   424 
   425         }
   425 	MBOX: {
   426 
   426 	    if (!$imap->list()) {
   427         # da wir uns anmelden konnten haben wir auch eine 'mbox'
   427 		print ", no mbox";
   428         print ", mbox";
   428 		last MBOX;
   429         my $has_quota;
   429 	    }
   430         for my $qr(keys %q) {
   430 	    print ", mbox";
   431             my @q = @{$q{$qr}};
   431 	    my %q = $imap->listquota();
   432             my $elem = '';
   432 	    my ($used, $max) = map { int($_ / 1024) } @{$q{STORAGE}};
   433             $elem = shift @q while defined $elem and $elem ne 'STORAGE';
   433 
   434             my ($used, $max) = map { int($_ / 1024) } @q[0..1];
   434 	    if (!$max) {
   435             print ", quota '$qr': $used/${max}MB " . int(100 * $used/$max) . "%";
   435 		print ", no quota";
   436             $has_quota = 1;
   436 		last MBOX;
   437         }
   437 	    }
   438         print ", no quota" unless $has_quota;
   438 	    print ", quota ($used/$max): " . int(100 * $used/$max) . "%";
       
   439 	}
       
   440 	print "\n";
   439 	print "\n";
   441 
   440 
   442 	print "\tPassword: ", $> == 0 ? $e->get_value("userPassword") : "*", "\n";
   441 	print "\tPassword: ", $> == 0 ? $e->get_value("userPassword") : "*", "\n";
   443 	
   442 	
   444 	print  wrap("\t", "\t\t", "Other Adresses: $ml\n") if $ml;
   443 	print  wrap("\t", "\t\t", "Other Adresses: $ml\n") if $ml;