# HG changeset patch # User Matthias Förste foerste@schlittermann.de # Date 1323809106 -3600 # Node ID deadc72b7e6c819755c9d0aca57253a03f001b84 # Parent a41fd3429d6397c9c7f30a5ebd44e5068485a496 allow tracing the imap conversation; fixed 2 bugs diff -r a41fd3429d63 -r deadc72b7e6c acl.pm --- a/acl.pm Tue Dec 13 14:02:11 2011 +0100 +++ b/acl.pm Tue Dec 13 21:45:06 2011 +0100 @@ -87,6 +87,8 @@ die "IMAP Server does not advertise acl support" unless $imap->capability->{acl}; + $imap->set_tracing(1) if $ENV{TRACE}; + # requires an imap connection my $ns = $imap->namespace() or die "No public namespaces available: $@"; $nspat = []; @@ -149,7 +151,8 @@ or die "Can't create folder '$folder': $@" if $Cf->create; - for my $f ( @{ acl_folders($folder) } ) { + my @folders = @{ acl_folders($folder) } or die "Got empty folderlist - does '$folder' exist? (use --create if you want me to create it)"; + for my $f ( @folders ) { if ( $Cf->acl eq 'delete' ) { $imap->deleteacl( $f, $user ) or die "Can't delete acl: $@"; @@ -360,8 +363,8 @@ while ( $u = shift @{$perms} and $p = shift @{$perms} ) { # '#user' will be listed when we have a global acl for 'user' - my $gl = $u =~ /^#/ ? ' [global acl]' : ''; - my $gr = $u =~ /^\$/ ? ' [group acl]' : ''; + my $gl = $u =~ /^\$?#/ ? ' [global]' : ''; + my $gr = $u =~ /^#?\$/ ? ' [group]' : ''; $hasacl = 1; print "\t$u [$p]$gr$gl\n"; }