diff -Nur e-smith-qmail-2.6.0/root/etc/e-smith/events/actions/qmail-update-group e-smith-qmail-2.6.0_bz10386/root/etc/e-smith/events/actions/qmail-update-group --- e-smith-qmail-2.6.0/root/etc/e-smith/events/actions/qmail-update-group 2017-07-20 17:46:00.285609302 +0200 +++ e-smith-qmail-2.6.0_bz10386/root/etc/e-smith/events/actions/qmail-update-group 2017-07-20 17:49:57.171541855 +0200 @@ -33,28 +33,23 @@ my $event = $ARGV [0] || die "Event name arg missing\n";; my @groups; -if ($ARGV[1]) -{ - my $groupName = $ARGV [1]; - my $g = $a->get($groupName) || - die "Group $groupName not found in accounts db\n"; - - my $type = $g->prop('type'); - if ($type =~ /^group/) - { - @groups = ($g); - } - # Is it a user? - elsif ($type =~ /^user/) - { - # That's fine. We were probably just called from the user-delete - # event, in which case we want to update all of the groups. So, leave - # the groups array empty. - @groups = (); - } - else - { - die "Expected a user or a group. Got neither: $type\n"; +if (scalar @ARGV) +{ + @groups = map { $a->get($_); } @ARGV; + foreach my $g (@groups) + { + my $type = $g->prop('type'); + if ($type =~ /^user/) + { + # That's fine. We were probably just called from the user-delete + # event, in which case we want to update all of the groups. So, leave + # the groups array empty. + @groups = (); + last; + } + elsif ($type !~ /^group/){ + die "Expected a user or a group. Got neither: $type\n"; + } } }