1 |
diff -Nur e-smith-qmail-2.4.0/root/etc/e-smith/events/actions/qmail-update-group e-smith-qmail-2.4.0_bz9523/root/etc/e-smith/events/actions/qmail-update-group |
2 |
--- e-smith-qmail-2.4.0/root/etc/e-smith/events/actions/qmail-update-group 2016-02-05 22:46:06.000000000 +0100 |
3 |
+++ e-smith-qmail-2.4.0_bz9523/root/etc/e-smith/events/actions/qmail-update-group 2016-05-24 10:13:07.105336565 +0200 |
4 |
@@ -75,7 +75,23 @@ |
5 |
my %properties = $group->props; |
6 |
$groupName =~ s/\./:/g; |
7 |
my $group = "/var/qmail/alias/.qmail-$groupName"; |
8 |
- my $members = $properties{Members}; |
9 |
+ my @group_members = split(/,/, $properties{Members}); |
10 |
+ # Check if we should exclude members from this group email address |
11 |
+ my @exclude_users = split(/,/, ($properties{EmailExcludeUsers} || '')); |
12 |
+ my @exclude_groups = split(/,/, ($properties{EmailExcludeGroups} || '')); |
13 |
+ foreach my $exclude_group (@exclude_groups){ |
14 |
+ my $g = $a->get($exclude_group); |
15 |
+ next unless $g; |
16 |
+ push @exclude_users, split(/,/, ($g->prop('Members') || '')); |
17 |
+ } |
18 |
+ my %exclude = map { $_, 1 } @exclude_users; |
19 |
+ @exclude_users = keys %exclude; |
20 |
+ my @members = (); |
21 |
+ foreach my $user (@group_members){ |
22 |
+ next if grep { $_ eq $user } @exclude_users; |
23 |
+ push @members, $user; |
24 |
+ } |
25 |
+ my $members = join(',', @members); |
26 |
|
27 |
esmith::util::processTemplate( |
28 |
{ |