use Data::Dumper;
use Net::LDAP;
use Net::LDAP::Control::Paged;
use Net::LDAP::Constant ( "LDAP_CONTROL_PAGED" );
.
.
.
while(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 th
+e
# address without any other characters...
if ( $mail =~ s/^(smtp|SMTP)://gs ) {
push(@valid, $mail." OK\n");
print Dumper($mail);
}
}
I do not get any output
Using Poj's Suggesstion:-
I get this error message:-
root@vm1000 getadscripts# ./getadsmtp_itbak1.pl
Name "main::valid" used only once: possible typo at ./getadsmtp_itbak1.pl line 116, <DATA> line 755.
$VAR1 = '/etc/postfix/ad_itdepartment';
|