File 'net/pop3/server.cls' (part of 'Pool_Net')

Description (short)
POP3 server core (Popsy)
Written by
Andreas Kupries
Description
Core of a POP3 server (Popsy). All general operation is handled by the code in the baseclass server.
See also
general POP3 background information, or POP3 server core for more specific info
Keywords
POP3, mail server core, Popsy

Class 'pop3Server'

Description
A full fledged pop3 server, based upon the server framework. The only missing parts are a storage system handling mailboxes and mails and a database of user accounts. These are delegated to external objects, see option userdb and storage. See POP3 server core for more.
The UIDL command is not supported.
Depends on
Trf
Superclasses
server
Options
userdb
storage
Methods
public
CheckLogin (conn clientid serverid storage)
CloseConnection (conn)
GreetPeer (conn)
H_apop (conn cmd line)
H_dele (conn cmd line)
H_list (conn cmd line)
H_noop (conn cmd line)
H_pass (conn cmd line)
H_quit (conn cmd line)
H_reset (conn cmd line)
H_retr (conn cmd line)
H_stat (conn cmd line)
H_top (conn cmd line)
H_user (conn cmd line)
HandleUnknownCmd (conn cmd line)
InitializeNewConnection (conn)
TransferDone (conn)
pop3Server ()
Membervariables
public
connInfo

Options

-userdb
Handle of the object giving us access to the database of users and their associated passwords. Must be derived from class userdbBase.
-storage
Handle of the object giving us access to the facility storing the mails known to the whole system. Must be derived from class popServerStorageBase.

Methods

CheckLogin (conn clientid serverid storage)

Internal procedure. General code used by USER/PASS and APOP login mechanisms to verify the given user-id. Locks the mailbox in case of a match.
Argument: conn Descriptor of connection to write to.
Argument: clientid Authentication code transmitted by client
Argument: serverid Authentication code calculated here.
Argument: storage Handle of mailbox requested by client.

CloseConnection (conn)

Overrides server:CloseConnection
Called by the general server to cleanup the pop3 specific part of a new connection. Overides the baseclass definition (server:CloseConnection).
Argument: conn Descriptor of connection to write to.

GreetPeer (conn)

Overrides server:GreetPeer
Called after the initialization of a new connection. Writes the greeting to the new client. Overides the baseclass definition (server:GreetPeer).
Argument: conn Descriptor of connection to write to.

H_apop (conn cmd line)

Handle APOP command.
Argument: conn Descriptor of connection to write to.
Argument: cmd The sent command
Argument: line The sent line, with cmd as first word.

H_dele (conn cmd line)

Handle DELE command.
Argument: conn Descriptor of connection to write to.
Argument: cmd The sent command
Argument: line The sent line, with cmd as first word.

H_list (conn cmd line)

Handle LIST command. Generates scan listing
Argument: conn Descriptor of connection to write to.
Argument: cmd The sent command
Argument: line The sent line, with cmd as first word.

H_noop (conn cmd line)

Handle NOOP command.
Argument: conn Descriptor of connection to write to.
Argument: cmd The sent command
Argument: line The sent line, with cmd as first word.

H_pass (conn cmd line)

Handle PASS command.
Argument: conn Descriptor of connection to write to.
Argument: cmd The sent command
Argument: line The sent line, with cmd as first word.

H_quit (conn cmd line)

Handle QUIT command.
Argument: conn Descriptor of connection to write to.
Argument: cmd The sent command
Argument: line The sent line, with cmd as first word.

H_reset (conn cmd line)

Handle RSET command.
Argument: conn Descriptor of connection to write to.
Argument: cmd The sent command
Argument: line The sent line, with cmd as first word.

H_retr (conn cmd line)

Handle RETR command.
Argument: conn Descriptor of connection to write to.
Argument: cmd The sent command
Argument: line The sent line, with cmd as first word.

H_stat (conn cmd line)

Handle STAT command.
Argument: conn Descriptor of connection to write to.
Argument: cmd The sent command
Argument: line The sent line, with cmd as first word.

H_top (conn cmd line)

Handle RETR command.
Argument: conn Descriptor of connection to write to.
Argument: cmd The sent command
Argument: line The sent line, with cmd as first word.

H_user (conn cmd line)

Handle USER command.
Argument: conn Descriptor of connection to write to.
Argument: cmd The sent command
Argument: line The sent line, with cmd as first word.

HandleUnknownCmd (conn cmd line)

Overrides server:HandleUnknownCmd
Handler for commands not known to the server. Overides the baseclass definition (server:HandleUnknownCmd). Simply writes an error response to the client.
Argument: conn Descriptor of connection to write to.
Argument: cmd The sent command
Argument: line The complete line sent by the client behind conn.

InitializeNewConnection (conn)

Overrides server:InitializeNewConnection
Called by the base class to initialize the pop3 specific part of a new connection. Overides the baseclass definition (server:InitializeNewConnection).
Argument: conn Descriptor of connection to write to.

TransferDone (conn)

Internal procedure. Called by the storage system after completion of the transfer requested by the server. Reenables listening for commands.
Argument: conn Descriptor of connection to write to.

pop3Server ()

Constructor. Creates the core of a pop3 server. It handles all interactions with a client, but relies on external code for authentication and mail storage. Built on top of server.


Membervariables

connInfo
Maps connection handles to the state information required by the server. The data is stored in 'array set' format, for easy retrieval and update. Any method requiring access to the data of a specific connection will read and store 'connInfo(<conn>)' from/into the local array 'state'.

Generated by AutoDoc 2.4 at 09/14/2000, invoked by Andreas Kupries