Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

perl-ldap-0.52 breaks Amavis

19 views
Skip to first unread message

Quanah Gibson-Mount

unread,
Jan 25, 2013, 3:53:48 PM1/25/13
to Amavis Users, perl...@perl.org
The changes in inet6 handling somewhere between Net::LDAP 0.44 and
Net::LDAP 0.52 breaks Amavis' ability to talk to LDAP.

I can trivially reproduce the issue with a test script:

#!/usr/bin/perl
use strict;
use lib '/opt/zimbra/zimbramon/lib';
use Net::LDAP;

my $hostlist="ldap://zqa-398.eng.vmware.com:389";
my $ldap = Net::LDAP->new($hostlist,
inet6 => 1,
);
if (!$ldap) { # connect failed
print "connect_to_ldap: unable to connect to host $hostlist\n";
}

zimbra@zqa-398:~/zimbramon/lib/Net$ /tmp/test-ldap.pl
connect_to_ldap: unable to connect to host ldap://zqa-398.eng.vmware.com:389

This worked fine in perl 0.44. I would note the system is only listening
to IPv4. It appears that with perl-ldap 0.52, if it cannot talk to the
server on IPv6, it will *not* fall back to IPv4, whereas with perl 0.44, it
would.

--Quanah

--

Quanah Gibson-Mount
Sr. Member of Technical Staff
Zimbra, Inc
A Division of VMware, Inc.
--------------------
Zimbra :: the leader in open source messaging and collaboration

Quanah Gibson-Mount

unread,
Jan 25, 2013, 4:04:38 PM1/25/13
to Amavis Users, perl...@perl.org
--On Friday, January 25, 2013 12:53 PM -0800 Quanah Gibson-Mount
<qua...@zimbra.com> wrote:

> The changes in inet6 handling somewhere between Net::LDAP 0.44 and
> Net::LDAP 0.52 breaks Amavis' ability to talk to LDAP.

The problem is specifically this bit:

my $domain = $arg->{inet4} ? AF_INET : ($arg->{inet6} ? AF_INET6 :
AF_UNSPEC);

...
Domain => $domain,
...

If I comment out these two lines, connections work as expected.

Quanah Gibson-Mount

unread,
Jan 25, 2013, 4:50:03 PM1/25/13
to Amavis Users, perl...@perl.org
--On Friday, January 25, 2013 1:04 PM -0800 Quanah Gibson-Mount
<qua...@zimbra.com> wrote:

> --On Friday, January 25, 2013 12:53 PM -0800 Quanah Gibson-Mount
> <qua...@zimbra.com> wrote:
>
>> The changes in inet6 handling somewhere between Net::LDAP 0.44 and
>> Net::LDAP 0.52 breaks Amavis' ability to talk to LDAP.
>
> The problem is specifically this bit:
>
> my $domain = $arg->{inet4} ? AF_INET : ($arg->{inet6} ? AF_INET6 :
> AF_UNSPEC);
>
> ...
> Domain => $domain,
> ...
>
> If I comment out these two lines, connections work as expected.

With further investigation, I believe the fault here is with Amavis.
"inet6" for Net::LDAP means ipv6 only (as of 0.52 anyhow).

Peter Marschall

unread,
Jan 26, 2013, 4:03:56 AM1/26/13
to perl...@perl.org, Quanah Gibson-Mount, Amavis Users
Hi,

On Friday, 25. January 2013, Quanah Gibson-Mount wrote:
> <qua...@zimbra.com> wrote:
> > --On Friday, January 25, 2013 12:53 PM -0800 Quanah Gibson-Mount
> >
> > <qua...@zimbra.com> wrote:
> >> The changes in inet6 handling somewhere between Net::LDAP 0.44 and
> >> Net::LDAP 0.52 breaks Amavis' ability to talk to LDAP.
> >
> > The problem is specifically this bit:
> > my $domain = $arg->{inet4} ? AF_INET : ($arg->{inet6} ? AF_INET6 :
> > AF_UNSPEC);
> >
> > ...
> >
> > Domain => $domain,
> >
> > ...
> >
> > If I comment out these two lines, connections work as expected.
>
> With further investigation, I believe the fault here is with Amavis.
> "inet6" for Net::LDAP means ipv6 only (as of 0.52 anyhow).

This was a change in perl-ldap 0.45 to "Make IPv6 usage more sane",
https://rt.cpan.org/Public/Bug/Display.html?id=77458

With resolving this bug, perl-ldap switched to the "standard" of using either
IP version when no option was given, and changed the meaning of
the 'net6' option from "try IPv6" to "only use IPv6".

This is reflected in the documentation.

I see two options for amavis to fix it:
* raise the required perl-ldap version to 0.46 and remvoe "inet6 => 1"
from the constructor fo theNet::LDAP object
* make the addition of inet6 => 1 dependent on perl-ldap's version


Best
PEter

--
Peter Marschall
pe...@adpm.de
0 new messages