Script for harvesting mailing lists from ldap:
==================================================
#!/usr/bin/perl
use Net::LDAP;
my $addr = "localhost";
my $user = "cn=admin,dc=exist-db,dc=org";
my $pass = "1234";
my %grouphash = (
"Mailman", "dba",
"Backup", "backup-access",
"Svn-commit", "svn-update,svn-readonly");
my $ldap = Net::LDAP->new($addr) or die "Unable to connect to LDAP server";
my $login = $ldap->bind($user, password=> $pass);
for my $mailinglist (keys %grouphash) {
my @groups = split(/,/, $grouphash{$mailinglist});
my %emailhash = ();
for my $ldapgroup (@groups) {
my $mesg = $ldap->search(filter=>"(cn= $ldapgroup)",
base=>"ou=Groups,dc=exist-db,dc=org",
scope => "sub",
attrs => ['memberUid']
);
my @entries = $mesg->entries;
foreach my $entry (@entries) {
my @attrs = $entry->attributes();
my @memberIds = $entry->get_value("memberUid");
foreach my $memberUid (@memberIds) {
my $mesg1 = $ldap->search(filter=>"(uid= $memberUid)",
base=>"ou=Users,dc=exist-db,dc=org",
attrs => ['mail']
);
my @userEntries = $mesg1->entries;
foreach my $userEntry (@userEntries) {
my $email = $userEntry->get_value("mail");
if ($email) {
$emailhash{$email} = 1;
}
}
}
}
}
open(FILE, ">/tmp/$mailinglist.txt");
foreach my $email (keys %emailhash) {
print FILE "$email\n";
}
close(FILE);
my @args = ("/usr/sbin/sync_members", "-f", "/tmp/$mailinglist.txt", $mailinglist);
system(@args) == 0 or die "system @args failed: $?";
print $mailinglist . ":(" . join(",", keys %emailhash) .")\n";
sleep 1;
}
==================================================
On Jun 25, 2010, at 05:46 AM, Brian Dolan-Goecke wrote:
> This months PenguinsUnbound.com meeting will be
> Saturday June 26st at TIES,
> 1667 Snelling Ave. N., St. Paul, MN 55108
> from 10:00am to 12:00pm
> (See the web site http://www.penguinsunbound.com for directions and more
> info.)
>
> The meeting will be about LDAP + Radius + WPA
>
> Loren Cahlander will talk about
> * Installing OpenLDAP (Under Ubuntu 10.0.4 server)
> * Initial configuration of OpenLDAP
> * Installing a web-based administration tool
> * Configuring Apache2 to use LDAP for authentication.
>
> I will talk a about what TIES Technical Services have done
> with LDAP and Radius.
>
> And I hope to have some talk about Radius and WPA
>
> Hope to see you there!
>
> ==>brian.
>
> BTW. I need a speaker for July, if you have something you would be
> willing to share, please let me know. Thanks.
>
> _______________________________________________
> TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
> tclug-list at mn-linux.org
> http://mailman.mn-linux.org/mailman/listinfo/tclug-list