Perl-Email-Project / Email-Valid

perl library to validate email addresses
19 stars 19 forks source link

Checking for MX when there is a CNAME leads to exception #5

Closed nigelm closed 10 years ago

nigelm commented 10 years ago

If you do a MX check, but the domain name is actually a CNAME, then an exception is generated - eg Email::Valid::mx('gallery-kitchen.co.uk') :-

***  FATAL PROGRAM ERROR!!  Unknown method 'exchange'
***  which the program has attempted to call for the object:
***
***  gallery-kitchen.co.uk. 220 IN  CNAME   cf-protected.gallery-kitchen.co.uk.
***
***  This object does not have a method 'exchange'.  THIS IS A BUG
***  IN THE CALLING SOFTWARE, which incorrectly assumes that the
***  object would be of a particular type.  The type of an object
***  should be checked before calling any of its methods.

This is generated from sub _net_dns_query - need to check that what was returned really was a MX or has a exchange method available.

rjbs commented 10 years ago

should be fixed in next release, thanks for the report

please re-open if not fixed!