Message Store Interface

script cms.cpl
interface MessageStore
COM progId Carapace.MessageStore

Carapace message stores -- as the name suggests -- store messages for users. They are accessed using the MessageStore interface.

Click here for a general description of Carapace message stores.

MessageStore Creation

An MessageStore is created by using the create function eg.

    (create MessageStore aud)
where aud is an Auditor object.

MessageStore Properties

property name property type description
addressType String the type of address used within the message store -- the default type is email signifying Internet-style addresses (RFC-822)
userId String a unique id for the user
password String the user's password -- for validation against the value stored within the database
state String the state of the message store connection -- either connected or disconnected
msid Integer the message store identifier -- valid once connected

MessageStore Methods

The MessageStore interface contains the following methods:

connect connect to the message store
disconnect disconnect from the message store
isConnected test if the message store connection has been established
abandon abandon the message store connection -- any messages which have been marked for deletion have their status reset
store store a message for the identified recipients
fetch fetch the identified message
delete delete the identified message
count count the no. of messages in the user's message store
size return the total size of all messages held in the user's message store
msgSize return the size of the given message - returns -1 if there is no such message
summary summarise the contents of the user's message store
list list messages having the given status -- a status of * means all messages
setStatus set the status of the identified message
markedForDelete test if the identified message has been marked for deletion
userDomain determine the domain from the supplied address
isLocalUser if the supplied address is local -- ie. within a local domain -- return the message store id otherwise return the empty List ()


connect

Connect to the user's message store. The user and password properties are checked against the values in the database using the Authentication interface.

If connection is successful, a session identifier is returned.

Arguments: none

Return type: String


disconnect

Disconnect from the user's message store.

Arguments: none

Return type: the empty List ()


isConnected

Test if the message store connection has been established. If there is no connection, the empty List () is returned.

Arguments: none

Return type: Object


abandon

Abandon the message store connection -- any messages which have been marked for deletion have their status reset.

Arguments: none

Return type: the empty List ()


store

Store a message for the identified recipients. The sender address and the addresses for each recipient must be formated correctly according to the address type for the message store.

A unique id for the stored message is returned.

Arguments:

senderString
recipientsList
subjectString
contentTypeString
headerString
msgString

Return type: String


fetch

Fetch the identified message. An error is raised if the supplied number does not identify a message within the user's message store.

Arguments:

msgNoInteger

Return type: String


delete

Mark the identified message for deletion. An error is raised if the supplied number does not identify a message within the user's message store or if the message has already been marked for deletion.

The message is irrevocably deleted from the store on a successful disconnect or if deleteMarkedMessages is explicitly invoked.

Arguments:

msgNoInteger

Return type: the empty List


count

Count the no. of messages in the user's message store.

Arguments: none

Return type: Integer


size

Return the total size of all messages held in the user's message store.

Arguments: none

Return type: Integer


msgSize

Return the size of the given message -- returns -1 if there is no such message.

Arguments:

msgNoInteger

Return type: Integer


summary

Summarise the contents of the user's message store. A List of ( msgNo msgSize ) pairs is returned.

Arguments: none

Return type: List


list

List messages having the given status -- a status of * means all messages. Individual status codes are given in the following table:

new
listed
fetched
deleted

The returned List contains lists holding the following:

  1. sequence number within the message store
  2. status
  3. markedForDelete flag
  4. sender
  5. subject
  6. message size (bytes)
  7. content type

Arguments: none

Return type: List


setStatus

Set the status of the identified message.

Arguments:

msgNoInteger

Return type: the empty List


markedForDelete

Test if the identified message has been marked for deletion. The empty List () is returned if the message has not been marked for deletion.

Arguments:

msgNoInteger

Return type: Object


userDomain

Determine the domain from the supplied address. The address must be in the same type as the addressType property for this message store.

Arguments:

addressString

Return type: String


isLocalUser

If the supplied address is local -- ie. within a local domain and identifies a user who has a message store -- return the message store id otherwise return the empty List ().

Arguments:

addressString

Return type: Object


Contents Index Current topic: audit Related topics: databases