|
|
|
@ -16,19 +16,21 @@ my $event = $ARGV[0]; |
|
|
|
|
|
|
|
|
|
# SharedMailboxes disabled ? |
|
|
|
|
if (($dovecot->prop('SharedMailbox') || 'disabled') eq 'disabled'){ |
|
|
|
|
foreach my $user ($a->users){ |
|
|
|
|
my $name = $user->key; |
|
|
|
|
die "Error removing SharedMailbox ACLs ($name"."'s Maildir)\n" unless ( |
|
|
|
|
system('/usr/bin/setfacl', |
|
|
|
|
'-R', |
|
|
|
|
'-x', |
|
|
|
|
'g:sharedmailbox', |
|
|
|
|
"/home/e-smith/files/users/$name") == 0 && |
|
|
|
|
system('/bin/chmod', |
|
|
|
|
'-R', |
|
|
|
|
'g-s', |
|
|
|
|
"/home/e-smith/files/users/$name/Maildir") == 0 |
|
|
|
|
); |
|
|
|
|
if (($dovecot->prop('SharedMailboxAcl') || 'yes') ne 'no'){ |
|
|
|
|
foreach my $user ($a->users){ |
|
|
|
|
my $name = $user->key; |
|
|
|
|
die "Error removing SharedMailbox ACLs ($name"."'s Maildir)\n" unless ( |
|
|
|
|
system('/usr/bin/setfacl', |
|
|
|
|
'-R', |
|
|
|
|
'-x', |
|
|
|
|
'g:sharedmailbox', |
|
|
|
|
"/home/e-smith/files/users/$name") == 0 && |
|
|
|
|
system('/bin/chmod', |
|
|
|
|
'-R', |
|
|
|
|
'g-s', |
|
|
|
|
"/home/e-smith/files/users/$name/Maildir") == 0 |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
$dovecot->set_prop('SharedMailboxAcl','no'); |
|
|
|
|
exit(0); |
|
|
|
|