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_storethe store to get the outbox folder for
outbox_idthe 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

References OPENCHANGE_RETVAL_IF, and mapi_object::private_data.

_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_storethe public folder store object
obj_folderthe folder object we search replica for
OwningServersCountnumber of OwningServers
CheapServersCountnumber of low-cost servers
OwningServerspointer 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 emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_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_storethe store to get the receiver folder for
id_folderthe resulting folder identification
MessageClasswhich 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 emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_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_storethe message store object
SRowSetpointer 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 emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, OPENCHANGE_RETVAL_IF, PR_FID, PR_LAST_MODIFICATION_TIME, and PR_MESSAGE_CLASS.

_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_storethe store object
StoreStatepointer 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 emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_PUBLIC_ enum MAPISTATUS GetTransportFolder ( mapi_object_t obj_store,
mapi_id_t FolderId 
)

Retrieves the folder ID of the temporary transport folder.

Parameters
obj_storethe server object
FolderIdpointer 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 emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_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_storethe store to open a folder in (i.e. the parent)
id_folderthe folder identifier
obj_folderthe 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 emsmdb_transaction_wrapper(), 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(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

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_folderthe parent folder
obj_childthe resulting open folder
namethe 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 emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_logon_id(), mapi_object_get_session(), mapi_object_set_handle(), mapi_object_set_logon_id(), mapi_object_set_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_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_storethe store of the public folder
obj_folderthe folder we are querying for ghost
IsGhostedpointer 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 emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_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_storethe store to set the receive folder for
obj_folderthe destination folder
lpszMessageClassthe 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 emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), OPENCHANGE_CHECK_NOTIFICATION, and OPENCHANGE_RETVAL_IF.

_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_storethe store that the message is in (logon object)
obj_folderthe folder that the message is in
obj_msgthe message to be processed
MessageClassthe message class of the message to be processed
MessageFlagsthe 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 emsmdb_transaction_wrapper(), mapi_object_get_handle(), mapi_object_get_id(), mapi_object_get_logon_id(), mapi_object_get_session(), and OPENCHANGE_RETVAL_IF.


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