Class POP.

Inherits SaslConnection. Inherited by POPS.

This class implements a POP3 server.

The Post Office Protocol is defined by RFC 1939, and updated by RFC 1957 (which doesn't say much) and RFC 2449, which defines CAPA and other extensions. RFC 1734 defines an AUTH command for SASL authentication support, and RFC 2595 defines STARTTLS for POP3.

POP::POP( int s )

Creates a POP3 server for the fd s, and sends the initial banner.

void POP::badUser()

This is used by PopCommand::user() to reset "sawUser" if a previous USER command failed. This is needed so that subsequent USER commands are not incorrectly rejected.

EString POP::challenge() const

Returns the challenge sent at the beginning of this connection for use with APOP authentication.

void POP::err( const EString & s )

Sends s as a negative -ERR response.

void POP::markForDeletion( uint uid )

Records that message uid should be deleted when the POP server goes into Update state.

This is not written anywhere; the deletion state is kept in RAM only. If the client breaks the connection off, we don't delete.

Message * POP::message( uint uid )

Returns a pointer to the Message object with UID uid, or 0 if there isn't any.

void POP::ok( const EString & s )

Sends s as a positive +OK response.

void POP::parse()

Parses POP3 client commands.

void POP::runCommands()

The POP server maintains a list of commands received from the client and processes them one at a time in the order they were received. This function executes the first command in the list, or if the first command has completed, removes it and executes the next one.

It should be called when a new command has been created (i.e., by POP::parse()) or when a running command finishes.

Session * POP::session() const

Returns this POP server's Session object, or 0 if none has been specified with setSession.

void POP::setMessageMap( Map<Message> * m )

Records the Message objects needed for this Pop session. Each of the Message objects is presumed to know its database ID, and may know more. m is a map from UID to Message objects.

void POP::setReader( PopCommand * cmd )

Reserves the input stream for processing by cmd, which may be 0 to indicate that the input should be processed as usual. Used by AUTH to parse non-command input.

void POP::setReserved( bool r )

Reserves the input stream to inhibit parsing if r is true. If r is false, then the server processes input as usual. Used by STLS to inhibit parsing.

void POP::setSession( Session * s )

Sets this POP server's Session object to s.

void POP::setState( State s )

Sets this server's state to s, which may be one of Authorization, Transaction, or Update (as defined in POP3::State).

If the state is set to Update, DELE actions are initiated. setState() returns immediately.

State POP::state() const

Returns the server's current state.

Reimplements Connection::state().

This web page based on source code belonging to The Archiveopteryx Developers. All rights reserved.