in reply to Net::SMTP assistance

The manpage suggests specifying: Domain => AF_INET. This changes how this is handled in the DNS lookup when both IPv6 and IPv4 records exist.

However this needs to be disambiguated in the Net::SMTP call, prior to IO::Socket::INET being called. This may require changing the host wide resolver behavior to prefer INET4 records to AAAA records, or specifying perl module dns lookup to return A records only. Partial answer to investigate why this new behavior.

In addition to the key-value pairs accepted by IO::Socket, + "IO::Socket::INET6" provides. Domain Address family AF_INET | AF_I +NET6 | AF_UNSPEC (default)
If "Domain" is not given, AF_UNSPEC is assumed, that is, bo +th AF_INET and AF_INET6 will be both considered when resolving DNS n +ames. AF_INET6 is prioritary.
(Concrete to IPv4 protocol) $sock = IO::Socket::INET6->new(PeerAddr => 'www.perl.org +', PeerPort => 'http(80)', Domain => AF_INET , Proto => 'tcp');

Replies are listed 'Best First'.
Re^2: Net::SMTP assistance
by Anonymous Monk on May 20, 2015 at 19:01 UTC
    See also: http://www.perlmonks.org/?node_id=948946

    Is it possible to upgrade Net::SMTP to use IO::Socket::IP instead?

    http://code.activestate.com/lists/perl5-porters/189012/

    In the mean time the work around seems to change the global resolve order, use a non IPV6 DNS server for host resolution or to delete the INET6 module on the Perl install. It will get more elegant with Socket::IP according to ActiveState link above. If you don't use IPV6 what about just turning it off on your server desktop, is that allowed or required in your site policy? Might ask your sysadmin.

      Thanks for your thoughts !!

      I learned a lesson late yesterday. As I have made an official switch from Active State to Strawberry Perl I was going through the usual motions of installing packages I thought I needed. Actually Strawberry has more so after a more careful review and only installing those that were not included, my problem is gone!

      I've made a not to not update any module that's already included in the code install going forward. If I need a more current module, I will instead look into updating the core PERL binaries as well.

Re^2: Net::SMTP assistance
by Anonymous Monk on May 20, 2015 at 18:32 UTC
    Similar issue reported:
    • http://www.nntp.perl.org/group/perl.ldap/2014/04/msg3761.html
    • https://rt.cpan.org/Public/Bug/Display.html?id=9312

    Seems compatibility of module releases in the IO::Socket::INET calls. While possible to rename INET6 module file, not suggested as fix in case of Perl apps requiring the IPv6 resolver. Could break something.. Next idea?