MAPIStore 1.0 backend.message structure

message.modify_recipients

This functions adds delete or modify recipients on a message. The function takes in parameter:
  • void *message_object: the message object on which to change recipients
  • struct SPropTagArray *columns: the properties to lookup for each recipients specified with struct ModifyRecipientRow *
  • struct ModifyRecipientRow *recipients: an array of recipients structure holding recipients information. See below for detailed explanation
  • uint16_t count: the number of recipients elements in struct ModifyRecipientRow

Generally your backend will temporary maintain a list of recipients. modify_recipients calls are performed whenever something need to be changed within your internal list.

The column parameter defines a set of MAPI properties which are packed for each recipients referenced by the recipients structure.
For each recipient in struct ModifyRecipientRow *, we receive:
  • idx the index within the array
  • RecipClass: the action to perform for this recipient which can be:
    • MODRECIP_NULL: do nothing
    • MODRECIP_INVALID: invalid user
    • MODRECIP_ADD: add the user
    • MODRECIP_MODIFY: replace what has already been saved for the user with this content
    • MODRECIP_REMOVE: remove the user from the list.
  • RecipientRow: a complex structure which values are set or not depending on its RecipientFlags parameter. The function also provides a prop_value DATA blob where values from properties defined in struct SPropTagArray *columns are packed one to next over.

message.save

This operation saves a message on remote/local storage system your backend handles. It takes all the temporary information associated to the message that has been modified/created and dump replicate the change/creation on the remote system. This function takes in parameter the message object. This is for example used when you create or edit a calendar, note, task or draft item.

message.submit

This operation push a message for dispatch. It only apply to emails or appointment invitation. The client expects the message to be sent to the spooler and dispatched to specified recipients.
The function takes in parameters:
  • void *message_object: the message object to submit
  • enum SubmitFlags: unused so far

message.open_attachment

This operation opens an attachment and takes in parameters:
  • void *message_object: the message object the attachment belongs to
  • TALLOC_CTX *: the memory context to use to allocate the attachment object upon success
  • uint32_t aid: the attachment ID number referenced by message.get_attachment_table call
  • void **attachment_object: the attachment object to return

Attachments behaves like messages within a folder: To retrieve messages we first retrieve a content table on the folder object, then query the table for rows and use MID to identify messages.

For attachments MID are replaced with an attachment ID which identifies the index of the attachment within the message object.
This attachment ID is finally referred and returned by OpenChange server as the PidTagAttachNumber MAPI property.

Opening an attachment means to retrieve an attachment stored on a message object and referenced by its attachment ID.

message.create_attachment

This operation creates an attachment object for the message. This function takes in parameters:
  • void *message_object: the message object this attachment belongs to
  • TALLOC_CTX *: the memory context to use to allocate the attachment object upon success
  • void **attachment_object: the attachment object to return
  • uint32_t *aidp: pointer on the attachment ID number to return

message.get_attachment_table

This operation creates a table object to be used along with table operations. The function takes in parameters:
  • void *message_object: the message on which the table has to be created
  • TALLOC_CTX *: the memory context to use to create the table
  • void **table_object: the table object to return
  • uint32_t *row_count: pointer on the total number of attachments the table handles for this message

message.open_embedded_message

This operation opens an attachment as a message. Available operations on message applies to this object once returned.
The function takes in parameters:
  • void *attachment_object: The attachment object representing this message object
  • TALLOC_CTX *: the memory context to use to allocate the message object
  • void **message_object: the message object to return
  • uint64_t *mid: pointer to the message identifier matching the message to return
  • struct mapistore_message **msg: pointer on pointer to a mapistore_message structure which holds message and recipients information about the message.

Also available in: HTML TXT