Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

verify email address on Linux

Tags:

linux

email

I am using command like sendmail -bv [email protected] to verify some email address to confirm the address is valid or not before sending actual email to people. it works for most sites I tested. But sometimes, I am using the sendmail for some website that will give me all pass no matter what the address name I put for the same site.

For example:

sendmail -bv [email protected]

where yyyyyy can be anything that also passes the command and always reported out "[email protected] verified". It seems correct but I think that should be something wrong behind. Why ?

Other command checking mail address on linux will be reliable and available, how and what command does this?

like image 285
techsolve Avatar asked Dec 03 '13 05:12

techsolve


2 Answers

Short answer: There is no 100% reliable way to verify the existence of a recipient email address other than actually send a message there and have the recipient click a link in the message body.

Explanation: What most of these address verifcation tools do is contact the recipient server, start a SMTP session and use the SMTP "RCPT TO" (or sometimes "VRFY") command check if the server responds with 200 OK or 550 User Unknown. This works if the server does recipient verification, but many servers simply accept everything first and then bounce the message later if the recipient doesn't exist. Even with recipient filtering enabled some systems (for example Exchange 2013) only respond with "User unknown" after the SMTP DATA stage which means you actually have to send a full message before you get the result.

More advanced verification systems also check for bounces, but even this is not reliable. Getting no bounce could mean the recipient address exists but it could also mean the address probe was quarantined or you simply didn't wait long enough for the bounce.

like image 76
Gryphius Avatar answered Oct 10 '22 17:10

Gryphius


In short: No, there's no command that does this.

Gaining confidence in existence: While there is no completely accurate way to verify the existence of an email address without an end-user clicking a signed link from an email, there are long, detailed guides on how one might approach getting a kind of "confidence level" of an address's existence. A rough breakdown of these levels are:

  1. The host exists and has mail exchanges (DNS lookup with nslookup or equivalent).
  2. A MX accepts an envelope to the address, but is a forwarding server (could be a false positive).
  3. A MX accepts an envelope to the address, and is a "core" server (often not accessible externally).
  4. A real message was sent that didn't bounce, given enough time (assuming the server isn't just keeping mum).
  5. A real message was sent and the recipient indicated so.

And mapping the levels to what they mean:

  • (0) Definitely does not exist.
  • (1,2) Is indeterminable.
  • (>=3) Exists.

You could figure out which MX's accept envelopes to obviously nonexistent addresses, and thereby be able to distinguish between confidence levels 2 and 3.

like image 25
Tyler Hoppe Avatar answered Oct 10 '22 19:10

Tyler Hoppe