Skip Menu |

This queue is for tickets about the AnyEvent-SMTP CPAN distribution.

Report information
The Basics
Id: 75744
Status: resolved
Priority: 0/
Queue: AnyEvent-SMTP

People
Owner: Nobody in particular
Requestors: ASACKETT [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.08
Fixed in: (no value)



AnyEvent::DNS since version 6.01 puts TTL in the fourth element of its return where AnyEvent::SMTP::Client is expecting the MX hostname, which fouls things up in the in-place sort at Client.pm line 351. I haven't tried it, but it seems that using AnyEvent::DNS::mx directly would be a good fix as mx() returns a list sorted by preference.
The attached patch implements my suggested fix. Thanks for an incredibly useful module!
Subject: fixup.diff
--- Client.pm.old 2012-07-27 10:54:18.086028194 -0600 +++ Client.pm 2012-07-27 10:57:35.406021467 -0600 @@ -347,8 +347,7 @@ } for my $domain (keys %domains) { $cv->begin; - $dns->resolve( $domain => mx => sub { - @_ = map $_->[4], sort { $a->[3] <=> $b->[3] } @_; + AnyEvent::DNS::mx $domain, sub { warn "MX($domain) = [ @_ ]\n" if $args{debug}; if (@_) { $run->(shift, $args{port}, @{ delete $domains{$domain} }); @@ -360,7 +359,7 @@ } } $cv->end; - }); + }; } undef $dns; }
Fixed in v0.09