POP3 C API Reference
Table of Contents | Previous | Next | Index

Messaging Access SDK Guide
Part 2. Messaging Access SDK C Reference


Chapter 12
POP3 C API Reference

This chapter describes the functions and structures of the C language API for the POP3 (Post Office Protocol) protocol of the Messaging Access SDK.

You'll find links to each function and structure in this introduction. Each reference entry gives the name of the function or structure, its header file, its syntax, and its parameters.

All C interface definitions are found in the pop3.h file.

[Top]

POP3 Functions

This table lists POP3 functions alphabetically by name, with descriptions. Click the function name to get information about it.

Function Description
pop3_connect

Connects to server.

pop3_delete

Marks a message for deletion on the server.

pop3_disconnect

Closes the socket connection with the server.

pop3_free

Frees the pop3Client_t structure.

pop3_get_option

Gets IO models.

pop3_initialize

Initializes and allocates the pop3Client_t structure and sets the response sink.

pop3_list

Lists all messages.

pop3_listA

Lists the specified message.

pop3_noop

Contacts the server, which sends a response indicating it is still present.

pop3_pass

Identifies user password; on success, enters Transaction state.

pop3_processResponses

Processes the server responses for API commands.

pop3_quit

Closes the connection with the server.

pop3_reset

Undeletes any messages marked as deleted.

pop3_retrieve

Retrieves message with specified number.

pop3_sendCommand

Send an unsupported command to the server.

pop3_setChunkSize

Sets the size of the message data chunk passed to the user.

pop3_set_option

Sets IO models.

pop3_setResponseSink

Sets a new response sink.

pop3_setTimeout

Sets the amount of time allowed to wait before returning control to the user.

pop3_stat

Get the status of the mail drop.

pop3_top

Retrieves the headers plus the specified number of lines from the message.

pop3_uidList

Returns the message numbers and the corresponding unique ids of the message in the maildrop.

pop3_uidListA

Returns the specified message number and the corresponding unique id of the message.

pop3_user

Enters a user name.

pop3_xAuthList

Returns a list of authenticated users.

pop3_uidListA

Returns an authenticated user for a given message.

pop3_xSender

Gets the email address of the sender of the specified message.

pop3Sink_free

Frees the POP3 response sink and its data members.

pop3Sink_initialize

Initializes and allocates the pop3SinkPtr_t structure.

[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_connect

Connects to the server.

Syntax

#include <pop3.h> 
int pop3_connect(
pop3Client_t * in_pPOP3,
                     const char * in_server,
                     unsigned short in_port );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

in_server

Pointer to the name of the server to which to connect.

in_port

Server port to which to connect.

Returns

Description

This function connects the POP3 client to the specified server at the port you indicate. For more information, see Connecting to a Server.

This function is mapped to one or more callbacks in the pop3Sink_t structure. For more information, see POP3 Function Callback Mapping.

See Also

pop3Sink_t.connect, pop3Sink_t.error,
pop3_disconnect, pop3Client_t
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_delete

Marks a message for deletion on the server.

Syntax

#include <pop3.h> 
int pop3_delete(
pop3Client_t * in_pPOP3,
               int in_messageNumber );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

in_messageNumber

Message number.

Returns

Description

This function marks the message for deletion; it is actually deleted when the pop3_quit function is called. For more information, see Ending the Session.

This function sends the DELE [arg] POP3 protocol command. It is mapped to one or more callbacks in the pop3Sink_t structure. For more information, see POP3 Function Callback Mapping.

See Also

pop3Sink_t.dele, pop3Sink_t.error,
pop3_quit, pop3Client_t
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_disconnect

Closes the socket connection with the server.

Syntax

#include <pop3.h>
int pop3_disconnect (
pop3Client_t * in_pPOP3 );

Parameters

The function has the following parameter:
in_pPOP3

Pointer to the POP3 client you want to disconnect.

Returns

Description

This function closes the socket connection. It could be used to implement a Cancel button.

NOTE: Do not call the processResponses method after this function. Operations for which you do not call processResponses: disconnecting, the set functions, initializing and freeing the client and sink. §

See Also

pop3_connect
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_free

Frees the POP3 client structure.

Syntax

#include <pop3.h> 
void pop3_free(
pop3Client_t ** in_ppPOP3 );

Parameters

The function has the following parameter:
in_pPOP3

Pointer to pointer to the client structure.

Returns

Description

This function frees the pop3Client_t structure. When the function returns, the client structure is set to null.

See Also

pop3_initialize, pop3Sink_free
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_get_option

Gets IO models.

Syntax

#include <pop3.h>
int pop3_get_option(
pop3Client_t * in_pPOP3,
                     int in_option,
                     void * in_pOptionData );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

in_option

Pointer to option you want to set. See nsmail_io_fns_t. For the option that is currently supported, see "Option Definition."

in_pOptionData

Pointer to option data set with pop3_set_option.

Returns

Description

This function gets the option set with pop3_set_option. Do not call pop3_processResponses after this function.

See Also

pop3_set_option
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_initialize

Initializes and allocates the pop3Client_t structure and sets the response sink.

Syntax

#include <pop3.h> 
int pop3_initialize(
pop3Client_t ** out_ppPOP3,
                     pop3SinkPtr_t in_pPOP3Sink );

Parameters

The function has the following parameters:
out_ppPOP3

Pointer to pointer to the POP3 client.

in_pPOP3Sink

Response sink to use.

Returns

Description

For more information, see Creating a Client.

See Also

pop3Client_t
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_list

Lists all messages.

Syntax

#include <pop3.h> 
int pop3_list(
pop3Client_t * in_pPOP3 );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

Returns

Description

POP3 includes two forms of the list function. This form goes through all the messages in the mailbox and generates a list of messages. The other form takes the message number of the message to list as an argument. For more information, see Listing Messages.

This function sends the LIST POP3 protocol command. It is mapped to one or more callbacks in the pop3Sink_t structure. For more information, see POP3 Function Callback Mapping.

See Also

pop3Sink_t.listStart, pop3Sink_t.list, 
pop3Sink_t.listComplete, pop3Sink_t.error,
pop3_listA, pop3Client_t
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_listA

Lists the specified message.

Syntax

#include <pop3.h> 
int pop3_listA(
pop3Client_t * in_pPOP3,
               int in_messageNumber );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

in_messageNumber

Message number of the message to list.

Returns

Description

POP3 includes two forms of the list function. This form takes the message number of the message to list as an argument. The other form goes through all the messages in the mailbox and generates a list of messages. For more information, see Listing Messages.

This function sends the LIST [arg] POP3 protocol command. It is mapped to one or more callbacks in the pop3Sink_t structure. For more information, see POP3 Function Callback Mapping.

See Also

pop3Sink_t.listStart, pop3Sink_t.list, 
pop3Sink_t.listComplete, pop3Sink_t.error,
pop3_list
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_noop

Contacts the server, which sends a response indicating it is still present.

Syntax

#include <pop3.h> 
int pop3_noop(
pop3Client_t * in_pPOP3 );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

Returns

Description

This function sends the NOOP POP3 protocol command.

If you send any command, the server responds with an "still here" response. Sending the pop3_noop function does nothing except force this server response. You can use this function to maintain server connection, perhaps issuing it at timed intervals to make sure that the server is still active.

The pop3_noop function resets the autologout timer inside the server and may change the number of messages in a mailbox (due to new mail). Also, using this function may change or update the status of messages in mailboxes.

Your application may not need this function. For example, if the application does something and then disconnects at once, there is no need to make sure that the server is still connected.

This function is mapped to one or more callbacks in the pop3Sink_t structure. For more information, see POP3 Function Callback Mapping.

See Also

pop3Sink_t.noop, pop3Sink_t.error, 
pop3_connect, pop3Client_t
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_pass

Identifies user password; on success, enters Transaction state.

Syntax

#include <pop3.h> 
int pop3_pass(
pop3Client_t * in_pPOP3,
               const char * in_password );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

in_password

Pointer to the user password.

Returns

Description

This function sends the PASS POP3 protocol command. For more information, see Logging In.

This function is mapped to one or more callbacks in the pop3Sink_t structure. For more information, see POP3 Function Callback Mapping.

See Also

pop3Sink_t.pass, pop3Sink_t.error, pop3_user
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_processResponses

Processes the server responses for API commands.

Syntax

#include <pop3.h> 
int pop3_processResponses(
pop3Client_t * in_pPOP3);

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

Returns

Description

This function processes the server responses for API commands. It invokes the callback functions provided by the user for all responses that are available at the time of execution.

If a time-out occurs, the user can continue by calling pop3_processResponses again.

Do not call pop3_processResponses after these operations: disconnecting, the set functions, initializing and freeing the client and sink.

See Also

pop3Sink_t
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_quit

Closes the connection with the server.

Syntax

#include <pop3.h> 
int pop3_quit(
pop3Client_t * in_pPOP3 );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

Returns

Description

This function ends the session. It expunges deleted messages and logs the user out from the POP3 server. For more information, see Ending the Session.

If issued in the Authentication state, server closes connections. If issued in the Transaction state, the server enters the Update state and deletes marked messages, then quits.

This function sends the QUIT POP3 protocol command. It is mapped to one or more callbacks in the pop3Sink_t structure. For more information, see POP3 Function Callback Mapping.

See Also

pop3Sink_t.quit, pop3Sink_t.error,
pop3_delete, pop3Client_t
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_reset

Undeletes any messages marked as deleted.

Syntax

#include <pop3.h> 
int pop3_reset(
pop3Client_t * in_pPOP3 );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

Returns

Description

This function removes any delete flags.

This function sends the RSET POP3 protocol command. It is mapped to one or more callbacks in the pop3Sink_t structure. For more information, see POP3 Function Callback Mapping.

See Also

pop3Sink_t.reset, pop3Sink_t.error, pop3Client_t
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_retrieve

Retrieves message with specified number.

Syntax

#include <pop3.h> 
int pop3_retrieve(
pop3Client_t * in_pPOP3,
                   int in_messageNumber );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

in_messageNumber

Number of message to retrieve.

Returns

Description

This function retrieves messages in the form of data chunks, which have a default size of 1 K. The function issues a RETR IMAP4 protocol command. For more information, see Retrieving a Message.

This function is mapped to one or more callbacks in the pop3Sink_t structure. For more information, see POP3 Function Callback Mapping.

See Also

pop3Sink_t.retrieveStart, pop3Sink_t.retrieve,
pop3Sink_t.retrieveComplete, pop3Sink_t.error,
pop3_setChunkSize
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_sendCommand

Sends a POP3 command that is not otherwise supported by the SDK.

Syntax

#include <pop3.h> 
int pop3_sendCommand(
pop3Client_t * in_pPOP3,
                      const char * in_command,
                      boolean in_multiLine );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

in_command

Pointer to the command to send.

in_multiLine

Whether the command is multi-line.

Returns

Description

You can use this function to extend the protocol to meet your application needs. Using this function, you can extend the functionality of the SDK to meet your needs by adding functions or passing different parameters to a function.

This function is mapped to one or more callbacks in the pop3Sink_t structure. For more information, see POP3 Function Callback Mapping.

See Also

pop3Sink_t.sendCommandStart, pop3Sink_t.sendCommand,
pop3Sink_t.sendCommandComplete
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_setChunkSize

Sets the size of the message data chunk passed to the user.

Syntax

#include <pop3.h> 
int pop3_setChunkSize(
pop3Client_t * in_pPOP3,
                        int in_chunkSize );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

in_chunkSize

Size of chunk to set.

Returns

Description

NOTE: Do not call the processResponses method after this method. §

See Also

pop3_retrieve
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_set_option

Sets IO models.

Syntax

#include <pop3.h> 
int pop3_set_option(
pop3Client_t * in_pPOP3,
                     int in_option,
                     void * in_pOptionData );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

in_option

Pointer to option you want to set. See nsmail_io_fns_t. For the option that is currently supported, see "Option Definition."

in_pOptionData

Pointer to the option data you want to set.

Returns

Description

To inquire on options set with this function, use pop3_get_option. Do not call pop3_processResponses after this function.

See Also

pop3_get_option
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_setResponseSink

Sets a new response sink.

Syntax

#include <pop3.h> 
int pop3_setResponseSink (
pop3Client_t * in_pPOP3,
                            pop3SinkPtr_t in_pPOP3Sink );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

in_pPOP3Sink

Response sink to set.

Returns

Description

This function overrides the response sink passed into the initialized function.

NOTE: Do not call pop3_processResponses after this function. §

See Also

pop3Sink_t
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_setTimeout

Sets the amount of time allowed to wait before returning control to the user.

Syntax

#include <pop3.h> 
int pop3_setTimeout(
pop3Client_t * in_pPOP3,
                     double in_timeout );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

in_timeout

Time-out period to set in seconds. Values:

Returns

Description

This function sets the amount of time, in seconds, allowed to wait before returning control to the user.

NOTE: Do not call pop3_processResponses after this function. §

See Also

pop3_processResponses, pop3_setChunkSize, pop3Client_t
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3Sink_free

Frees the POP3 response sink and its data members.

Syntax

#include <pop3.h>
void pop3Sink_free(
pop3Sink_t ** in_ppPOP3Sink );

Parameters

The function has the following parameters:
out_ppPOP3Sink

Pointer to a pointer to the client structure associated with the response sink to free.

Returns

Description

This function frees the pop3Sink_t structure. When the function returns, the sink structure is set to null. The user must free any pointers to opaque data.

NOTE: Do not call pop3_processResponses after this function. §

See Also

pop3_quit, pop3_free, pop3Sink_initialize
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3Sink_initialize

Initializes and allocates the pop3Sink_t structure.

Syntax

#include <smtp.h> 
int pop3Sink_initialize(
pop3Sink_t ** out_ppPOP3Sink );

Parameters

The function has the following parameters:
out_ppPOP3Sink

Pointer to pointer to the response sink to initialize.

Returns

Description

For more information, see Creating a Response Sink and SDK Response Sinks for C.

NOTE: Do not call the processResponses method after this method. §

See Also

pop3_connect, pop3_noop, pop3Sink_free, pop3_initialize
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_stat

Gets the status of the mail drop.

Syntax

#include <pop3.h> 
int pop3_stat(
pop3Client_t * in_pPOP3 );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

Returns

Description

The client calls this function to get the number of messages in and octet size of the mail drop. The function issues a STAT IMAP4 protocol command. For more information, see Getting Message Count.

This function is mapped to one or more callbacks in the pop3Sink_t structure. For more information, see POP3 Function Callback Mapping.

See Also

pop3Sink_t.stat, pop3Sink_t.error
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_top

Retrieves the headers plus the specified number of lines from the body.

Syntax

#include <pop3.h>
int pop3_top (
pop3Client_t * in_pPOP3,
               int in_messageNumber,
               int in_lines );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

in_messageNumber

Number of message to retrieve.

in_lines

Number of lines of the body to retrieve.

Returns

Description

This function returns the header and specified number of lines from the message. It issues a TOP [arg1] [arg2]' command. For more information, see Retrieving Message Headers.

This function is mapped to one or more callbacks in the pop3Sink_t structure. For more information, see POP3 Function Callback Mapping.

See Also

pop3Sink_t.topStart, pop3Sink_t.top, 
pop3Sink_t.topComplete, pop3Sink_t.error,
pop3_retrieve
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_uidList

Returns the message numbers and the corresponding unique ids of the message in the maildrop.

Syntax

#include <pop3.h> 
int pop3_uidList(
pop3Client_t * in_pPOP3 );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

Returns

Description

This function uses the UIDL POP3 protocol command to specify that the LIST command uses unique message identifiers. For more information, see Listing Messages.

This function is mapped to one or more callbacks in the pop3Sink_t structure. For more information, see POP3 Function Callback Mapping.

See Also

pop3Sink_t.uidListStart, pop3Sink_t.uidList,
pop3Sink_t.uidListComplete, pop3Sink_t.error,
pop3_uidListA
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_uidListA

Returns a specified message and its corresponding unique id.

Syntax

#include <pop3.h> 
int pop3_uidListA(
pop3Client_t * in_pPOP3,
                   int in_messageNumber );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

in_messageNumber

Message number.

Returns

Description

This function lists all the messages in a mailbox along with their unique identifiers and message numbers. It uses the UIDL POP3 protocol command to specify that the LIST command uses unique message identifiers. For more information, see Listing Messages.

This function is mapped to one or more callbacks in the pop3Sink_t structure. For more information, see POP3 Function Callback Mapping.

See Also

pop3Sink_t.uidListStart, pop3Sink_t.uidList,
pop3Sink_t.uidListComplete, pop3Sink_t.error,
pop3_uidList
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_user

Enters a user name.

Syntax

#include <pop3.h> 
int pop3_user(
pop3Client_t * in_pPOP3,
               const char * in_user );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

in_user

User name.

Returns

Description

This function identifies the user or mail drop by name to the server. It sends the USER POP3 protocol command. For more information, see Logging In.

This function is mapped to one or more callbacks in the pop3Sink_t structure. For more information, see POP3 Function Callback Mapping.

See Also

pop3Sink_t.user, pop3Sink_t.error, pop3_pass
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_xAuthList

Returns a list of authenticated users.

Syntax

#include <pop3.h>
int pop3_xAuthList(
pop3Client_t * in_pPOP3 );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

Returns

Description

This function sends the XAUTHLIST POP3 protocol command. For more information, see Listing Messages.

This function is mapped to one or more callbacks in the pop3Sink_t structure. For more information, see POP3 Function Callback Mapping.

See Also

pop3Sink_t.xAuthListStart, pop3Sink_t.xAuthList,
pop3Sink_t.xAuthListComplete, pop3Sink_t.error,
pop3_xAuthListA
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_xAuthListA

Returns an authenticated user for a given message.

Syntax

#include <pop3.h>
int pop3_xAuthListA(
pop3Client_t * in_pPOP3,
                     int in_messageNumber );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

in_messageNumber

Message number.

Returns

Description

This function sends the XAUTHLIST [arg] POP3 protocol command. For more information, see Listing Messages.

This function is mapped to one or more callbacks in the pop3Sink_t structure. For more information, see POP3 Function Callback Mapping.

See Also

pop3Sink_t.xAuthListStart, pop3Sink_t.xAuthList,
pop3Sink_t.xAuthListComplete, pop3Sink_t.error,
pop3_xSender
[Top] [POP3 Functions] [POP3 Functions by Task]

pop3_xSender

Gets the email address of the sender of the specified message.

Syntax

#include <pop3.h> 
int pop3_xSender(
pop3Client_t * in_pPOP3,
                  int in_messageNumber );

Parameters

The function has the following parameters:
in_pPOP3

Pointer to the POP3 client.

in_messageNumber

Message number.

Returns

Description

This function allows a client to query whether an particular message has been authenticated. The server returns the email address of the authenticated sender in a callback or, if no authenticated sender is found, an empty OK string.

This function sends the XSENDER [arg] POP3 protocol command. It is mapped to one or more callbacks in the pop3Sink_t structure. For more information, see POP3 Function Callback Mapping.

See Also

pop3Sink_t.xSender, pop3Sink_t.error, 
pop3_xAuthList, pop3_xAuthListA
[Top] [POP3 Functions] [POP3 Functions by Task]

POP3 Structures

This section defines POP3 data structures, listed in alphabetical order.

pop3Client_t
pop3Sink_t

[Top] [POP3 Functions]

pop3Client_t

Structure used by a client to communicate with a POP3 server.

Syntax

typedef struct pop3Client pop3Client_t;

Description

The client uses this structure to communicate with an SMTP server. The developer uses this structure to perform SMTP API operations. All data contained within the client structure is used internally by the API.

For more information, see Creating a Client.

See Also

pop3_free, pop3_initialize
[Top] [POP3 Structures] [POP3 Functions]

pop3Sink_t

Definition of the POP3 response sink.

Syntax

typedef struct pop3Sink
{
   void * pOpaqueData;
   void (*connect)( pop3SinkPtr_t * in_pPOP3Sink,
         const char * in_responseMessage );
   void (*dele)( pop3SinkPtr_t * in_pPOP3Sink,
         const char * in_responseMessage );
   void (*error)( pop3SinkPtr_t * in_pPOP3Sink,
         const char * in_responseMessage );
   void (*listStart) ( pop3SinkPtr_t * in_pPOP3Sink );
   void (*list)( pop3SinkPtr_t * in_pPOP3Sink,
         int in_messageNumber, int in_octetCount );
   void (*listComplete)(
         pop3SinkPtr_t * in_pPOP3Sink );
   void (*noop)( pop3SinkPtr_t * in_pPOP3Sink );
   void (*pass)(pop3SinkPtr_t * in_pPOP3Sink,
          const char * in_responseMessage );
   void (*quit)(pop3SinkPtr_t * in_pPOP3Sink,
         const char * in_responseMessage );
   void (*reset)(pop3SinkPtr_t * in_pPOP3Sink,
         const char * in_responseMessage );
   void (*retrieveStart)(
         pop3SinkPtr_t * in_pPOP3Sink,
         int in_messageNumber, int in_octetCount );
   void (*retrieve)( pop3SinkPtr_t * in_pPOP3Sink,
         const char * in_messageChunk );
   void (*retrieveComplete) ( pop3SinkPtr_t *
         in_pPOP3Sink );
   void (*sendCommandStart) ( pop3SinkPtr_t *
         in_pPOP3Sink );
   void (*sendCommand) ( pop3SinkPtr_t * in_pPOP3Sink,
         const char * in_responseMessage );
   void (*sendCommandComplete)(
         pop3SinkPtr_t * in_pPOP3Sink );
   void (*stat)( pop3SinkPtr_t * in_pPOP3Sink,
         int in_messageCount, int in_octetCount );
   void (*topStart)( pop3SinkPtr_t * in_pPOP3Sink,
         int in_messageNumber );
   void (*top)( pop3SinkPtr_t * in_pPOP3Sink,
         const char * in_responseLine );
   void (*topComplete)( pop3SinkPtr_t * in_pPOP3Sink );
   void (*uidListStart)( pop3SinkPtr_t * in_pPOP3Sink );
   void (*uidList)( pop3SinkPtr_t * in_pPOP3Sink,
         int in_messageNumber, const char * in_uid );
   void (*uidListComplete)( pop3SinkPtr_t * in_pPOP3Sink );
   void (*user)( pop3SinkPtr_t * in_pPOP3Sink,
         const char * in_responseMessage );
   void (*xAuthListStart)(
         pop3SinkPtr_t * in_pPOP3Sink );
   void (*xAuthList)( pop3SinkPtr_t * in_pPOP3Sink,
         int in_messageNumber,
         const char * in_emailAddress );
   void (*xAuthListComplete)(
         pop3SinkPtr_t * in_pPOP3Sink );
   void (*xSender)( pop3SinkPtr_t * in_pPOP3Sink,
         const char * in_emailAddress );
} pop3SinkPtr_t;

Fields

The structure has the following fields:
void * pOpaqueData;

User data.

void (*connect)(
   pop3SinkPtr_t in_pPOP3Sink,
   const char * in_responseMessage );

Notification for the response to the connection to the server. Parameters: the response sink to use, the server's response message.

void (*dele)( 
   pop3SinkPtr_t in_pPOP3Sink,
   const char * in_responseMessage );

Notification for the response to the DELE command. Parameters: the response sink to use, the server's response message.

void (*error)(
   pop3SinkPtr_t in_pPOP3Sink,
   const char * in_responseMessage );

Notification for an error. Parameters: the response sink to use, the server's error response message.

void (*listStart)(
   pop3SinkPtr_t in_pPOP3Sink );

Notification for the start of the LIST command. Parameters: the response sink to use.

void (*list)(
   pop3SinkPtr_t in_pPOP3Sink,
   int in_messageNumber,
   int in_octetCount );

Notification for the response to the LIST command. Parameters: the response sink to use, number of the message, octet count of the message.

void (*listComplete)(
   pop3SinkPtr_t in_pPOP3Sink );

Notification for the completion of the LIST command. Parameters: the response sink to use.

void (*noop)(
   pop3SinkPtr_t in_pPOP3Sink );

Notification for the response to the NOOP command. Parameters: the response sink to use.

void (*pass)(
   pop3SinkPtr_t in_pPOP3Sink,
   const char * in_responseMessage );

Notification for the response to the PASS command. Parameters: the response sink to use, server response.

void (*quit)(
   pop3SinkPtr_t in_pPOP3Sink,
   const char * in_responseMessage );

Notification for the response to the QUIT command. Parameters: the response sink to use, server response.

void (*reset)(
   pop3SinkPtr_t in_pPOP3Sink,
   const char * in_responseMessage );

Notification for the response to the RSET command. Parameters: the response sink to use, server response.

void (*retrieveStart)(
   pop3SinkPtr_t in_pPOP3Sink,
   int in_messageNumber,
   int in_octetCount );

Notification for the start of the RETR command. Parameters: the response sink to use, message numbers, octet count of message.

void (*retrieve)(
   pop3SinkPtr_t in_pPOP3Sink,
   const char * in_messageChunk );

Notification for the response to the RETR command. Parameters: the response sink to use, chunk of message to retrieve

void (*retrieveComplete)
   pop3SinkPtr_t in_pPOP3Sink );

Notification for the completion of the RETR command. Parameters: the response sink to use.

void (*sendCommandStart)
   pop3SinkPtr_t in_pPOP3Sink );

Notification for the start of an extended command. Parameters: the response sink to use.

void (*sendCommand)(
   pop3SinkPtr_t in_pPOP3Sink,
   const char * in_responseMessage );

Notification for the response of an extended command. Parameters: the response sink to use, server response.

void (*sendCommandComplete)
   pop3SinkPtr_t in_pPOP3Sink );

Notification for the completion of and extended command. Parameters: the response sink to use.

void (*stat)(
   pop3SinkPtr_t in_pPOP3Sink,
   int in_messageCount,
   int in_octetCount );

Notification for the response to the STAT command. Parameters: the response sink to use, message numbers, octet count of message.

void (*topStart)(
   pop3SinkPtr_t * in_pPOP3Sink,
   int in_messageNumber );

Notification for the start of the TOP command. Parameters: the response sink to use, number of the message.

void (*top)(
   pop3SinkPtr_t in_pPOP3Sink,
   const char * in_responseLine );

Notification for the response to the TOP command. Parameters: the response sink to use, line of message.

void (*topComplete)(
   pop3SinkPtr_t in_pPOP3Sink );

Notification for the completion of the TOP command. Parameters: the response sink to use.

void (*uidListStart)(
   pop3SinkPtr_t in_pPOP3Sink );

Notification for the start of the UIDL command. Parameters: the response sink to use.

void (*uidList)(
   pop3SinkPtr_t in_pPOP3Sink,
   int in_messageNumber,
   const char * in_uid );

Notification for the response to the UIDL command. Parameters: the response sink to use, number of the message, unique identifier.

void (*uidListComplete)(
   pop3SinkPtr_t in_pPOP3Sink );

Notification for the completion of the UIDL command. Parameters: the response sink to use.

void (*user)(
   pop3SinkPtr_t in_pPOP3Sink,
   const char * in_responseMessage );

Notification for the response to the USER command. Parameters: the response sink to use, server response.

void (*xAuthListStart)(
   pop3SinkPtr_t in_pPOP3Sink );

Notification for the start of the XAUTHLIST command. Parameters: the response sink to use.

void (*xAuthList)(
   pop3SinkPtr_t in_pPOP3Sink,
   int in_messageNumber,
   const char * in_emailAddress );

Notification for the response to the XAUTHLIST command. Parameters: the response sink to use, number of the message, email address.

void (*xAuthListComplete)
   pop3SinkPtr_t in_pPOP3Sink );

Notification for the completion of the XAUTHLIST command. Parameters: the response sink to use.

void (*xSender)(
   pop3SinkPtr_t in_pPOP3Sink,
   const char * in_emailAddress );

Notification for the response to the XSENDER command. Parameters: the response sink to use, the email address.


Description

The POP3 response sink structure is made up of function pointers and opaque data. You must define the functions yourself, and you must point these pointers to your functions if you want to receive the related server responses. For more information, see SDK Response Sinks for C and Creating a Response Sink.

The function pointers serve as callbacks for many POP3 functions. See POP3 Function Callback Mapping.

See Also

pop3_initialize, pop3Sink_free
[Top] [POP3 Structures]


Table of Contents | Previous | Next | Index

Last Updated: June 3, 1998

Copyright © 1998 Netscape Communications Corporation