vrfy(1)

๐Ÿ’Œ vrfy(1) โ€” General Commands Manual โœจ

okay bestie, sit down, because this one is a whole moment. it's vrfy, from the General Commands Manual (section 1, the general commands girlies ๐ŸŽ€), and it's about verifying electronic mail addresses. yes, like, actually checking if an address is real before you send your feelings into the void. no cap. ๐Ÿ’–


๐ŸŒธ NAME ๐ŸŒธ

vrfy โ€” Verify electronic mail addresses


โœจ SYNTAX โœจ

okay so here's how you actually invoke her, verbatim, don't come for me:

vrfy [options] [-v] address [host]
vrfy [options] [-v] -f [file] [host]
vrfy [options] [-v] -p domain
vrfy [options] [-v] -T domain [name]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so vrfy is the tool you use to verify electronic mail addresses. the only parameter you actually need is the address you wanna verify. the actual verification happens at the remote machine where mail to that address would normally land โ€” and heads up, that might be a mail exchange host, not the final destination host. plot twist. if you give an explicit host as the second argument on the command line, then the address gets verified at that machine instead.

the output shows whether or not the address can be handled at the contacted host. if the address is invalid, you get error messages. if the address is recognized, the output shows the remote host's notion of the (possibly translated) address. and if it represents a local user at that host, you might get extra info about the user too. cute. ๐Ÿ’…

lowkey important: if the address is accepted by the contacted host but that's not the final destination host, you still can't be sure the address represents a valid recipient. so don't get too comfy.

it's a handy tool for verifying local mail addresses, fr fr. if you've set up a .forward file, you can verify your own address to check the forwarding is actually done properly (we love a working forward ๐Ÿซถ). and if you specify an arbitrary name, you can check whether it resolves to any valid recipients at all.


๐ŸŽ€ SPECIAL OPERATION MODES ๐ŸŽ€

some flags put the program in a whole special operation mode. main character energy each time. โญ

๐Ÿ“ FILE MODE

if the -f option is specified, the program enters a special file mode. the (optional) parameter is the name of a file containing electronic mail addresses, such as the kind you'd use for mailing lists. it attempts to verify all the addresses present in the file. and if you don't specify a filename at all? vrfy acts as a filter and reads the addresses to be verified from standard input. slay. ๐ŸŒˆ

๐Ÿ“ PING MODE

if the -p option is specified, the program enters a special ping mode. the required parameter is an electronic mail domain, and it'll verify whether the corresponding mail exchangers are currently responding to SMTP requests. like a little wellness check for your MX records. ๐Ÿ’–

๐Ÿ“ฎ ETRN MODE

if the -T option is specified, the program enters a special etrn mode. the required parameter is an electronic mail domain, and an ESMTP ETRN command gets delivered to its corresponding mail exchangers. an optional name is used as the ETRN parameter โ€” and if you don't specify it, the local host name is used instead. ETRN is defined in RFC 1985, and it's implemented in sendmail 8.8. iykyk. ๐Ÿ’œ

๐Ÿ” RECURSIVE MODE

if the -L level option is specified, the received replies to an address verification get recursively verified up to level levels deep. this is handy for checking mailing list expansions and detecting possible mail forwarding loops. obsessed with the diligence honestly.

recursion stops automatically if the reply represents a local recipient address, or if a forwarding loop is detected. and if the received reply is the same (modulo comments) as the address that was asked for, the request is retried at its domain itself โ€” unless this was the machine we just queried, or it's not an internet domain host.

the option -R is equivalent to `-L 17`. that's the maximum hop count normally used during actual mail relaying. and this option also implies `-s`. periodt. ๐Ÿ’…


๐Ÿ’… OPTIONS ๐Ÿ’…

  • -v โ€” Sets verbose mode. prints the action the program is going to take.
    • If specified as -vv, very verbose output is printed, and the SMTP transactions with the remote host are shown in detail.
    • If the verbose mode level is set to 3 with -vvv, the actions taken by the remote host are shown, such as alias and forward expansions. this can be quite amusing ๐Ÿ˜ญ. the remote host must support the SMTP VERB command for this to work.
    • In ping mode, verbose mode level 3 will cause an extra SMTP command HELO to be generated.
  • -d โ€” Prints debugging output showing the various phases of the SMTP connection with the remote host. this is normally not of any interest, ngl. also prints various messages that are otherwise shown in very verbose mode.
    • If specified as -dd, in addition all nameserver query transactions are shown in detail. the receipts, basically.
    • A level 3 debug mode -ddd will not make any SMTP connections at all. ๐Ÿ’€
  • -a โ€” If multiple mail exchange hosts were found, this option causes the operation to be carried out at each of these hosts. normally only the primary mail exchanger is contacted.
  • -l โ€” Sets local mode for error handling. address syntax and parsing errors are handled entirely by the program. the default is to pass faulty addresses to the local host to get the official error messages.
  • -s โ€” Strips all comments from full address specifications, and presents only the plain address to the remote host to be verified. some hosts may get confused when a multiple bracketed address is presented ๐Ÿ™ˆ. this option is implied when -R is given.
  • -e โ€” Uses the EXPN command instead of the VRFY command. some systems may have different treatment for these commands, so this option may be a possible alternative. by sendmail V5 they're usually treated the same, but not by the sendmail V8 versions. in case treatment is different, the VRFY command will just show whether the presented address is valid or not, but the EXPN command will return alias expansions, if appropriate. some systems allow VRFY but disallow EXPN for privacy reasons.
  • -h โ€” This option causes an SMTP HELO command to be issued to the contacted server before subsequent commands are attempted. servers can be configured to refuse commands unless a HELO command is given first. the HELO is not issued by default, since old versions of sendmail refuse SMTP connections originating on the same machine (i.e. if the domain name in the HELO command is its own name).
  • -H โ€” Similar to the -h option, but now the ESMTP EHLO command is tried first. if the contacted server doesn't understand this, the SMTP HELO command is tried next. little fallback queen. ๐Ÿ‘‘
  • -n โ€” Many non-sendmail hosts do not, or incorrectly or incompletely, implement the VRFY command. other systems have VRFY or EXPN disabled for privacy reasons. this option uses an alternative protocol suite with the regular HELO, MAIL, RCPT and RSET commands. this gives only a global indication whether the recipient is valid. recursive mode is not possible, and will be disabled.
  • -S sender โ€” Defines an explicit envelope sender address to be used in the MAIL command during the alternative protocol suite, to overrule the default empty sender address `<>`. this option implies `-n`.
  • -c secs โ€” Sets a connect timeout value to override the default timeout of 6 seconds. this may be necessary if it takes considerable time to connect to the remote host. we've all been there. ๐Ÿ˜ญ
  • -t secs โ€” Sets a read timeout value to override the default timeout of 60 seconds. this may be necessary if it takes considerable time for the remote host to assemble all addresses in long mailing lists.

๐ŸŒŸ DEFAULT OPTIONS ๐ŸŒŸ

default options and parameters can be preset in an environment variable VRFY_DEFAULTS using the same syntax as on the command line. they'll be evaluated before the command line arguments. so it's like your pregame. ๐Ÿ’–


๐Ÿ”ฅ DIAGNOSTICS ๐Ÿ”ฅ

vrfy sets up an SMTP connection with the remote host where the verifying is to be carried out. SMTP is the TCP/IP protocol for electronic mail exchange, just so we're all on the same page bestie.

  • If the given host does not speak SMTP, the error message "Connection refused" is printed.
  • If the SMTP protocol is blocked, a "Host is unreachable" message is printed.
  • If the remote host doesn't respond in time, you'll get a "Connection timed out" message.
  • The remote host must support the SMTP VRFY command for doing the verification. if not, a "Command not implemented" is printed.

๐Ÿ—บ๏ธ STRATEGY ๐Ÿ—บ๏ธ

here's the whole strategy used to find the remote host where the verification is to be carried out. get comfy:

  1. If an explicit verification host is specified, that host is contacted unconditionally.
  2. If the address to be verified has no domain part after an @ sign, it's supposed to be a local recipient and will be verified at the local host.
  3. If the address contains a domain part after an @ sign, mail exchange hosts will be fetched for that domain. if no such mail exchangers are found, the domain part is supposed to represent a specific host, and that host itself will be contacted.
  4. If mail exchangers were found, the verification will be carried out at the primary mail exchange host.
  5. If the -a option was given, and multiple mail exchangers exist, the verification is also carried out at all other mail exchange hosts.
  6. For the pseudo domains .uucp and .bitnet a specific server can be compiled-in. the default is to contact the local host.
  7. If no mail exchangers were found for an unqualified single hostname, the local host is contacted by default. the actual meaning of such addresses depends on your local strategy.

๐ŸŒˆ ENVIRONMENT ๐ŸŒˆ

environment variables can be used to overrule several compiled-in defaults. the customization era. โœจ

๐Ÿ  VRFY_LOCALHOST

this is your nearest host running the sendmail daemon. it's contacted in case local addresses without a domain are given. also (unless the -l is given) when domain parsing errors were encountered, assuming that this host can give a more appropriate error message. the default value is localhost.

๐Ÿง VRFY_UUCPRELAY

this host is contacted when a .uucp address is specified. you probably won't get much useful information ๐Ÿฅฒ. the default value is localhost.

๐Ÿงš VRFY_BITNETRELAY

this host is contacted when a .bitnet or .earn address is specified. you probably won't get much useful information ๐Ÿฅฒ. the default value is localhost.

๐ŸŒธ VRFY_SINGLERELAY

this host is contacted when a single unqualified host name could not be resolved to a fully qualified MX domain host. it's assumed that single hosts in your own domain can be resolved, i.e. they have an MX record. it depends on your local strategy for unqualified hosts what they mean: a .uucp host, a .bitnet host, or just a local host without MX. the default value is localhost.

๐Ÿ’” LIMITATIONS ๐Ÿ’”

Okay bestie, moment of honesty, because I would never lie to you: some hosts have a genuinely lousy VRFY handling. ๐Ÿ˜ญ Like, sometimes the command isn't even implemented at all. Rude. Other hosts will only verify local recipients, no cap, which means the -n option may be necessary.

Other servers may straight-up refuse the VRFY command for privacy reasons. ๐Ÿ’€ Iconic of them, honestly, but inconvenient for us.

And here's the tea you really need to internalize: if the verification is not performed at the final destination host, one cannot be sure that the given address is valid. That's just how it is. No notes. ๐Ÿซถ


๐ŸŽ€ MAILING LISTS ๐ŸŽ€

Now THIS is where it gets spicy, because there are some subtle differences you need to clock if you want to check an existing mailing list. Let's set the scene:

Suppose that list-users is the local alias to include the actual file /mail/lists/list-users with recipients. ๐ŸŒธ

Here's the three scenarios, bestie, and they are NOT the same thing:

  • The command vrfy list-users will verify the proper expansion of the mailing list at the local host. No remote hosts are contacted to verify addresses. It's giving cozy, local, staying home. ๐Ÿ 
  • The command vrfy -f /mail/lists/list-users will verify each individual address at the appropriate remote hosts. Now we're travelling. โœˆ๏ธ
  • The same effect can be reached when you give the command vrfy -L 1 list-users. And lowkey, if you want to see further expansion of the mailing list, just use a higher recursion level. ๐Ÿ”
So like: same destination, different routes. -f and -L 1 get you to the same place, and -L above 1 goes deeper. Choose your fighter. ๐Ÿ’…

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Eric Wassenaar, Nikhef-H, <e07@nikhef.nl> โ€” the actual legend who made all of this happen. Respect where respect is due, periodt. ๐Ÿซก๐Ÿ’œ


okay and that's the whole page, bestie!! ๐ŸŒˆ this was vrfy(1), dated 971114 โ€” yes the date is literally giving vintage, and honestly? she's timeless. ๐Ÿ•ฐ๏ธโœจ go verify something and slay responsibly. bye mwah ๐Ÿ’…๐Ÿ’–

๐Ÿ“ฆ where this page comes from