Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Determine if domain is actually used for email

by Your Mother (Archbishop)
on Oct 04, 2011 at 17:49 UTC ( [id://929616]=note: print w/replies, xml ) Need Help??


in reply to Determine if domain is actually used for email

Email::Valid does this; for domains or as a part of validating addresses: "mx ( <ADDRESS>|<DOMAIN> ) This method accepts an email address or domain name and determines whether a DNS record (A or MX) exists for it."

perl -MEmail::Valid -le 'print Email::Valid->mx("gmail.com") ? "yep" : + "nope"' yep perl -MEmail::Valid -le 'print Email::Valid->mx("tacohut.co.uk.jp.cx") + ? "yep" : "nope"' nope

Replies are listed 'Best First'.
Re^2: Determine if domain is actually used for email
by Limbic~Region (Chancellor) on Oct 04, 2011 at 18:19 UTC
    Your Mother,
    Except that vit indicated in the original post that the presence of an MX record is not a reliable source of the domain's ability to receive email. Apparently DNS administrators are registering MX records all willy nilly.

    Cheers - L~R

      Sure... but unless I'm misled, with UDP there simply is no way to know for sure excepting an out of band response—a visit to a tokenized URI sent in a message or a return message from the same domain/address. So no checks will be guaranteed. "Heroic" messages to circumvent misused standards / client-fail seems a mistake.

        Your Mother,
        I have no idea where UDP came into the conversation since SMTP is a TCP protocol. I agree that there is no way to be sure unless you can deliver mail to a recipient and get a DSN or, preferred, a response. Seeing if the server is listening on port 25 and is responding in a manner consistent with a SMTP server and not giving a 521 status code is a pretty safe bet though.

        Cheers - L~R

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://929616]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2024-04-25 12:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found