Indy 9 | Content | Index | Reference

TIdIMAP4Server
Hierarchy, Properties, Methods, Events, See Also, Unit: IdIMAP4Server
Implements an IMAP4 server.

    TIdIMAP4Server = class(TIdTCPServer)

Unit
IdIMAP4Server
Description
TIdIMAP4Server helps developers implement a Internet Message Access Protocol, Version 4rev1 or IMAP4 server as decribed in the Internet Standards document:

- RFC 2060 - Internet Message Access Protocol - Version 4rev1 (http://www.rfc-editor.org/rfc/rfc2060.txt)

IMAP4 allows a client to access and manipulate electronic mail messages on a server. IMAP4rev1 permits manipulation of mailboxes (remote message folders) in a way that is functionally equivalent to local folders. IMAP4rev1 also provides the capability for an offline client to resynchronize with the server.

TIdIMAP4Server.Create
TIdIMAP4Server, See Also
Constructor for the object instance.

    constructor Create(AOwner: TComponent); override;

Description
Create is the constructor for the object instance. Create calls the inherited Create constructor, and initializes the TIdMAPI4Server object instance by setting DefaultPort to the port number used for the IMAP4 protocol (IdPORT_IMAP4).

TIdIMAP4Server.OnCommandAPPEND
TIdIMAP4Server, See Also
Event handler for the IMAP4 APPEND command.

    property OnCommandAPPEND: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
OnCommandAPPEND is a TCommandEvent property that represents the event handler triggered when a threaded client connection executes the IMAP4 APPEND command. OnCommandAPPEND uses arguments in the CmdStr parameter to create a new message and append it to a specified mailbox.

CmdStr may contain the following values:

- mailbox - mailbox name.

- flags - OPTIONAL list of parenthesized message flags.

- timestamp - OPTIONAL date/time for the new message.

- literal - octet count for the message.

Assign a procedure to the event handler that performs the processing required to create a new, and capture the RFC 822-compliant message headers and content from the client connection in Thread. The new message should include any non-blank values indicated in flags and timestamp.

If the append is unsuccessful for any reason, the mailbox MUST be restored to its state before the APPEND attempt. Set Handled to False to indicate that the APPEND process could not be completed successfully in the event handler.

Notes
the APPEND command event handler is not used for message delivery, because it does not provide a mechanism to transfer envelope information.

TIdIMAP4Server.ONCommandAUTHENTICATE
TIdIMAP4Server, See Also
Event handler for the IMAP4 AUTHENTICATE command.

    property ONCommandAUTHENTICATE: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
ONCommandAUTHENTICATE is a TCommandEvent property that represents the event handler triggered when a threaded client issues the IMAP4 AUTHENTICATE command.

ONCommandAUTHENTICATE uses the argument in CmdStr to determine the authentication mechanism for the client connection. If the server supports the requested authentication mechanism, ONCommandAUTHENTICATE must perform an authentication protocol exchange to identify and authenticate the client.

Authentication mechanisms are optional. The server may also perform client authentication using the ONCommandLOGIN event handler.

Note: The server implementation must assign a procedure to the event handler to allow responding to the event notification.

TIdIMAP4Server.ONCommandCAPABILITY
TIdIMAP4Server, See Also
Event type for the IMAP4 CAPABILITY command.

    property ONCommandCAPABILITY: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
ONCommandCAPABILITY is a TCommandEvent property that represents the event handler triggered when the IMAP4 client issues the CAPABILITY command. ONCommandCAPABILITY allows the server to format and transmit a listing that indicates the IMAP4 capabilities supported in the server implementation.

The capability listing should contain a space-delimited listing of capability names beginning with the atom "IMAP4rev1". A capability name which begins with "AUTH=" indicates that the server supports that particular authentication mechanism. Other capability names indicate that the server supports an extension, revision, or amendment to the IMAP4rev1 protocol.

Capability names are standard or standards-track IMAP4rev1 extensions, revisions, or amendments registered with IANA. A capability name may begin with "X" to indicate a non-standard or unregistered capability. For example:

          S: * CAPABILITY IMAP4rev1 AUTH=KERBEROS_V4 XPIG-LATIN

Note: ONCommandCAPABILITY can be issued regardless of the connection or user state. The server implementation must assign a procedure to the event handler to allow responding to the event notification.

TIdIMAP4Server.ONCommandCHECK
TIdIMAP4Server, See Also
Event handler for the IMAP4 CHECK command.

    property ONCommandCHECK: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
ONCommandCHECK is a TCommandEvent property that represents the event handler triggered when the IMAP4 client issues the CHECK command. ONCommandCHECK allows the server implementation to perform implementation- dependent housekeeping required to synchronize the state for the currently selected mailbox with it's representation in a mail store.

Note: Implementing ONCommandCHECK is not required, and should function equivalent to the IMAP NOOP command under those circumstances. The server implementation must assign a procedure to the event handler to allow responding to the event notification.

TIdIMAP4Server.OnCommandCLOSE
TIdIMAP4Server, See Also
Event handler for the IMAP4 CLOSE command.

    property OnCommandCLOSE: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
OnCommandCLOSE is a TCommandEvent property that represents the event handler triggered when the client issues the IMAP4 CLOSE command. OnCommandCLOSE allows the server to remove all messages containing the Deleted flag for the currently selected mailbox, and return the client connection to the authenticated state.

OnCommandCLOSE should not remove deleted messages or raise an error if the mailbox is selected by an IMAP4 EXAMINE command, or is otherwise selected read-only.

OnCommandCLOSE is similar to ONCommandEXPUNGE, except it does not send untagged responses for each deleted message.

Use ONCommandSELECT, ONCommandEXAMINE to open a mailbox in a specific read or write mode. Use ONCommandLOGOUT to implicitly close the selected mailbox and ignore deleted messages.

TIdIMAP4Server.OnCommandCOPY
TIdIMAP4Server, See Also
Event handler for the IMAP4 COPY command.

    property OnCommandCOPY: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
OnCommandCOPY is a TCommandEvent property that represents the event handler triggered when a client issues the IMAP4 COPY command. OnCommandCOPY can be used to implement processing required to copy one or more messages from the current mailbox to an another existing mailbox, as specified by arguments in CmdStr.

CmdStr will contain a message set indicating a message number or range followed by the destination mailbox name.

Note: The server implementation must assign a procedure to the event handler to allow responding to the event notification.

TIdIMAP4Server.ONCommandCREATE
TIdIMAP4Server, See Also
Event type for the IMAP4 CREATE command.

    property ONCommandCREATE: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
ONCommandCREATE is a TCommandEvent property that represents the event handler triggered when a client issues the IMAP4 CREATE command. ONCommandCREATE allows the server to perform processing required to create a new mailbox having the name specified in CmdStr.

ONCommandCREATE cannot create a new mailbox that has a name matching an existing or deleted mailbox. It is also an error to create a mailbox with the reserved name "INBOX". The mailbox name can reflect the folder hierarchy if the server implementation chooses to support hierarchical mail folders.

Use ONCommandDELETE to remove a mailbox from the server mail store.

Note: The server implementation must assign a procedure to the event handler to allow responding to the event notification.

TIdIMAP4Server.ONCommandDELETE
TIdIMAP4Server, See Also
Event type for the IMAP4 DELETE command.

    property ONCommandDELETE: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
ONCommandDELETE is a TCommandEvent property that represents the event handler triggered when a client issues the IMAP4 DELETE command. ONCommandDELETE allows the server to perform processing needed to permanently remove the mailbox name specified in CmdStr from the server mail store.

ONCommandDELETE should not attempt to remove inferior mailboxes in the mail folder hierarchy that cannot be selected, and should return an error indicating the condition.

Note: The server implementation must assign a procedure to the event handler to allow responding to the event notification.

TIdIMAP4Server.OnCommandError
TIdIMAP4Server, See Also
Event handler for an unknown IMAP4 command.

    property OnCommandError: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
OnCommandError is a TCommandEvent property that represents the event handler triggered when a client issues a command which is not recognized by TIdIMAP4Server. OnCommandError allows the server to perform logging or other processing required when a command not present in IMAPCommands is received.

Note: The server implementation can assign a procedure to the event handler to allow responding to the event notification.

TIdIMAP4Server.OnCommandEXAMINE
TIdIMAP4Server, See Also
Event handler for the IMAP4 EXAMINE command.

    property OnCommandEXAMINE: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
OnCommandEXAMINE is a TCommandEvent property that represents the event handler triggered when a client issues the IMAP4 EXAMINE command. OnCommandEXAMINE allows the server to perform processing required to open the mailbox specified in CmdStr for read-only access.

OnCommandEXAMINE, like OnCommandSELECT, must send untagged responses to the client connection to define the initial state of the mailbox, and includes the following:

- FLAGS - FLags defined for the mailbox.

- EXISTS - Number of nmessages in the mailbox.

- RECENT - Number of messages having the Recent flag.

- UIDVALIDITY - The unique identifier validity value.

OnCommandEXAMINE may send an untagged response containing values for UNSEEN indicating the message sequence number for the first unseen message in the mailbox.

OnCommandEXAMINE can be used to select one mailbox for the client connection. It cannot access more than one mailbox simultaneously. AN exist mailbox must be closed when a new mailbox is accessed. Selecting or Examining multiple mailboxes will require multiple client connections.

Use ONCommandSELECT to access a mailbox with write permissions for the client connection.

Note: The server implementation can assign a procedure to the event handler to allow responding to the event notification.

TIdIMAP4Server.ONCommandEXPUNGE
TIdIMAP4Server, See Also
Event handler for the IMAP4 EXPUNGE command.

    property ONCommandEXPUNGE: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
ONCommandEXPUNGE is a TCommandEvent property that represents the event handler triggered when a client issues the IMAP4 EXPUNGE command. ONCommandEXPUNGE allows the server to perform processing required to permanently remove messages containg the Deleted flag in the currently selected mailbox.

ONCommandEXPUNGE returns an untagged response to the client for each message removed from the mailbox.

Use OnCommandCLOSE to remove deleted messages without notification when the mailbox is closed.

Use ONCommandSELECT or ONCommandEXAMINE to open a mailbox in a specific read or write mode. Use ONCommandLOGOUT to implicitly close the selected mailbox and ignore deleted messages.

TIdIMAP4Server.ONCommandFETCH
TIdIMAP4Server, See Also
Event handler for the IMAP4 FETCH command.

    property ONCommandFETCH: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
ONCommandFETCH is a TCommandEvent property that represents the event handler triggered when a client issues the IMAP4 FETCH command. ONCommandFETCH allows the server to perform processing required to retrieve data associated with a message set in the currently selected mailbox. CmdStr contains a message number or range, and the message data items to be fetched from the server mail store.

Message data items can contain one or more of the following:

- ALL - Equivalent to (FLAGS INTERNALDATE RFC822.SIZE ENVELOPE).

- BODY - Non-extensible form of BODYSTRUCTURE.

- BODY[<section>]<offset.count> - The text of a particular body section.

- BODY.PEEK[<section>]<offset.count> - An alternate form of BODY that does not set the Seen flag.

- BODYSTRUCTURE - Structure of the message body indicated in the message headers.

- ENVELOPE - Envelope structure of the message indicated in the message headers. (Uses default field values).

- FAST - Equivalent to (FLAGS INTERNALDATE RFC822.SIZE).

- FLAGS - Flags that are set for this message.

- FULL - Equivalent to (FLAGS INTERNALDATE RFC822.SIZE ENVELOPE BODY).

- INTERNALDATE - The internal date of the message.

- RFC822 - Equivalent to BODY[], but differing in the syntax of the untagged responses using RFC822.

- RFC822.HEADER - Equivalent to BODY.PEEK[HEADER], but differing in the syntax of the untagged responses using RFC822.HEADER.

- RFC822.SIZE - The RFC-822 size of the message.

- RFC822.TEXT - Equivalent to BODY[TEXT], but differing in the syntax of the untagged responses using RFC822.TEXT.

- UID - The unique identifier for the message.

TIdIMAP4Server.ONCommandLIST
TIdIMAP4Server, See Also
Event handler for the IMAP4 LIST command.

    property ONCommandLIST: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
ONCommandLIST is a TCommandEvent property that represents the event handler triggered when the client issues an IMAP4 LIST command. ONCommandLIST allows the server to perform processing required to prepare a list of mailbox names available to the client connection.

CmdStr contains an optional reference name and a mailbox specifier that identify the subset of mailbox names to be returned in the listing. CMdStr may contain the wildcard characters "*" and "%". The Server implementation can hide mailboxes with reserved or special names from wildcard searches.

The special name "INBOX" is included in the output from LIST, if "INBOX" is supported on the server for this user, and can be included based on the reference and mailbox name arguments.

ONCommandLIST must prepare zero or more untagged responses containing the name attributes, hierarchy delimiter, and mailbox name as defined in the IMAP4 LIST Command. Responses should be returned quickly, and with a minimum of processing.

Use ONCommandSELECT or ONCommandEXAMINE to open a mailbox using read/write or read-only access permissions.

TIdIMAP4Server.ONCommandLOGIN
TIdIMAP4Server, See Also
Event handler for the IMAP4 LOGIN command.

    property ONCommandLOGIN: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
ONCommandLOGIN is a TCommandEvent property that represents the event handler triggered when a client issues the IMAP4 LOGIN command. ONCommandLOGIN allows the server to perform processing required to identify and authenticate the client connection using the user name and password values in CmdStr.

When using ONCommandLOGIN, the passsword for the LOGIN command is sent in the clear. Use ONCommandAUTHENTICATE to process cliednt identification and authentication using secure mechanisms.

The Server should send an error message for a failed LOGIN attempt where the password is invalid, but should not specifiy that a user name is incorrect.

The Server implementations may allow non-authenticated access to certain mailboxes. The convention is to use a LOGIN command with the userid "anonymous". A password is required. It is implementation- dependent what requirements, if any, are placed on the password and what access restrictions are placed on anonymous users.

Once authenticated (including as anonymous), it is not possible to re-enter a non-authenticated state.

TIdIMAP4Server.ONCommandLOGOUT
TIdIMAP4Server, See Also
Event handler for the IMAP4 LOGOUT command.

    property ONCommandLOGOUT: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
ONCommandLOGOUT is a TCommandEvent property that represents the event handler triggered when a client issues the IMAP4 LOGOUT command. ONCommandLOGOUT allows the server to perform processing required to close the client connection.

The Server must send an untagged BYE response before the tagged OK response using the client connection in Thread. The IMAP4 state for the client is set to LOGOUT prior to sending responses and closing the physical connection. Note: The client connection cannot re-enter a non-authenticated state after LOGOUT.

Use ONCommandLOGIN or ONCommandAUTHENTICATE to identify and authenticate a client connection to the Server.

Use ONCommandSELECT or ONCommandEXAMINE to open a mailbox after authentication.

TIdIMAP4Server.OnCommandLSUB
TIdIMAP4Server, See Also
Event handler for the IMAP4 LSUB command.

    property OnCommandLSUB: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
OnCommandLSUB is a TCommandEvent property that represents the event handler triggered when a client issues the IMPAP4 LSUB command. OnCommandLSUB allows the server to perform processing required to build a response containing a list of active or subscribed mailboxes for the user account. OnCommandLSUB uses the arguments in CmdStr to identify the reference name and mailbox specifier for the subscribed list.

The server may validate subscribed names to see if the mailbox still exists. When it no longer exists, it should be flagged with the NoSelect attribute in the untagged response. The server should not unilaterally remove a mailbox name from the subscription list even if the mailbox no longer exists.

Note: The server can maintain the subscription list for well-known mailbox names, like "system-alerts", where the server implementation removes the mailbox when the contents expire.

Responses for the LSUB command are written in the same format as the responses for the LIST command.

Use ONCommandSUBSCRIBE to add a mailbox name to the subscribed list. Use ONCommandUNSUBSCRIBE to remove a mailbox name from the subscribed list.

TIdIMAP4Server.ONCommandNOOP
TIdIMAP4Server, See Also
Event handler for the IMAP4 NOOP command.

    property ONCommandNOOP: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
ONCommandNOOP is a TCommandEvent property that represents the event handler triggered when a client issues the IMAP4 NOOP command. ONCommandNOOP allows the server to respond to period polling for new messasges or message status updates during a period of inactivity. ONCommandNOOP can also be used to reset the inactivity logout timer on the server, when it is used in the server implementation.

ONCommandNOOP will always succeed, and should set Handled to True. ONCommandNOOP should generate the untagged responses required to indicate the current mailbox state.

TIdIMAP4Server.OnCommandRENAME
TIdIMAP4Server, See Also
Event handler for the IMAP4 RENAME command.

    property OnCommandRENAME: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
OnCommandRENAME is a TCommandEvent property that represents the event handler triggered when a client issues the IMAP4 RENAME command. OnCommandRENAME allows the server to perform processing required to change the name of an existing mailbox using the arguments supplied in CmdStr. The first argument is the existing mailbox name. The second argument is the desired name for the mailbox.

The server should generate an error response when trying to rename a mailbox that does not exist, or trying to rename a mailbox to a name that does already exist. If the mailbox name includes inferior hierarchical names, then the inferior hierarchical names must also be renamed.

When removing a mailbox, the server must retain the highest used unique identifier of the old mailbox to avoid errors when recreating a mailbox with the same name.

Renaming the "INBOX" mailbox is permitted, and has special behavior. It moves all messages in "INBOX" to a new mailbox with the specified name, leaving "INBOX" empty. If the server implementation supports inferior hierarchical names on "INBOX", they are no affected by renaming "INBOX".

TIdIMAP4Server.OnCommandSEARCH
TIdIMAP4Server, See Also
Event handler for the IMAP4 SEARCH command.

    property OnCommandSEARCH: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
OnCommandSEARCH is a TCommandEvent property that represents the event handler triggered when a client issues the IMAP4 SEARCH command. OnCommandSEARCH allows the server to perform processing required to search a selected mailbox for messages that match the search criteria specified in CmdStr. CmdStr will contain one or more search keys that identify the search fields or values.

Note: Describing all of the IMAP4 search keys and their usage is beyond the scope of this document. Please refer to RFC 2060 for more detailed information on the SEARCH command.

OnCommandSEARCH will generate an untagged response that contains a list of message numbers that match the search criteria.

The Server implementation may exclude body parts with content media types other than "text" and "message" from the search.

TIdIMAP4Server.ONCommandSELECT
TIdIMAP4Server, See Also
Event handler for the IMAP4 SELECT command.

    property ONCommandSELECT: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
ONCommandSELECT is a TCommandEvent property that represents the event handler triggered when a client issues the IMAP4 SELECT command. ONCommandSELECT allows the server to perform processing required to open the mailbox name specified in CmdStr to allow access to the messages. ONCommandSELECT must generate the following untagged responses to define the initial state of the mailbox at the client prior to sending the "OK" response:

- FLAGS - Flags defined flags in the mailbox.

- <n> EXISTS - Number of messages in the mailbox.

- <n> RECENT - Number of messages with the Recent flag set.

- OK [UIDVALIDITY <n>] - Unique identifier validity value.

- OK [UNSEEN <n>] - First unread messasge number.

- OK [PERMANENTFLAGS (<flaglist>)] - Flags that cannot be changed for the mailbox.

The server can selected only one mailbox at a time for the client connection. Simultaneous access to multiple mailboxes requires multiple client connections.

ONCommandSELECT should automatically deselect any currently selected mailbox before attempting the new selection. If a SELECT command fails, then no mailbox will be selected.

If the client is permitted to modify the mailbox, the server should prefix the text of the tagged OK response with the "[READ-WRITE]" response code.

If the client is not permitted to modify the mailbox, the mailbox is selected as read-only. The server must prefix the text of the tagged OK response with the "[READ-ONLY]" response code.

Use ONCommandEXAMINE to open a mailbox with read-only access regardless of user permissions.

TIdIMAP4Server.ONCommandSTATUS
TIdIMAP4Server, See Also
Event handler for the IMAP4 STATUS command.

    property ONCommandSTATUS: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
ONCommandSTATUS is a TCommandEvent property that represents the event handler triggered when a client issues the IMAP4 STATUS command. ONCommandSTATUS allows the server to perform processing needed to indicate the status of the mailbox and data items specified in CmdStr. ONCommandSTATUS should not cause the status or flags for the current mailbox, or any message in the mailbox, to be altered. ONCommandSTATUS is used as an alternative to opening a second connection to a mailbox using ONCommandEXAMINE when checking status information.

Unlike ONCommandLIST, ONCommandSTATUS may require more time to open a mail messages and extract flags and field values. ONCommandSTATUS differs from ONCommandLIST in that wildcardds are not permitted in the mailbox name in CmdStr.

ONCommandSTATUS must be able to locate and extract the following status data items:

- MESSAGES - Number of messages in the mailbox.

- RECENT - Number of messages with the Recent flag set.

- UIDNEXT - Next UID value for new messages in the mailbox.

- UIDVALIDITY - Unique identifier validity value of the mailbox.

- UNSEEN - Number of messages which do not have the Seen flag set.

TIdIMAP4Server.OnCommandSTORE
TIdIMAP4Server, See Also
Event handler for the IMAP4 STORE command.

    property OnCommandSTORE: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
OnCommandSTORE is a TCommandEvent property that represents the event handler triggered when a client issues the IMAP4 STORE command. OnCommandSTORE allows the server to perform processing required to store message data for the message set and data items specified in CmdStr in the currently selected mailbox.

OnCommandSTORE can return updated values with an untagged FETCH response unless the data items contain the ".SILENT" suffix. The server should assume that the client is not interested in the updated value. Note: Even when a data item suffix contains ".SILENT", the server should send an untagged FETCH response if a message flag is changed by an external source.

Message data items can contain the following values and associated meanings:

- FLAGS <flag list> - Sets message flags to the indicated values.

- FLAGS.SILENT <flag list> - Sets message flags to the indicated values. No FETCH response.

- +FLAGS <flag list> - Add the specified flags to the message.

- +FLAGS.SILENT <flag list> - Add the specified flags to the message. No FETCH response.

- -FLAGS <flag list> - Remove the specified flags from the message.

- -FLAGS.SILENT <flag list> - Remove the specified flags from the message. No FETCH response.

TIdIMAP4Server.ONCommandSUBSCRIBE
TIdIMAP4Server, See Also
Event handler for the IMAP4 SUBSCRIBE command.

    property ONCommandSUBSCRIBE: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
ONCommandSUBSCRIBE is a TCommandEvent property that represents the the event handler triggered when a client issues the IMAP4 SUBSCRIBE command. ONCommandSUBSCRIBE allows the server to perform processing required to add the mailbox name specified in CmdStr to the list of subscribed mailboxes for the client connection.

ONCommandSUBSCRIBE can perform validation to insure that CmdStr contains a valid mailbox name. It cannot, however, remove an exisiting mailbox name from the subscribed list if it no longer exists.

Use ONCommandLSUB to retrieve the current list of subscribed mailboxes for the client. Use ONCOmmandUNSUBSCRIBE to remove a mailbox from the subscribed list.

TIdIMAP4Server.ONCommandUID
TIdIMAP4Server, See Also
Event handler for the IMAP4 UID command.

    property ONCommandUID: TCommandEvent;

Description
ONCommandUID is a TCommandEvent property that represents the event handler triggered when a client issues the IMAP4 UID command. ONCommandUID allows the server to perform processing required to retrieve, store, or locate data for messages using the arguments specified in CmdStr.

ONCommandUID must be able to handle arguments in CmdStr that include a command name, a message set, and a flag list. The commands that appear in CmdStr include:

- COPY - Executes an IMAP4 COPY using uniqueness identifiers instead of message numbers.

- FETCH - Retrieves specified arguments using uniqueness identifiers instead of message numbers.

- STORE - Stores message data using uniqueness identifiers instead of message numbers.

- SEARCH - Performs an IMAP4 search returning uniqueness identifiers instead of message numbers.

TIdIMAP4Server.ONCommandUNSUBSCRIBE
TIdIMAP4Server, See Also
Event handler for the IMAP4 UNSUBSCRIBE command.

    property ONCommandUNSUBSCRIBE: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
ONCommandUNSUBSCRIBE is a TCommandEvent property that represents the the event handler triggered when a client issues the IMAP4 UNSUBSCRIBE command. ONCommandUNSUBSCRIBE allows the server to perform processing required to remove the mailbox name specified in CmdStr from the list of subscribed mailboxes for the client connection.

Use ONCommandLSUB to retrieve the current list of subscribed mailboxes for the client. Use ONCOmmandSUBSCRIBE to add a mailbox to the subscribed list.

TIdIMAP4Server.OnCommandX
TIdIMAP4Server, See Also
Event handler for the IMAP4 extended command.

    property OnCommandX: TCommandEvent;

Parameters
CmdStr
Command parameters for the event.
Handled
Indicates the command has been handled in the event handler.
Tag
Tag identifier for the command.
Thread
Client thread for the event notification.
Description
OnCommandX is a TCommandEvent property that represents the event handler triggered when the client issues an IMAP4 extended command where the command verb is prefixed with the letter "X". OnCommandX allows a server-specific implementation of experimental extensions to the IMAP4 protocol.

CmdStr will contain any parameter values to be used in the implementation.

Note: The server implementation must assign a procedure to the event handler to allow responding to the event notification.

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.