Skip to Content.
Sympa Menu

en - Re: [sympa-users] AD/LDAP data sources with more than 1000 members

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: David Verdin <address@concealed>
  • To: address@concealed
  • Subject: Re: [sympa-users] AD/LDAP data sources with more than 1000 members
  • Date: Mon, 13 Jan 2020 12:22:03 +0100

It's an old bug. I found a mail about it from nine years ago: https://listes.renater.fr/sympa/arc/sympa-users/2010-12/msg00045.html

and it loks like there is still no satisfactory solution for this, unfortunately. this this Github issu:

https://github.com/sympa-community/sympa/issues/57

Here is an example of code overcoming the problem. I found it in the old Sourcesup tracker :

#!/usr/bin/perl

use Net::LDAP;

use Net::LDAP::Entry;

use Net::LDAP::Control::Paged;

use Net::LDAP::Constant qw( LDAP_CONTROL_PAGED );



my $adHost = "dc.domain.com";

my $adUsr = "CN=admin,OU=Users,DC=massey,DC=ac,DC=nz";

my $adPass = "password";

my $base = "OU=Users,DC=massey,DC=ac,DC=nz";

my $query = "(mail=*)";

my @attrs = qw(cn displayname mail);

my $ldap = Net::LDAP->new($adHost) or die $!; my $mesg = 
$ldap->bind($adUsr, password =>$adPass); my $page = 
Net::LDAP::Control::Paged->new( size => 1000 ) or die $!;



my @args = ( base => $base,

             scope => 'sub',

             filter => $query,

             attrs => \@attrs,

             control => [ $page ],

           );



my $cookie;

my $resultcount = 0;



while (1) {



     $mesg = $ldap->search ( @args ) or die $!;



     while (my $entry = $mesg->shift_entry()) {



         my $entrydn = $entry->dn();

         my $mail = $entry->get_value('mail');

         my $displayname = $entry->get_value('displayname');

         my $cn = $entry->get_value('cn');



         print "\"$displayname\",\"$mail\"\n";

         $resultcount++;



     } # while





 my ($resp) = $mesg->control(LDAP_CONTROL_PAGED) or last;  $cookie = $resp->cookie or last;  $page->cookie($cookie);



} # while (1)



print "Results Returned:$resultcount\n";



if ($cookie) {

 $page->cookie($cookie);

 $page->size(0);

 $ldap->search( @args );

}


Regards,

David


On 13/01/2020 11:52, Galanty, Robert wrote:

Hi together,

 

I have an issue with adding lists, which subscribers are defined as an AD/LDAP data source. I can't sync if the AD/LDAP group has more than 1000 members, everything below works fine.

 

The normal case is, that AD/LDAP servers have a standard paging of 1000. If you query a bigger search, you need to pass through the paging parameter with an increased number.

 

My question is, if Sympa supports bigger AD/LDAP queries? I wasn't able to find anything.

 

Our Sympa version is 6.2.40. I've tried it also with the newest version 6.2.52, but I couldn’t figure it out.

 

Thank you in advance!

 

Best regards,

Robert

 

 

--

Robert Galanty

 

Informations- und Kommunikationstechnologie

Rechenzentrumsdienste

 

Tel.: +49 (0)30 30877-2543

Fax: +49 (0)30 30877-2539

E-Mail: address@concealed

 

Hochschule für Wirtschaft und Recht Berlin

Berlin School of Economics and Law

Campus Lichtenberg

Alt-Friedrichsfelde 60

10315 Berlin / Germany

http://www.hwr-berlin.de

http://www.it.hwr-berlin.de

 

 

-- 
"Mieux vaut viser la perfection et la rater que viser la médiocrité et l'atteindre."
- Francis Blanche

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature




Archive powered by MHonArc 2.6.19+.

Top of Page