Re: Authentication via libwww?

John Labovitz (johnl@meer.net)
Sun, 18 Feb 1996 23:44:42 -0800


Ramon M Felciano <felciano@camis.stanford.edu> wrote:

> Is there a simple way to authenticate an e-mail address via libwww or a 
> similar package? Ideally, I'd like to be able to send a username and 
> password to a POP (or IMAP) server and have it tell me whether this is a 
> registered user or not.
> Barring that, I'd at least like to know whether name@host is a valid address.

i can't suggest a particular package, but if you can open a socket 
connection to the Simple Mail Transfer Protocol (SMTP, port 25) server 
on the remote machine, there is a VRFY command in the SMTP protocol that 
will verify an address.  you can test this out using telnet (* indicates
lines that you would type or send to the server):
  
* telnet meer.net 25
  Trying 140.174.164.2...
  Connected to meer.net.
  Escape character is '^]'.
  220 meer.meer.net ESMTP Sendmail 8.7.3/8.7.3; Sun, 18 Feb 1996 22:49:09 -0800 (PST)
* VRFY johnl
  250 John Labovitz <johnl@meer.meer.net>
* QUIT
  221 meer.meer.net closing connection
  Connection closed by foreign host.

if the response code is other than 250, you've got some kind of error, 
although it may still be a valid user.

note that some SMTP servers require that you identify your hostname; 
that's done with a 'HELO <hostname>' command, which also returns a
response code.

john