PPOP3Server Class Reference
#include <inetmail.h>
List of all members.
Detailed Description
A TCP/IP socket for the Post Office Protocol version 3.
When acting as a server, a descendant class would be created to override at least the HandleOpenMailbox(), HandleSendMessage() and HandleDeleteMessage() functions. Other functions may be overridden for further enhancement to the sockets capabilities, but these will give a basic POP3 server functionality.
The server socket thread would continuously call the ProcessMessage() function until it returns PFalse. This will then call the appropriate virtual function on parsing the POP3 protocol.
Constructor & Destructor Documentation
PPOP3Server::PPOP3Server |
( |
|
) |
|
Create a TCP/IP POP3 protocol socket channel. The parameterless form creates an unopened socket, the form with the address
parameter makes a connection to a remote system, opening the socket. The form with the socket
parameter opens the socket to an incoming call from a "listening" socket.
Member Function Documentation
virtual void PPOP3Server::HandleDeleteMessage |
( |
PINDEX |
messageNumber, |
|
|
const PString & |
id | |
|
) |
| | [virtual] |
Handle the deleting of the specified message from the mail box. This is called when the OnQUIT command is called for each message that was deleted using the DELE command.
- Returns:
- PTrue if successfully sent message.
- Parameters:
-
| messageNumber | Number of message to send. |
| id | Unique id of message to send. |
virtual PBoolean PPOP3Server::HandleOpenMailbox |
( |
const PString & |
username, |
|
|
const PString & |
password | |
|
) |
| | [virtual] |
Log the specified user into the mail system and return sizes of each message in mail box.
The user override of this function is expected to populate the protected member fields messageSizes
and messageIDs
.
- Returns:
- PTrue if user and password were valid.
- Parameters:
-
| username | User name for mail box |
| password | Password for user name |
virtual void PPOP3Server::HandleSendMessage |
( |
PINDEX |
messageNumber, |
|
|
const PString & |
id, |
|
|
PINDEX |
lines | |
|
) |
| | [virtual] |
Handle the sending of the specified message to the remote client. The data written to the socket will automatically have the '.' character stuffing enabled.
- Returns:
- PTrue if successfully sent message.
- Parameters:
-
| messageNumber | Number of message to send. |
| id | Unique id of message to send. |
| lines | Nuumber of lines in body of message to send. |
virtual void PPOP3Server::OnDELE |
( |
PINDEX |
msg |
) |
[protected, virtual] |
virtual void PPOP3Server::OnLIST |
( |
PINDEX |
msg |
) |
[protected, virtual] |
Get the size of a message in mailbox. If msg
is 0 then get sizes of all messages in mailbox.
- Parameters:
-
virtual void PPOP3Server::OnNOOP |
( |
|
) |
[protected, virtual] |
PBoolean PPOP3Server::OnOpen |
( |
|
) |
[protected, virtual] |
This callback is executed when the Open() function is called with open channels. It may be used by descendent channels to do any handshaking required by the protocol that channel embodies.
The default behaviour is to simply return PTrue.
- Returns:
- Returns PTrue if the protocol handshaking is successful.
Reimplemented from PIndirectChannel.
virtual void PPOP3Server::OnPASS |
( |
const PString & |
passwd |
) |
[protected, virtual] |
- Parameters:
-
| passwd | Password for account. |
virtual void PPOP3Server::OnQUIT |
( |
|
) |
[protected, virtual] |
virtual void PPOP3Server::OnRETR |
( |
PINDEX |
msg |
) |
[protected, virtual] |
virtual void PPOP3Server::OnRSET |
( |
|
) |
[protected, virtual] |
virtual void PPOP3Server::OnSTAT |
( |
|
) |
[protected, virtual] |
virtual void PPOP3Server::OnTOP |
( |
PINDEX |
msg, |
|
|
PINDEX |
count | |
|
) |
| | [protected, virtual] |
- Parameters:
-
| msg | Number of message. |
| count | Count of messages |
virtual void PPOP3Server::OnUIDL |
( |
PINDEX |
msg |
) |
[protected, virtual] |
Get unique ID for message in mailbox. If msg
is 0 then get all IDs for all messages in mailbox.
- Parameters:
-
Handle an unknown command.
- Returns:
- PTrue if more processing may be done, PFalse if the ProcessCommand() function is to return PFalse.
- Parameters:
-
| command | Complete command line received. |
virtual void PPOP3Server::OnUSER |
( |
const PString & |
name |
) |
[protected, virtual] |
PBoolean PPOP3Server::ProcessCommand |
( |
|
) |
|
Process commands, dispatching to the appropriate virtual function. This is used when the socket is acting as a server.
- Returns:
- PTrue if more processing may be done, PFalse if the QUIT command was received or the OnUnknown() function returns PFalse.
Member Data Documentation
The documentation for this class was generated from the following file: