/[smeserver]/rpms/e-smith-qmail/sme9/e-smith-qmail-2.4.0-exclude_from_group_email.patch
ViewVC logotype

Contents of /rpms/e-smith-qmail/sme9/e-smith-qmail-2.4.0-exclude_from_group_email.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Tue May 31 11:06:01 2016 UTC (8 years, 6 months ago) by vip-ire
Branch: MAIN
CVS Tags: e-smith-qmail-2_4_0-8_el6_sme, e-smith-qmail-2_4_0-7_el6_sme, HEAD
* Tue May 31 2016 Daniel Berteaud <daniel@firewall-services.com> 2.4.0-7.sme
- Add possibility to exclude users or members of other groups from group
  email address [SME: 9540]

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 {

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed