MAPIClientLibraries 2.0 API Documentation

- Main Page
- Related Pages
- Data Structures
- Files
- Examples

- File List
- Globals

Functions
IMsgStore.c File Reference

Folders related operations. More...

`#include "libmapi/libmapi.h"`
`#include "libmapi/libmapi_private.h"`

## Functions
_PUBLIC_ enum MAPISTATUS | GetOutboxFolder (mapi_object_t *obj_store, mapi_id_t *outbox_id)
_PUBLIC_ enum MAPISTATUS | GetOwningServers (mapi_object_t *obj_store, mapi_object_t *obj_folder, uint16_t *OwningServersCount, uint16_t *CheapServersCount, char **OwningServers)
_PUBLIC_ enum MAPISTATUS | GetReceiveFolder (mapi_object_t *obj_store, mapi_id_t *id_folder, const char *MessageClass)
_PUBLIC_ enum MAPISTATUS | GetReceiveFolderTable (mapi_object_t *obj_store, struct SRowSet *SRowSet)
_PUBLIC_ enum MAPISTATUS | GetStoreState (mapi_object_t *obj_store, uint32_t *StoreState)
_PUBLIC_ enum MAPISTATUS | GetTransportFolder (mapi_object_t *obj_store, mapi_id_t *FolderId)
_PUBLIC_ enum MAPISTATUS | OpenFolder (mapi_object_t *obj_store, mapi_id_t id_folder, mapi_object_t *obj_folder)
_PUBLIC_ enum MAPISTATUS | OpenPublicFolderByName (mapi_object_t *obj_folder, mapi_object_t *obj_child, const char *name)
_PUBLIC_ enum MAPISTATUS | PublicFolderIsGhosted (mapi_object_t *obj_store, mapi_object_t *obj_folder, bool *IsGhosted)
_PUBLIC_ enum MAPISTATUS | SetReceiveFolder (mapi_object_t *obj_store, mapi_object_t *obj_folder, const char *lpszMessageClass)
_PUBLIC_ enum MAPISTATUS | TransportNewMail (mapi_object_t *obj_store, mapi_object_t *obj_folder, mapi_object_t *obj_msg, const char *MessageClass, uint32_t MessageFlags)

## Detailed Description

Folders related operations.

## Function Documentation

_PUBLIC_ enum MAPISTATUS GetOutboxFolder | ( | mapi_object_t * | obj_store,
|  | mapi_id_t * | outbox_id
| ) |  |

Retrieves the sending folder (OUTBOX) for a given store

This function obtains the folder that was established as the destination for outgoing messages of a specified message class.

This function does not result in any network traffic.

Parameters

  obj_store | the store to get the outbox folder for
  outbox_id | the resulting folder identification

Returns
  MAPI_E_SUCCESS on success, otherwise MAPI error.

Note
  Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  - MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  - MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

See Also
  MAPIInitialize, OpenMsgStore, GetLastError, GetDefaultFolder

_PUBLIC_ enum MAPISTATUS GetOwningServers | ( | mapi_object_t * | obj_store,
|  | mapi_object_t * | obj_folder,
|  | uint16_t * | OwningServersCount,
|  | uint16_t * | CheapServersCount,
|  | char ** | OwningServers
| ) |  |

Get the list of servers that host replicas of a given public folder.

Parameters

  obj_store | the public folder store object
  obj_folder | the folder object we search replica for
  OwningServersCount | number of OwningServers
  CheapServersCount | number of low-cost servers
  OwningServers | pointer on the list of NULL terminated ASCII string representing replica servers

Returns
  MAPI_E_SUCCESS on success, otherwise MAPI error.

Note
  ecNoReplicaAvailable (0x469) can be returned if no replica is available for the folder.

Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:

- MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
- MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), and mapi_object_get_session().

_PUBLIC_ enum MAPISTATUS GetReceiveFolder | ( | mapi_object_t * | obj_store,
|  | mapi_id_t * | id_folder,
|  | const char * | MessageClass
| ) |  |

Gets the receive folder for incoming messages of a particular message class.

This function obtains the folder that was established as the destination for incoming messages of a specified message class, or the default receive folder for the message store.

Parameters

  obj_store | the store to get the receiver folder for
  id_folder | the resulting folder identification
  MessageClass | which message class to find the receivefolder for

Returns
  MAPI_E_SUCCESS on success, otherwise MAPI error.

Note
  Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  - MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  - MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

See Also
  MAPIInitialize, OpenMsgStore, GetLastError, SetReceiveFolder, GetReceiveFolderTable

References mapi_object_get_handle(), mapi_object_get_logon_id(), and mapi_object_get_session().

_PUBLIC_ enum MAPISTATUS GetReceiveFolderTable | ( | mapi_object_t * | obj_store,
|  | struct SRowSet * | SRowSet
| ) |  |

Retrieve the receive folder table which includes all the information about the receive folders for the message store

Parameters

  obj_store | the message store object
  SRowSet | pointer on a SRowSet structure with GetReceiveFolderTable results.

Developers are required to call MAPIFreeBuffer(SRowSet.aRow) when they don't need the folder table data anymore.

Returns
  MAPI_E_SUCCESS on success, otherwise MAPI error.

Note
  Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  - MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  - MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

See Also
  GetReceiveFolder, SetReceiveFolder

References mapi_object_get_handle(), mapi_object_get_logon_id(), and mapi_object_get_session().

_PUBLIC_ enum MAPISTATUS GetStoreState | ( | mapi_object_t * | obj_store,
|  | uint32_t * | StoreState
| ) |  |

Gets the current store state for the logged in user

This operation must be performed against a user store (not against a Public Folder store). The StoreState will have the STORE_HAS_SEARCHES flag set if there are any active search folders. There are (currently) no other flags in the StoreState.

Parameters

  obj_store | the store object
  StoreState | pointer to the store state returned by the server

Returns
  MAPI_E_SUCCESS on success, otherwise MAPI error.

Note
  Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  - MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  - MAPI_E_INVALID_PARAMETER: obj_store or StoreState are not valid
  - MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References mapi_object_get_handle(), mapi_object_get_logon_id(), and mapi_object_get_session().

_PUBLIC_ enum MAPISTATUS GetTransportFolder | ( | mapi_object_t * | obj_store,
|  | mapi_id_t * | FolderId
| ) |  |

Retrieves the folder ID of the temporary transport folder.

Parameters

  obj_store | the server object
  FolderId | pointer on the returning Folder identifier

Returns
  MAPI_E_SUCCESS on success, otherwise MAPI error.

Note
  Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  - MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  - MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References mapi_object_get_handle(), mapi_object_get_logon_id(), and mapi_object_get_session().

_PUBLIC_ enum MAPISTATUS OpenFolder | ( | mapi_object_t * | obj_store,
|  | mapi_id_t | id_folder,
|  | mapi_object_t * | obj_folder
| ) |  |

Open a folder from the store

Parameters

  obj_store | the store to open a folder in (i.e. the parent)
  id_folder | the folder identifier
  obj_folder | the resulting open folder

Returns
  MAPI_E_SUCCESS on success, otherwise MAPI error.

Note
  Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  - MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  - MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

See Also
  MAPIInitialize, OpenMsgStore, GetLastError

Examples:
  fetchappointment.c, and fetchmail.c.

References mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_id(), mapi_object_set_logon_id(), and mapi_object_set_session().

Referenced by GetUserFreeBusyData().

_PUBLIC_ enum MAPISTATUS OpenPublicFolderByName | ( | mapi_object_t * | obj_folder,
|  | mapi_object_t * | obj_child,
|  | const char * | name
| ) |  |

Open a NNTP Public Folder given its name

Parameters

  obj_folder | the parent folder
  obj_child | the resulting open folder
  name | the folder name

Returns
  MAPI_E_SUCCESS on success, otherwise MAPI error.

Note
  Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  - MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  - MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

See Also
  OpenPublicFolder

References mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), and mapi_object_set_session().

_PUBLIC_ enum MAPISTATUS PublicFolderIsGhosted | ( | mapi_object_t * | obj_store,
|  | mapi_object_t * | obj_folder,
|  | bool * | IsGhosted
| ) |  |

Determine if a public folder is ghosted.

This function returns whether a public folder is ghosted or not.

Parameters

  obj_store | the store of the public folder
  obj_folder | the folder we are querying for ghost
  IsGhosted | pointer on the boolean value returned

Returns
  MAPI_E_SUCCESS on success, otherwise MAPI error.

Note
  Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  - MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  - MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

References mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), and mapi_object_get_session().

_PUBLIC_ enum MAPISTATUS SetReceiveFolder | ( | mapi_object_t * | obj_store,
|  | mapi_object_t * | obj_folder,
|  | const char * | lpszMessageClass
| ) |  |

Sets a folder as the destination for incoming messages of a particular message class.

Parameters

  obj_store | the store to set the receive folder for
  obj_folder | the destination folder
  lpszMessageClass | the message class the folder will receive

Returns
  MAPI_E_SUCCESS on success, otherwise MAPI error.

Note
  Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  - MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  - MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

See Also
  GetReceiveFolder, GetReceiveFolderTable

References mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), and mapi_object_get_session().

_PUBLIC_ enum MAPISTATUS TransportNewMail | ( | mapi_object_t * | obj_store,
|  | mapi_object_t * | obj_folder,
|  | mapi_object_t * | obj_msg,
|  | const char * | MessageClass,
|  | uint32_t | MessageFlags
| ) |  |

Notify the store of a new message to be processed

Parameters

  obj_store | the store that the message is in (logon object)
  obj_folder | the folder that the message is in
  obj_msg | the message to be processed
  MessageClass | the message class of the message to be processed
  MessageFlags | the message flags on the message

Returns
  MAPI_E_SUCCESS on success, otherwise MAPI error.

Note
  Developers may also call GetLastError() to retrieve the last MAPI error code. Possible MAPI error codes are:
  - MAPI_E_NOT_INITIALIZED: MAPI subsystem has not been initialized
  - MAPI_E_INVALID_PARAMETER: one the parameters is invalid
  - MAPI_E_CALL_FAILED: A network problem was encountered during the transaction

See Also
  GetReceiveFolder, GetReceiveFolderTable

References mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), and mapi_object_get_session().

| This content is licensed under the Creative Commons Attribution ShareAlike License v. 3.0: http://creativecommons.org/licenses/by-sa/3.0/