Perl-Email-Project / Email-Valid

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

New feature: pass in a costom resolver #13

Closed chrestomanci closed 9 years ago

chrestomanci commented 10 years ago

Hi

I need Email::Valid to talk to a different DNS resolver than the system one, that will be running on a non standard port (and possibly a different machine as well).

As far as I can tell, there is no standard option in Email::Valid to configure it to do that, so I will need to modify Email::Valid to add that feature. Obviously I would like my patch to be accepted back into the main project, so I would like your views on what approach to take.

My thinking is that the best way would be add an extra optional -resolver argument to new() and address(). This argument would accept an instance of Net::DNS::Resolver with whatever setting the caller has setup.

Does that make sense? Can you suggest a better way?

rjbs commented 9 years ago

Sorry for the year-long wait. :-/

You can assign (locally) to $Net::DNS::Resolver. If that's not helpful, let me know!