I have marked up your code with the 2 lines you need to comment out and 3 lines to add
pojwhile(1) { # Perform search my $mesg = $ldap->search( @args ); # Filtering results for proxyAddresses attributes foreach my $entry ( $mesg->entries ) { my $name = $entry->get_value( "cn" ); # LDAP Attributes are multi-valued, so we have to print each one. foreach my $mail ( $entry->get_value( "proxyAddresses" ) ) { # Test if the Line starts with one of the following lines: # proxyAddresses: [smtp|SMTP]: # and also discard this starting string, so that $mail is only t +he # address without any other characters... if ( $mail =~ s/^(smtp|SMTP)://gs ) { push(@valid, $mail." OK\n"); } } } # Only continue on LDAP_SUCCESS $mesg->code and last; # Get cookie from paged control my($resp) = $mesg->control( LDAP_CONTROL_PAGED ) or last; #$cookie = $resp->cookie or last; # delete $cookie = $resp->cookie; # add last if (!defined($cookie) || !length($cookie)); # add # Set cookie in paged control $page->cookie($cookie); } #if ($cookie) { # delete if (defined($cookie) && length($cookie)) { # add # We had an abnormal exit, so let the server know we do not want any + more $page->cookie($cookie); $page->size(0); $ldap->search( @args ); # Also would be a good idea to die unhappily and inform OP at this p +oint die("LDAP query unsuccessful"); }
In reply to Re^5: Centos 7 getadsmtp.pl outputing blank
by poj
in thread Centos 7 getadsmtp.pl outputing blank
by gml_perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |