vrf

command module
v0.0.0-...-c0b116c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

README

CircleCI Go Report Card

vrf: An SMTP Address Verifier

Checks whether a single email address is deliverable. Exits successfully if so.

To install:

$ go get github.com/ransford/vrf

Is foo@bar.quux a deliverable email address?

$ vrf foo@bar.quux
foo@bar.quux is deliverable
$ vrf -quiet foo@bar.quux && echo "yes"
yes

What about oiwperwer@google.com?

$ vrf oiwperwer@google.com
oiwperwer@google.com is not deliverable
$ vrf -quiet oiwperwer@google.com || echo "no"
no

How it Works

vrf looks up the mail exchanger (MX) records for a given address, then connects to the highest priority server in the list and goes partway through the process of delivering an email messsage. Essentially:

> Client: Hello `domain.com` mail server!
> Server: Hello!
> Client: I have email for user `bob@domain.com`.
> Server: Sure, I'll accept it.  ***OR***  Sorry, no such address.
> Client: Never mind.
> Server: Fine, whatever.
> Client: Bye!
> Server: Bye.

Technically speaking, vrf disconnects (politely, with RSET) after MAIL.

Documentation

Overview

vrf tests whether a given email address is likely to be deliverable.

To test whether an address is deliverable, i.e., whether it's a "valid" email address that can receive email, vrf finds an email server responsible for the domain, then conncts to that server and follows *most* of the protocol to deliver an email message, up to the point at which a message is actually delivered.

$ vrf good.guess@nowhere.biz
good.guess@nowhere.biz is deliverable

$ vrf bad.guess@nowhere.biz
bad.guess@nowhere.biz is not deliverable

# exits with 0 if deliverable, 1 otherwise.
$ vrf -quiet good.guess@nowhere.biz && echo "good guess!"
good guess!

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL