libmapiproxy.h File Reference
#include <signal.h>
#include <dcerpc_server.h>
#include <talloc.h>
#include <tevent.h>
#include <tdb.h>
#include <fcntl.h>
#include <gen_ndr/server_id.h>
#include <gen_ndr/exchange.h>

Data Structures

struct  auth_serversupplied_info
 
struct  mapi_handles
 
struct  mapi_handles_context
 
struct  mapiproxy
 
struct  mapiproxy_module
 
struct  mapiproxy_module_list
 
struct  mpm_session
 

Macros

#define __BEGIN_DECLS
 
#define __END_DECLS
 
#define EMSABP_TDB_NAME   "emsabp_tdb.tdb"
 EMSABP server defines. More...
 
#define MAPI_HANDLES_NULL   "null"
 
#define MAPI_HANDLES_RESERVED   0xFFFFFFFF
 
#define MAPI_HANDLES_ROOT   "root"
 

Typedefs

typedef NTSTATUS(* openchange_plugin_init_fn) (void)
 

Enumerations

enum  mapiproxy_status { MAPIPROXY_DEFAULT = 0x0, MAPIPROXY_CUSTOM = 0x1 }
 

Functions

enum MAPISTATUS entryid_set_AB_EntryID (TALLOC_CTX *, const char *, struct SBinary_short *)
 
enum MAPISTATUS entryid_set_folder_EntryID (TALLOC_CTX *, struct GUID *, struct GUID *, uint16_t, uint64_t, struct Binary_r **)
 
openchange_plugin_init_fnload_openchange_plugins (TALLOC_CTX *mem_ctx, const char *path)
 
enum MAPISTATUS mapi_handles_add (struct mapi_handles_context *, uint32_t, struct mapi_handles **)
 
enum MAPISTATUS mapi_handles_delete (struct mapi_handles_context *, uint32_t)
 
enum MAPISTATUS mapi_handles_get_private_data (struct mapi_handles *, void **)
 
enum MAPISTATUS mapi_handles_get_systemfolder (struct mapi_handles *, int *)
 
struct mapi_handles_contextmapi_handles_init (TALLOC_CTX *)
 
enum MAPISTATUS mapi_handles_release (struct mapi_handles_context *)
 
enum MAPISTATUS mapi_handles_search (struct mapi_handles_context *, uint32_t, struct mapi_handles **)
 
enum MAPISTATUS mapi_handles_set_private_data (struct mapi_handles *, void *)
 
enum MAPISTATUS mapi_handles_set_systemfolder (struct mapi_handles *, int)
 
const struct mapiproxy_modulemapiproxy_module_byname (const char *)
 
NTSTATUS mapiproxy_module_dispatch (struct dcesrv_call_state *, TALLOC_CTX *, void *, struct mapiproxy *)
 
NTSTATUS mapiproxy_module_init (struct dcesrv_context *)
 
NTSTATUS mapiproxy_module_ndr_pull (struct dcesrv_call_state *, TALLOC_CTX *, struct ndr_pull *)
 
NTSTATUS mapiproxy_module_pull (struct dcesrv_call_state *, TALLOC_CTX *, void *)
 
NTSTATUS mapiproxy_module_push (struct dcesrv_call_state *, TALLOC_CTX *, void *)
 
__BEGIN_DECLS NTSTATUS mapiproxy_module_register (const void *)
 
NTSTATUS mapiproxy_module_unbind (struct server_id, uint32_t)
 
const struct mapiproxy_modulemapiproxy_server_byname (const char *)
 
const struct mapiproxy_modulemapiproxy_server_bystatus (const char *, enum mapiproxy_status)
 
NTSTATUS mapiproxy_server_dispatch (struct dcesrv_call_state *, TALLOC_CTX *, void *, struct mapiproxy *)
 
TDB_CONTEXT * mapiproxy_server_emsabp_tdb_init (struct loadparm_context *)
 
NTSTATUS mapiproxy_server_init (struct dcesrv_context *)
 
bool mapiproxy_server_loaded (const char *)
 
void * mapiproxy_server_openchangedb_init (struct loadparm_context *)
 
NTSTATUS mapiproxy_server_register (const void *)
 
NTSTATUS mapiproxy_server_unbind (struct server_id, uint32_t)
 
bool mpm_session_cmp (struct mpm_session *, struct dcesrv_call_state *)
 
bool mpm_session_cmp_sub (struct mpm_session *, struct server_id, uint32_t)
 
bool mpm_session_increment_ref_count (struct mpm_session *)
 
struct mpm_sessionmpm_session_init (TALLOC_CTX *, struct dcesrv_call_state *)
 
struct mpm_sessionmpm_session_new (TALLOC_CTX *, struct server_id, uint32_t)
 
bool mpm_session_release (struct mpm_session *)
 
bool mpm_session_set_destructor (struct mpm_session *, bool(*destructor)(void *))
 
bool mpm_session_set_private_data (struct mpm_session *, void *)
 
enum MAPISTATUS openchangedb_create_folder (struct openchangedb_context *, const char *, uint64_t, uint64_t, uint64_t, const char *, int)
 
enum MAPISTATUS openchangedb_create_mailbox (struct openchangedb_context *, const char *, const char *, const char *, uint64_t, const char *)
 
enum MAPISTATUS openchangedb_delete_folder (struct openchangedb_context *, const char *, uint64_t)
 
enum MAPISTATUS openchangedb_get_distinguishedName (TALLOC_CTX *, struct openchangedb_context *, uint64_t, char **)
 FIXME Not used anywhere. More...
 
enum MAPISTATUS openchangedb_get_fid (struct openchangedb_context *, const char *, uint64_t *)
 
enum MAPISTATUS openchangedb_get_fid_by_name (struct openchangedb_context *, const char *, uint64_t, const char *, uint64_t *)
 
enum MAPISTATUS openchangedb_get_fid_from_partial_uri (struct openchangedb_context *, const char *, uint64_t *)
 FIXME Not used anywhere, remove it? More...
 
enum MAPISTATUS openchangedb_get_folder_count (struct openchangedb_context *, const char *, uint64_t, uint32_t *)
 
enum MAPISTATUS openchangedb_get_folder_property (TALLOC_CTX *, struct openchangedb_context *, const char *, uint32_t, uint64_t, void **)
 
const char ** openchangedb_get_folders_names (TALLOC_CTX *, struct openchangedb_context *, const char *, const char *)
 
enum MAPISTATUS openchangedb_get_indexing_url (struct openchangedb_context *, const char *, const char **)
 
enum MAPISTATUS openchangedb_get_MailboxGuid (struct openchangedb_context *, const char *, struct GUID *)
 
enum MAPISTATUS openchangedb_get_MailboxReplica (struct openchangedb_context *, const char *, uint16_t *, struct GUID *)
 
enum MAPISTATUS openchangedb_get_mapistoreURI (TALLOC_CTX *, struct openchangedb_context *, const char *, uint64_t, char **, bool)
 
enum MAPISTATUS openchangedb_get_MAPIStoreURIs (struct openchangedb_context *, const char *, TALLOC_CTX *, struct StringArrayW_r **)
 
enum MAPISTATUS openchangedb_get_message_count (struct openchangedb_context *, const char *, uint64_t, uint32_t *, bool)
 
enum MAPISTATUS openchangedb_get_mid_by_subject (struct openchangedb_context *, const char *, uint64_t, const char *, bool, uint64_t *)
 
enum MAPISTATUS openchangedb_get_new_changeNumber (struct openchangedb_context *, const char *, uint64_t *)
 
enum MAPISTATUS openchangedb_get_new_changeNumbers (struct openchangedb_context *, TALLOC_CTX *, const char *, uint64_t, struct UI8Array_r **)
 
enum MAPISTATUS openchangedb_get_new_public_folderID (struct openchangedb_context *, const char *, uint64_t *)
 
enum MAPISTATUS openchangedb_get_next_changeNumber (struct openchangedb_context *, const char *, uint64_t *)
 
enum MAPISTATUS openchangedb_get_parent_fid (struct openchangedb_context *, const char *, uint64_t, uint64_t *, bool)
 
enum MAPISTATUS openchangedb_get_PublicFolderID (struct openchangedb_context *, const char *, uint32_t, uint64_t *)
 
enum MAPISTATUS openchangedb_get_PublicFolderReplica (struct openchangedb_context *, const char *, uint16_t *, struct GUID *)
 
enum MAPISTATUS openchangedb_get_ReceiveFolder (TALLOC_CTX *, struct openchangedb_context *, const char *, const char *, uint64_t *, const char **)
 
enum MAPISTATUS openchangedb_get_ReceiveFolderTable (TALLOC_CTX *, struct openchangedb_context *, const char *, uint32_t *, struct ReceiveFolder **)
 
enum MAPISTATUS openchangedb_get_SpecialFolderID (struct openchangedb_context *, const char *, uint32_t, uint64_t *)
 
enum MAPISTATUS openchangedb_get_system_idx (struct openchangedb_context *, const char *, uint64_t, int *)
 
enum MAPISTATUS openchangedb_get_SystemFolderID (struct openchangedb_context *, const char *, uint32_t, uint64_t *)
 
enum MAPISTATUS openchangedb_get_table_property (TALLOC_CTX *, struct openchangedb_context *, const char *, uint32_t, uint32_t, void **)
 FIXME Not used anywhere, remove it? see mapiproxy/servers/default/emsmdb/emsmdbp_object.c +1712. More...
 
enum MAPISTATUS openchangedb_get_TransportFolder (struct openchangedb_context *, const char *, uint64_t *)
 
enum MAPISTATUS openchangedb_get_users_from_partial_uri (TALLOC_CTX *, struct openchangedb_context *, const char *, uint32_t *, char ***, char ***)
 FIXME broken? mailboxDN not saved? More...
 
enum MAPISTATUS openchangedb_initialize (TALLOC_CTX *, struct loadparm_context *, struct openchangedb_context **oc_ctx)
 
bool openchangedb_is_public_folder_id (struct openchangedb_context *, uint64_t)
 
enum MAPISTATUS openchangedb_lookup_folder_property (struct openchangedb_context *, uint32_t, uint64_t)
 FIXME Not used anywhere. More...
 
enum MAPISTATUS openchangedb_message_create (TALLOC_CTX *, struct openchangedb_context *, const char *, uint64_t, uint64_t, bool, void **)
 
enum MAPISTATUS openchangedb_message_get_property (TALLOC_CTX *, struct openchangedb_context *, void *, uint32_t, void **)
 
enum MAPISTATUS openchangedb_message_open (TALLOC_CTX *, struct openchangedb_context *, const char *, uint64_t, uint64_t, void **, void **)
 
enum MAPISTATUS openchangedb_message_save (struct openchangedb_context *, void *, uint8_t)
 
enum MAPISTATUS openchangedb_message_set_properties (TALLOC_CTX *, struct openchangedb_context *, void *, struct SRow *)
 
const char * openchangedb_property_get_attribute (uint32_t)
 
enum MAPISTATUS openchangedb_set_folder_properties (struct openchangedb_context *, const char *, uint64_t, struct SRow *)
 
char * openchangedb_set_folder_property_data (TALLOC_CTX *, struct SPropValue *)
 
bool openchangedb_set_locale (struct openchangedb_context *, const char *, uint32_t)
 
enum MAPISTATUS openchangedb_set_mapistoreURI (struct openchangedb_context *, const char *, uint64_t, const char *)
 
enum MAPISTATUS openchangedb_set_ReceiveFolder (struct openchangedb_context *, const char *, const char *, uint64_t)
 
enum MAPISTATUS openchangedb_set_system_idx (struct openchangedb_context *, const char *, uint64_t, int)
 
enum MAPISTATUS openchangedb_table_get_property (TALLOC_CTX *, struct openchangedb_context *, void *, enum MAPITAGS, uint32_t, bool, void **)
 
enum MAPISTATUS openchangedb_table_init (TALLOC_CTX *, struct openchangedb_context *, const char *, uint8_t, uint64_t, void **)
 /details Initialize an openchangedb table More...
 
enum MAPISTATUS openchangedb_table_set_restrictions (struct openchangedb_context *, void *, struct mapi_SRestriction *)
 
enum MAPISTATUS openchangedb_table_set_sort_order (struct openchangedb_context *, void *, struct SSortOrderSet *)
 
enum MAPISTATUS openchangedb_transaction_commit (struct openchangedb_context *)
 
enum MAPISTATUS openchangedb_transaction_start (struct openchangedb_context *)
 

Variables

static const uint8_t GUID_NSPI []
 Represents the NSPI Protocol in Permanent Entry IDs. More...
 

Macro Definition Documentation

§ __BEGIN_DECLS

#define __BEGIN_DECLS

§ __END_DECLS

#define __END_DECLS

§ EMSABP_TDB_NAME

#define EMSABP_TDB_NAME   "emsabp_tdb.tdb"

EMSABP server defines.

Referenced by mapiproxy_server_emsabp_tdb_init().

§ MAPI_HANDLES_NULL

#define MAPI_HANDLES_NULL   "null"

§ MAPI_HANDLES_RESERVED

#define MAPI_HANDLES_RESERVED   0xFFFFFFFF

§ MAPI_HANDLES_ROOT

#define MAPI_HANDLES_ROOT   "root"

Referenced by mapi_handles_add().

Typedef Documentation

§ openchange_plugin_init_fn

typedef NTSTATUS(* openchange_plugin_init_fn) (void)

Enumeration Type Documentation

§ mapiproxy_status

Enumerator
MAPIPROXY_DEFAULT 
MAPIPROXY_CUSTOM 

Function Documentation

§ entryid_set_AB_EntryID()

enum MAPISTATUS entryid_set_AB_EntryID ( TALLOC_CTX *  mem_ctx,
const char *  legacyExchangeDN,
struct SBinary_short *  bin 
)

Build an Address Book EntryID from a legacyExchangeDN

Parameters
mem_ctxpointer to the memory context
legacyExchangeDNthe string to copy into the binary blob
binthe binary blob where the function stores results

References GUID_NSPI.

Referenced by EcDoRpc_RopCreateMessage(), and emsmdbp_object_get_properties_mailbox().

§ entryid_set_folder_EntryID()

enum MAPISTATUS entryid_set_folder_EntryID ( TALLOC_CTX *  mem_ctx,
struct GUID *  MailboxGuid,
struct GUID *  ReplGuid,
uint16_t  FolderType,
uint64_t  fid,
struct Binary_r **  rbin 
)

Build a folder EntryID

Parameters
mem_ctxpointer to the memory context
MailboxGuidpointer to the Mailbox Guid
ReplGuidpointer to the Replica Guid
FolderTypethe type of folder
fidthe folder identifier
rbinthe Binary_r structure where the function stores results
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_INVALID_PARAMETER

§ load_openchange_plugins()

openchange_plugin_init_fn* load_openchange_plugins ( TALLOC_CTX *  mem_ctx,
const char *  path 
)

§ mapi_handles_add()

§ mapi_handles_delete()

enum MAPISTATUS mapi_handles_delete ( struct mapi_handles_context handles_ctx,
uint32_t  handle 
)

§ mapi_handles_get_private_data()

enum MAPISTATUS mapi_handles_get_private_data ( struct mapi_handles handle,
void **  private_data 
)

Get the private data associated to a MAPI handle

Parameters
handlepointer to the MAPI handle structure
private_datapointer on pointer to the private data the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

References mapi_handles::private_data.

Referenced by EcDoRpc_RopCommitStream(), EcDoRpc_RopCopyFolder(), EcDoRpc_RopCopyTo(), EcDoRpc_RopCreateAttach(), EcDoRpc_RopCreateFolder(), EcDoRpc_RopCreateMessage(), EcDoRpc_RopDeleteFolder(), EcDoRpc_RopDeleteMessages(), EcDoRpc_RopEmptyFolder(), EcDoRpc_RopFastTransferSourceCopyTo(), EcDoRpc_RopFastTransferSourceGetBuffer(), EcDoRpc_RopFindRow(), EcDoRpc_RopGetAttachmentTable(), EcDoRpc_RopGetContentsTable(), EcDoRpc_RopGetHierarchyTable(), EcDoRpc_RopGetLocalReplicaIds(), EcDoRpc_RopGetMessageStatus(), EcDoRpc_RopGetPermissionsTable(), EcDoRpc_RopGetPropertiesAll(), EcDoRpc_RopGetPropertiesList(), EcDoRpc_RopGetPropertiesSpecific(), EcDoRpc_RopGetRulesTable(), EcDoRpc_RopGetStreamSize(), EcDoRpc_RopGetTransportFolder(), EcDoRpc_RopIdFromLongTermId(), EcDoRpc_RopLongTermIdFromId(), EcDoRpc_RopModifyPermissions(), EcDoRpc_RopModifyRecipients(), EcDoRpc_RopModifyRules(), EcDoRpc_RopMoveCopyMessages(), EcDoRpc_RopMoveFolder(), EcDoRpc_RopOpenAttach(), EcDoRpc_RopOpenEmbeddedMessage(), EcDoRpc_RopOpenFolder(), EcDoRpc_RopOpenMessage(), EcDoRpc_RopOpenStream(), EcDoRpc_RopQueryPosition(), EcDoRpc_RopQueryRows(), EcDoRpc_RopReadStream(), EcDoRpc_RopRegisterNotification(), EcDoRpc_RopReloadCachedInformation(), EcDoRpc_RopRemoveAllRecipients(), EcDoRpc_RopResetTable(), EcDoRpc_RopRestrict(), EcDoRpc_RopSaveChangesMessage(), EcDoRpc_RopSeekRow(), EcDoRpc_RopSeekStream(), EcDoRpc_RopSetColumns(), EcDoRpc_RopSetMessageReadFlag(), EcDoRpc_RopSetProperties(), EcDoRpc_RopSetStreamSize(), EcDoRpc_RopSortTable(), EcDoRpc_RopSubmitMessage(), EcDoRpc_RopSyncConfigure(), EcDoRpc_RopSyncGetTransferState(), EcDoRpc_RopSyncImportDeletes(), EcDoRpc_RopSyncImportHierarchyChange(), EcDoRpc_RopSyncImportMessageChange(), EcDoRpc_RopSyncImportMessageMove(), EcDoRpc_RopSyncImportReadStateChanges(), EcDoRpc_RopSyncOpenCollector(), EcDoRpc_RopSyncUploadStateStreamBegin(), EcDoRpc_RopSyncUploadStateStreamContinue(), EcDoRpc_RopSyncUploadStateStreamEnd(), EcDoRpc_RopTransportSend(), EcDoRpc_RopWriteStream(), RopEmptyFolder_GenericFolder(), RopGetReceiveFolder(), RopGetReceiveFolderTable(), and RopSetReceiveFolder().

§ mapi_handles_get_systemfolder()

enum MAPISTATUS mapi_handles_get_systemfolder ( struct mapi_handles ,
int *   
)

§ mapi_handles_init()

struct mapi_handles_context* mapi_handles_init ( TALLOC_CTX *  mem_ctx)

Initialize MAPI handles context

Parameters
mem_ctxpointer to the memory context
Returns
Allocated MAPI handles context on success, otherwise NULL

References mapi_handles_context::handles, mapi_handles_context::last_handle, and mapi_handles_context::tdb_ctx.

Referenced by emsmdbp_init().

§ mapi_handles_release()

enum MAPISTATUS mapi_handles_release ( struct mapi_handles_context handles_ctx)

Release MAPI handles context

Parameters
handles_ctxpointer to the MAPI handles context
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

References mapi_handles_context::tdb_ctx.

Referenced by emsmdbp_mapi_handles_destructor().

§ mapi_handles_search()

enum MAPISTATUS mapi_handles_search ( struct mapi_handles_context handles_ctx,
uint32_t  handle,
struct mapi_handles **  rec 
)

Search for a record in the TDB database

Parameters
handles_ctxpointer to the MAPI handles context
handleMAPI handle to lookup
recpointer to the MAPI handle structure the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

References mapi_handles::handle, mapi_handles_context::handles, MAPI_HANDLES_NULL, MAPI_HANDLES_RESERVED, mapi_handles::next, and mapi_handles_context::tdb_ctx.

Referenced by EcDoRpc_RopCommitStream(), EcDoRpc_RopCopyFolder(), EcDoRpc_RopCopyTo(), EcDoRpc_RopCreateAttach(), EcDoRpc_RopCreateFolder(), EcDoRpc_RopCreateMessage(), EcDoRpc_RopDeleteFolder(), EcDoRpc_RopDeleteMessages(), EcDoRpc_RopEmptyFolder(), EcDoRpc_RopFastTransferSourceCopyTo(), EcDoRpc_RopFastTransferSourceGetBuffer(), EcDoRpc_RopFindRow(), EcDoRpc_RopGetAttachmentTable(), EcDoRpc_RopGetContentsTable(), EcDoRpc_RopGetHierarchyTable(), EcDoRpc_RopGetLocalReplicaIds(), EcDoRpc_RopGetMessageStatus(), EcDoRpc_RopGetPermissionsTable(), EcDoRpc_RopGetPropertiesAll(), EcDoRpc_RopGetPropertiesList(), EcDoRpc_RopGetPropertiesSpecific(), EcDoRpc_RopGetRulesTable(), EcDoRpc_RopGetStreamSize(), EcDoRpc_RopGetTransportFolder(), EcDoRpc_RopIdFromLongTermId(), EcDoRpc_RopLongTermIdFromId(), EcDoRpc_RopModifyPermissions(), EcDoRpc_RopModifyRecipients(), EcDoRpc_RopModifyRules(), EcDoRpc_RopMoveCopyMessages(), EcDoRpc_RopMoveFolder(), EcDoRpc_RopOpenAttach(), EcDoRpc_RopOpenEmbeddedMessage(), EcDoRpc_RopOpenFolder(), EcDoRpc_RopOpenMessage(), EcDoRpc_RopOpenStream(), EcDoRpc_RopQueryPosition(), EcDoRpc_RopQueryRows(), EcDoRpc_RopReadStream(), EcDoRpc_RopRegisterNotification(), EcDoRpc_RopReloadCachedInformation(), EcDoRpc_RopRemoveAllRecipients(), EcDoRpc_RopResetTable(), EcDoRpc_RopRestrict(), EcDoRpc_RopSaveChangesMessage(), EcDoRpc_RopSeekRow(), EcDoRpc_RopSeekStream(), EcDoRpc_RopSetColumns(), EcDoRpc_RopSetMessageReadFlag(), EcDoRpc_RopSetProperties(), EcDoRpc_RopSetStreamSize(), EcDoRpc_RopSortTable(), EcDoRpc_RopSubmitMessage(), EcDoRpc_RopSyncConfigure(), EcDoRpc_RopSyncGetTransferState(), EcDoRpc_RopSyncImportDeletes(), EcDoRpc_RopSyncImportHierarchyChange(), EcDoRpc_RopSyncImportMessageChange(), EcDoRpc_RopSyncImportMessageMove(), EcDoRpc_RopSyncImportReadStateChanges(), EcDoRpc_RopSyncOpenCollector(), EcDoRpc_RopSyncUploadStateStreamBegin(), EcDoRpc_RopSyncUploadStateStreamContinue(), EcDoRpc_RopSyncUploadStateStreamEnd(), EcDoRpc_RopTransportSend(), EcDoRpc_RopWriteStream(), RopGetReceiveFolder(), RopGetReceiveFolderTable(), and RopSetReceiveFolder().

§ mapi_handles_set_private_data()

§ mapi_handles_set_systemfolder()

enum MAPISTATUS mapi_handles_set_systemfolder ( struct mapi_handles ,
int   
)

§ mapiproxy_module_byname()

const struct mapiproxy_module* mapiproxy_module_byname ( const char *  )

References mp_modules, and num_mp_modules.

Referenced by mapiproxy_module_load().

§ mapiproxy_module_dispatch()

NTSTATUS mapiproxy_module_dispatch ( struct dcesrv_call_state *  ,
TALLOC_CTX *  ,
void *  ,
struct mapiproxy  
)

§ mapiproxy_module_init()

NTSTATUS mapiproxy_module_init ( struct dcesrv_context *  )

§ mapiproxy_module_ndr_pull()

NTSTATUS mapiproxy_module_ndr_pull ( struct dcesrv_call_state *  ,
TALLOC_CTX *  ,
struct ndr_pull *   
)

§ mapiproxy_module_pull()

NTSTATUS mapiproxy_module_pull ( struct dcesrv_call_state *  ,
TALLOC_CTX *  ,
void *   
)

§ mapiproxy_module_push()

NTSTATUS mapiproxy_module_push ( struct dcesrv_call_state *  ,
TALLOC_CTX *  ,
void *   
)

§ mapiproxy_module_register()

__BEGIN_DECLS NTSTATUS mapiproxy_module_register ( const void *  )

§ mapiproxy_module_unbind()

NTSTATUS mapiproxy_module_unbind ( struct server_id  ,
uint32_t   
)

§ mapiproxy_server_byname()

const struct mapiproxy_module* mapiproxy_server_byname ( const char *  )

§ mapiproxy_server_bystatus()

const struct mapiproxy_module* mapiproxy_server_bystatus ( const char *  ,
enum  mapiproxy_status 
)

§ mapiproxy_server_dispatch()

NTSTATUS mapiproxy_server_dispatch ( struct dcesrv_call_state *  ,
TALLOC_CTX *  ,
void *  ,
struct mapiproxy  
)

§ mapiproxy_server_emsabp_tdb_init()

TDB_CONTEXT* mapiproxy_server_emsabp_tdb_init ( struct loadparm_context *  lp_ctx)

Initialize an EMSABP TDB context available to all instances when Samba is not run in single mode.

Parameters
lp_ctxpointer to the loadparm context
Note
TDB database can't be opened twice with O_RDWR flags. We ensure here we have a general context initialized, which we'll reopen within forked instances

return Allocated TDB context on success, otherwise NULL

References emsabp_tdb_ctx, and EMSABP_TDB_NAME.

Referenced by emsabp_tdb_init().

§ mapiproxy_server_init()

NTSTATUS mapiproxy_server_init ( struct dcesrv_context *  dce_ctx)

Initialize mapiproxy servers modules

Parameters
dce_ctxpointer to the connection context
Returns
NT_STATUS_OK on success otherwise NT error

References load_openchange_plugins(), and mapiproxy_server_load().

Referenced by mapiproxy_op_init_server().

§ mapiproxy_server_loaded()

bool mapiproxy_server_loaded ( const char *  )

§ mapiproxy_server_openchangedb_init()

void* mapiproxy_server_openchangedb_init ( struct loadparm_context *  lp_ctx)

Initialize an openchangedb context available to all mapiproxy instances. This context points on the OpenChange dispatcher database used within emsmdb default provider.

Parameters
lp_ctxpointer to the loadparm context
Note
The memory context is not free'd leading and causes a loss record.
Returns
Allocated openchangedb context on success, otherwise NULL

References openchange_ldb_ctx, and openchangedb_initialize().

Referenced by emsmdbp_openchangedb_init().

§ mapiproxy_server_register()

NTSTATUS mapiproxy_server_register ( const void *  )

§ mapiproxy_server_unbind()

NTSTATUS mapiproxy_server_unbind ( struct server_id  ,
uint32_t   
)

§ mpm_session_cmp()

bool mpm_session_cmp ( struct mpm_session session,
struct dcesrv_call_state *  dce_call 
)

Compare the mpm session with the session context one

This function is a wrapper on mpm_session_cmp_sub

Parameters
sessionpointer to the mapiproxy module session
dce_callpointer to the session context
Returns
true on success, otherwise false
See also
mpm_session_cmp_sub

References mpm_session_cmp_sub(), and mpm_session::server_id.

Referenced by cache_dispatch(), cache_pull_OpenAttach(), cache_pull_OpenMessage(), cache_pull_OpenStream(), cache_pull_Release(), cache_push_OpenAttach(), cache_push_OpenMessage(), cache_push_OpenStream(), and cache_push_ReadStream().

§ mpm_session_cmp_sub()

bool mpm_session_cmp_sub ( struct mpm_session session,
struct server_id  sid,
uint32_t  context_id 
)

Compare the mpm session with the session context one

Parameters
sessionpointer to the mapiproxy module session
sidreference to a server_id structure to compare
context_idthe connection context id to compare

References mpm_session::context_id, and mpm_session::server_id.

Referenced by cache_unbind(), and mpm_session_cmp().

§ mpm_session_increment_ref_count()

bool mpm_session_increment_ref_count ( struct mpm_session session)

Increment the ref_count associated to a session

Parameters
sessionpointer to the session where to increment ref_count
Returns
true on success, otherwise false

References mpm_session::ref_count.

Referenced by dcesrv_EcDoConnect(), dcesrv_EcDoConnectEx(), and dcesrv_NspiBind().

§ mpm_session_init()

struct mpm_session* mpm_session_init ( TALLOC_CTX *  mem_ctx,
struct dcesrv_call_state *  dce_call 
)

Create and return an allocated pointer to a mpm session

Parameters
mem_ctxpointer to the memory context
dce_callpointer to the session context
Returns
Pointer to an allocated mpm_session structure on success, otherwise NULL

References mpm_session_new().

Referenced by cache_pull_OpenAttach(), cache_pull_OpenMessage(), cache_pull_OpenStream(), dcesrv_EcDoConnect(), dcesrv_EcDoConnectEx(), and dcesrv_NspiBind().

§ mpm_session_new()

struct mpm_session* mpm_session_new ( TALLOC_CTX *  mem_ctx,
struct server_id  serverid,
uint32_t  context_id 
)

Create and return an allocated pointer to a mpm session

Parameters
mem_ctxpointer to the memory context
serveridreference to the session context server identifier structure
context_idreference to the context identifier
Returns
Pointer to an allocated mpm_session structure on success, otherwise NULL

References mpm_session::context_id, mpm_session::destructor, mpm_session::private_data, mpm_session::ref_count, and mpm_session::server_id.

Referenced by mpm_session_init().

§ mpm_session_release()

bool mpm_session_release ( struct mpm_session session)

Release a mapiproxy session context

Parameters
sessionpointer to the mpm session context
Returns
true on success, otherwise false

References mpm_session::destructor, mpm_session::private_data, and mpm_session::ref_count.

Referenced by cache_pull_Release(), cache_unbind(), dcesrv_EcDoDisconnect(), and dcesrv_NspiUnbind().

§ mpm_session_set_destructor()

bool mpm_session_set_destructor ( struct mpm_session session,
bool(*)(void *)  destructor 
)

Set the mpm session destructor

Parameters
sessionpointer to the mpm session context
destructorpointer to the destructor function
Returns
true on success, otherwise false

References mpm_session::destructor.

Referenced by dcesrv_EcDoConnect(), dcesrv_EcDoConnectEx(), and dcesrv_NspiBind().

§ mpm_session_set_private_data()

bool mpm_session_set_private_data ( struct mpm_session session,
void *  private_data 
)

Set the mpm session pointer on private data

Parameters
sessionpointer to the mpm session context
private_datageneric pointer on private data
Returns
true on success, otherwise false

References mpm_session::private_data.

Referenced by dcesrv_EcDoConnect(), dcesrv_EcDoConnectEx(), and dcesrv_NspiBind().

§ openchangedb_create_folder()

enum MAPISTATUS openchangedb_create_folder ( struct openchangedb_context *  oc_ctx,
const char *  username,
uint64_t  parentFolderID,
uint64_t  fid,
uint64_t  changeNumber,
const char *  MAPIStoreURI,
int  systemIdx 
)

Create a folder in openchangedb

Parameters
oc_ctxpointer to the openchange DB context
usernameThe name of the mailbox where the parent folder is
parentFolderIDthe FID of the parent folder
fidthe FID of the folder to create
changeNumberthe change number
MAPIStoreURIthe mapistore URI to associate to this folder
systemIdxthe systemIdx value for the new folder
Returns
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error

Referenced by emsmdbp_mailbox_provision(), emsmdbp_mailbox_provision_public_freebusy(), emsmdbp_object_folder_commit_creation(), and emsmdbp_object_move_folder_to_mapistore_root().

§ openchangedb_create_mailbox()

enum MAPISTATUS openchangedb_create_mailbox ( struct openchangedb_context *  oc_ctx,
const char *  username,
const char *  organization_name,
const char *  group_name,
uint64_t  fid,
const char *  display_name 
)

Create a mailbox in openchangedb

Parameters
oc_ctxpointer to the openchange DB context
usernamethe owner of the mailbox
organization_namename of the organization of the user
group_namename of the group where the organization of the user belongs
fidThe fid used for the mailbox
display_nameName of the mailbox
Returns
MAPISTORE_SUCCESS on success, otherwise MAPISTORE error

References EMSMDBP_MAILBOX_ROOT.

Referenced by emsmdbp_mailbox_provision().

§ openchangedb_delete_folder()

enum MAPISTATUS openchangedb_delete_folder ( struct openchangedb_context *  oc_ctx,
const char *  username,
uint64_t  fid 
)

Delete a folder

Parameters
oc_ctxpointer to the openchange DB context
usernamemailbox name where the folder is
fidthe record folder identifier to be deleted
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by emsmdbp_folder_delete(), emsmdbp_folder_move_folder(), and emsmdbp_mailbox_provision().

§ openchangedb_get_distinguishedName()

enum MAPISTATUS openchangedb_get_distinguishedName ( TALLOC_CTX *  parent_ctx,
struct openchangedb_context *  oc_ctx,
uint64_t  fid,
char **  distinguishedName 
)

FIXME Not used anywhere.

Remove it?

Retrieve the distinguishedName associated to a mailbox system folder.

Parameters
parent_ctxpointer to the parent memory context
oc_ctxpointer to the openchange DB context
fidthe Folder identifier to search for
distinguishedNamepointer on pointer to the distinguishedName string the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

§ openchangedb_get_fid()

enum MAPISTATUS openchangedb_get_fid ( struct openchangedb_context *  oc_ctx,
const char *  mapistoreURL,
uint64_t *  fidp 
)

Retrieve the fid associated with a mapistore URI.

Parameters
oc_ctxpointer to the openchange DB context
mapistoreURLmapistore URI to look for
fidppointer to fid the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_get_fid_from_uri(), and emsmdbp_mailbox_provision().

§ openchangedb_get_fid_by_name()

enum MAPISTATUS openchangedb_get_fid_by_name ( struct openchangedb_context *  oc_ctx,
const char *  username,
uint64_t  parent_fid,
const char *  foldername,
uint64_t *  fid 
)

Retrieve the folder ID associated with a given folder name

This function looks up the specified foldername (as a PidTagDisplayName) and returns the associated folder ID. Note that folder names are only unique in the context of a parent folder, so the parent folder needs to be provided.

Parameters
oc_ctxpointer to the openchange DB context
usernamemailbox name where the folder is
parent_fidthe folder ID of the parent folder
foldernamethe name to look up
fidthe folder ID for the folder with the specified name (0 if not found)
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_mailbox_provision(), emsmdbp_mailbox_provision_public_freebusy(), emsmdbp_object_create_folder(), emsmdbp_object_get_fid_by_name(), and emsmdbp_object_move_folder_to_mapistore_root().

§ openchangedb_get_fid_from_partial_uri()

enum MAPISTATUS openchangedb_get_fid_from_partial_uri ( struct openchangedb_context *  oc_ctx,
const char *  partialURI,
uint64_t *  fid 
)

FIXME Not used anywhere, remove it?

Get fid given a partial MAPIStoreURI

Parameters
oc_ctxpointer to the openchange DB context
partialURIpartial MAPIStoreURI to look for
fidpointer on function result for the message class
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

§ openchangedb_get_folder_count()

enum MAPISTATUS openchangedb_get_folder_count ( struct openchangedb_context *  oc_ctx,
const char *  username,
uint64_t  fid,
uint32_t *  RowCount 
)

Retrieve the number of sub folders for a given fid

Parameters
oc_ctxpointer to the openchange DB context
usernamename of the mailbox where the folder is
fidthe folder identifier to use for the search
RowCountpointer to the returned number of results
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_folder_get_folder_count(), and emsmdbp_object_get_properties_systemspecialfolder().

§ openchangedb_get_folder_property()

enum MAPISTATUS openchangedb_get_folder_property ( TALLOC_CTX *  parent_ctx,
struct openchangedb_context *  oc_ctx,
const char *  username,
uint32_t  proptag,
uint64_t  fid,
void **  data 
)

Retrieve a MAPI property value from a folder record

Parameters
parent_ctxpointer to the memory context
oc_ctxpointer to the openchange DB context
usernamemailbox name where the folder is
proptagthe MAPI property tag to retrieve value for
fidthe record folder identifier
datapointer on pointer to the data the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_mailbox_provision(), emsmdbp_object_get_properties_mailbox(), emsmdbp_object_get_properties_mapistore_root(), emsmdbp_object_get_properties_systemspecialfolder(), emsmdbp_object_root_mapistore_folder_set(), emsmdbp_object_set_properties(), and oxosfld_is_special_folder().

§ openchangedb_get_folders_names()

const char** openchangedb_get_folders_names ( TALLOC_CTX *  mem_ctx,
struct openchangedb_context *  oc_ctx,
const char *  locale,
const char *  type 
)

Get a list of names depending of the locale given as parameter

Parameters
mem_ctxcontext memory where the return value will be allocated
oc_ctxpointer to the openchange DB context
localesomething like en_UK or just en (in that case will be look for any en_* entries)
typethe table to look for values, it must be either "special_folders" or "folders"
Returns
array of strings with i18n folders names

Referenced by emsmdbp_get_folders_names(), and emsmdbp_get_special_folders().

§ openchangedb_get_indexing_url()

enum MAPISTATUS openchangedb_get_indexing_url ( struct openchangedb_context *  oc_ctx,
const char *  username,
const char **  indexing_url 
)

Get the indexing url backend for the user given as parameter. The user represents a mailbox. By default a tdb backend file per user will be used in case an error is returned.

Parameters
oc_ctxpointer to the openchange DB context
usernameName of the mailbox
indexing_urlpointer to the result returned

§ openchangedb_get_MailboxGuid()

enum MAPISTATUS openchangedb_get_MailboxGuid ( struct openchangedb_context *  oc_ctx,
const char *  recipient,
struct GUID *  MailboxGUID 
)

Retrieve the mailbox GUID for given recipient from openchange dispatcher database

Parameters
oc_ctxpointer to the OpenChangeDB context
recipientthe mailbox username
MailboxGUIDpointer to the mailbox GUID the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by emsmdbp_mailbox_provision(), oxosfld_is_special_folder(), and RopLogon_Mailbox().

§ openchangedb_get_MailboxReplica()

enum MAPISTATUS openchangedb_get_MailboxReplica ( struct openchangedb_context *  oc_ctx,
const char *  recipient,
uint16_t *  ReplID,
struct GUID *  ReplGUID 
)

Retrieve the mailbox replica identifier and GUID for given recipient from openchange dispatcher database

Parameters
oc_ctxpointer to the OpenChangeDB context
recipientthe mailbox username
ReplIDpointer to the replica identifier the function returns
ReplGUIDpointer to the replica GUID the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by EcDoRpc_RopSyncImportDeletes(), EcDoRpc_RopSyncImportHierarchyChange(), EcDoRpc_RopSyncImportMessageChange(), emsmdbp_guid_to_replid(), emsmdbp_mailbox_provision(), emsmdbp_object_synccontext_init(), emsmdbp_replid_to_guid(), emsmdbp_verify_user(), oxcfxics_fill_synccontext_with_messageChange(), oxcfxics_ndr_push_transfer_state(), oxcfxics_prepare_synccontext_with_folderChange(), oxosfld_is_special_folder(), and RopLogon_Mailbox().

§ openchangedb_get_mapistoreURI()

enum MAPISTATUS openchangedb_get_mapistoreURI ( TALLOC_CTX *  parent_ctx,
struct openchangedb_context *  oc_ctx,
const char *  username,
uint64_t  fid,
char **  mapistoreURL,
bool  mailboxstore 
)

Retrieve the mapistore URI associated to a mailbox system folder.

Parameters
parent_ctxpointer to the memory context
oc_ctxpointer to the openchange DB context
usernamecurrent user
fidthe Folder identifier to search for
mapistoreURLpointer on pointer to the mapistore URI the function returns
mailboxstoreboolean value which defines whether the record has to be searched within Public folders hierarchy or not FIXME mailboxstore always true? remove it?
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_folder_delete(), emsmdbp_get_uri_from_fid(), emsmdbp_mailbox_provision(), emsmdbp_object_open_folder(), and emsmdbp_object_set_properties().

§ openchangedb_get_MAPIStoreURIs()

enum MAPISTATUS openchangedb_get_MAPIStoreURIs ( struct openchangedb_context *  oc_ctx,
const char *  username,
TALLOC_CTX *  mem_ctx,
struct StringArrayW_r **  urisP 
)

Retrieve a list of mapistore URI in use for a certain user

Parameters
oc_ctxpointer to the openchange DB context
usernamethe mailbox name
mem_ctxmemory context where found URIs will be allocated
urisPwhere the Mapistore URIs will be stored
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_mailbox_provision().

§ openchangedb_get_message_count()

enum MAPISTATUS openchangedb_get_message_count ( struct openchangedb_context *  oc_ctx,
const char *  username,
uint64_t  fid,
uint32_t *  RowCount,
bool  fai 
)

Retrieve the number of messages within the specified folder

Parameters
oc_ctxpointer to the openchange DB context
usernameName of the mailbox where the folder is
fidthe folder identifier to use for the search
RowCountpointer to the returned number of results
faiwhether we want to count fai messages or system messages
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_folder_open_table().

§ openchangedb_get_mid_by_subject()

enum MAPISTATUS openchangedb_get_mid_by_subject ( struct openchangedb_context *  oc_ctx,
const char *  username,
uint64_t  parent_fid,
const char *  subject,
bool  mailboxstore,
uint64_t *  mid 
)

Retrieve the message ID associated with a given subject (normalized)

Parameters
oc_ctxpointer to the openchange DB context
usernamemailbox name where the parent folder is
parent_fidthe folder ID of the parent folder
subjectthe normalized subject to look up
mailboxstorewhether the folder is under a mailbox or not
midthe message ID for the message (0 if not found)
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_mailbox_provision_public_freebusy().

§ openchangedb_get_new_changeNumber()

enum MAPISTATUS openchangedb_get_new_changeNumber ( struct openchangedb_context *  oc_ctx,
const char *  username,
uint64_t *  cn 
)

Allocates a new change number and returns it

Parameters
oc_ctxpointer to the openchange DB context
usernamecurrent user
cnpointer to the cn value the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by EcDoRpc_RopCreateFolder(), EcDoRpc_RopSyncImportHierarchyChange(), emsmdbp_mailbox_provision(), emsmdbp_mailbox_provision_public_freebusy(), and emsmdbp_object_move_folder_to_mapistore_root().

§ openchangedb_get_new_changeNumbers()

enum MAPISTATUS openchangedb_get_new_changeNumbers ( struct openchangedb_context *  oc_ctx,
TALLOC_CTX *  mem_ctx,
const char *  username,
uint64_t  max,
struct UI8Array_r **  cns_p 
)

Allocates a batch of new change numbers and returns them

Parameters
oc_ctxpointer to the openchange DB context
mem_ctxmemory context where the change numbers will be allocated
usernamecurrent user
maxnumber of change number to allocate
cns_parray of pointers to the change numbers values the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

§ openchangedb_get_new_public_folderID()

enum MAPISTATUS openchangedb_get_new_public_folderID ( struct openchangedb_context *  oc_ctx,
const char *  username,
uint64_t *  fid 
)

Retrieve a new folder id for a public folder, only used on cases where the openchangedb backend uses folder ids per user. In that case the public folder ids will still be global, per organization

Parameters
oc_ctxpointer to the openchange DB context
usernameThe name of the current login user so we can now the current organization where the public folder will be created
fidpointer to the returned value

Referenced by EcDoRpc_RopCreateFolder(), and get_new_public_folder_id().

§ openchangedb_get_next_changeNumber()

enum MAPISTATUS openchangedb_get_next_changeNumber ( struct openchangedb_context *  oc_ctx,
const char *  username,
uint64_t *  cn 
)

Returns the change number that will be allocated when openchangedb_get_new_changeNumber is next invoked

Parameters
oc_ctxpointer to the openchange DB context
usernamecurrent user
cnpointer to the cn value the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by oxcfxics_check_cnset().

§ openchangedb_get_parent_fid()

enum MAPISTATUS openchangedb_get_parent_fid ( struct openchangedb_context *  oc_ctx,
const char *  username,
uint64_t  fid,
uint64_t *  parent_fidp,
bool  mailboxstore 
)

Retrieve the parent fid associated to a mailbox system folder.

Parameters
oc_ctxpointer to the openchange DB context
usernamethe mailbox name
fidthe Folder identifier to search for
parent_fidppointer to the parent_fid the function returns
mailboxstoreboolean value which defines whether the record has to be searched within Public folders hierarchy or not
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_get_parent_fid(), and emsmdbp_object_open_folder().

§ openchangedb_get_PublicFolderID()

enum MAPISTATUS openchangedb_get_PublicFolderID ( struct openchangedb_context *  oc_ctx,
const char *  username,
uint32_t  SystemIdx,
uint64_t *  FolderId 
)

Retrieve the public folder FolderID (fid) for a given folder type

Parameters
oc_ctxpointer to the OpenChangeDB context
usernamecurrent user
SystemIdxthe system folder index
FolderIdpointer to the folder identifier the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by emsmdbp_mailbox_provision_public_freebusy(), emsmdbp_object_mailbox_init(), and RopLogon_PublicFolder().

§ openchangedb_get_PublicFolderReplica()

enum MAPISTATUS openchangedb_get_PublicFolderReplica ( struct openchangedb_context *  oc_ctx,
const char *  username,
uint16_t *  ReplID,
struct GUID *  ReplGUID 
)

Retrieve the public folder replica identifier and GUID from the openchange dispatcher database

Parameters
oc_ctxpointer to the OpenChangeDB context
usernamecurrent user
ReplIDpointer to the replica identifier the function returns
ReplGUIDpointer to the replica GUID the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by RopLogon_PublicFolder().

§ openchangedb_get_ReceiveFolder()

enum MAPISTATUS openchangedb_get_ReceiveFolder ( TALLOC_CTX *  parent_ctx,
struct openchangedb_context *  oc_ctx,
const char *  recipient,
const char *  MessageClass,
uint64_t *  fid,
const char **  ExplicitMessageClass 
)

Retrieve the Explicit message class and Folder identifier associated to the MessageClass search pattern.

Parameters
parent_ctxpointer to the memory context
oc_ctxpointer to the openchange DB context
recipientpointer to the mailbox's username
MessageClasssubstring to search for
fidpointer to the folder identifier the function returns
ExplicitMessageClasspointer on pointer to the complete message class the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by RopGetReceiveFolder().

§ openchangedb_get_ReceiveFolderTable()

enum MAPISTATUS openchangedb_get_ReceiveFolderTable ( TALLOC_CTX *  mem_ctx,
struct openchangedb_context *  oc_ctx,
const char *  recipient,
uint32_t *  cValues,
struct ReceiveFolder **  entries 
)

Retrieve the list of receive folder identifier, message class along with latest modification time for the mailbox of the user.

Parameters
mem_ctxpointer to the memory context
oc_ctxpointer to the openchange DB context
recipientpointer to the mailbox's username
cValuespointer to the number of ReceiveFolder records the function returns
entriespointer on pointer to the list of ReceiveFolder structure to return
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by RopGetReceiveFolderTable().

§ openchangedb_get_SpecialFolderID()

enum MAPISTATUS openchangedb_get_SpecialFolderID ( struct openchangedb_context *  oc_ctx,
const char *  recipient,
uint32_t  SystemIdx,
uint64_t *  FolderId 
)

Retrieve the folder id of a special folder with the specific SystemIdx for given recipient from openchange dispatcher database.

Parameters
oc_ctxpointer to the OpenChangeDB context
recipientthe mailbox username
SystemIdxthe system folder index
FolderIdpointer to the folder identifier the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by emsmdbp_mailbox_provision().

§ openchangedb_get_system_idx()

enum MAPISTATUS openchangedb_get_system_idx ( struct openchangedb_context *  oc_ctx,
const char *  username,
uint64_t  fid,
int *  system_idx_p 
)

Retrieve the system idx associated with a folder record

Parameters
oc_ctxpointer to the openchange DB context
usernamethe name of the mailbox where the folder is
fidthe folder identifier to use for the search
system_idx_ppointer to the returned value
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_folder_move_folder(), and oxosfld_is_special_folder().

§ openchangedb_get_SystemFolderID()

enum MAPISTATUS openchangedb_get_SystemFolderID ( struct openchangedb_context *  oc_ctx,
const char *  recipient,
uint32_t  SystemIdx,
uint64_t *  FolderId 
)

Retrieve the mailbox FolderID for given recipient from openchange dispatcher database

Parameters
oc_ctxpointer to the OpenChangeDB context
recipientthe mailbox username
SystemIdxthe system folder index
FolderIdpointer to the folder identifier the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by emsmdbp_fetch_freebusy(), emsmdbp_mailbox_provision(), emsmdbp_object_mailbox_init(), oxosfld_is_special_folder(), RopGetReceiveFolder(), and RopLogon_Mailbox().

§ openchangedb_get_table_property()

enum MAPISTATUS openchangedb_get_table_property ( TALLOC_CTX *  parent_ctx,
struct openchangedb_context *  oc_ctx,
const char *  ldb_filter,
uint32_t  proptag,
uint32_t  pos,
void **  data 
)

FIXME Not used anywhere, remove it? see mapiproxy/servers/default/emsmdb/emsmdbp_object.c +1712.

Retrieve a MAPI property from a table (ldb search results)

Parameters
parent_ctxpointer to the memory context
oc_ctxpointer to the openchange DB context
ldb_filterthe ldb search string
proptagthe MAPI property tag to retrieve value for
posthe record position in search results
datapointer on pointer to the data the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

§ openchangedb_get_TransportFolder()

enum MAPISTATUS openchangedb_get_TransportFolder ( struct openchangedb_context *  oc_ctx,
const char *  recipient,
uint64_t *  FolderId 
)

Retrieve the Transport Folder FolderID for given recipient from openchange dispatcher database

Parameters
oc_ctxpointer to the OpenChangeDB context
recipientthe mailbox username
FolderIdpointer to the folder identifier the function returns
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by EcDoRpc_RopGetTransportFolder().

§ openchangedb_get_users_from_partial_uri()

enum MAPISTATUS openchangedb_get_users_from_partial_uri ( TALLOC_CTX *  parent_ctx,
struct openchangedb_context *  oc_ctx,
const char *  partialURI,
uint32_t *  count,
char ***  MAPIStoreURI,
char ***  users 
)

FIXME broken? mailboxDN not saved?

Get users given a partial MAPIStoreURI

Parameters
parent_ctxmemory context
oc_ctxpointer to the openchange DB context
partialURIpartial MAPIStoreURI to look for
countnumber of users found
MAPIStoreURIMAPIStoreURIs of the users found from the partial MAPIStoreURI
usersname of the mailboxes found from the partial MAPIStoreURI
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

§ openchangedb_initialize()

enum MAPISTATUS openchangedb_initialize ( TALLOC_CTX *  ,
struct loadparm_context *  ,
struct openchangedb_context **  oc_ctx 
)

§ openchangedb_is_public_folder_id()

bool openchangedb_is_public_folder_id ( struct openchangedb_context *  oc_ctx,
uint64_t  fid 
)

Whether the current openchangedb backend uses folder ids per user and the given folder id as parameter belongs to a public folder id (which have global folder ids in an organization)

Parameters
oc_ctxpointer to the openchange DB context
fidfolder id to identify if belongs to a either public or system folder

Referenced by EcDoRpc_RopCreateFolder(), and get_new_public_folder_id().

§ openchangedb_lookup_folder_property()

enum MAPISTATUS openchangedb_lookup_folder_property ( struct openchangedb_context *  oc_ctx,
uint32_t  proptag,
uint64_t  fid 
)

FIXME Not used anywhere.

Remove it?

Check if a property exists within an openchange dispatcher database record

Parameters
oc_ctxpointer to the openchange DB context
proptagthe MAPI property tag to lookup
fidthe record folder identifier
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

§ openchangedb_message_create()

enum MAPISTATUS openchangedb_message_create ( TALLOC_CTX *  mem_ctx,
struct openchangedb_context *  oc_ctx,
const char *  username,
uint64_t  messageID,
uint64_t  folderID,
bool  fai,
void **  message_object 
)

Initialize and create a message object

Parameters
mem_ctxpointer to the memory context to use for allocation
oc_ctxpointer to the openchangedb context
usernameThe name of the mailbox where the parent folder of the message is.
messageIDthe identifier of the message to create
folderIDthe identifier of the folder where the message is created
message_objectpointer on pointer to the message object to return
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by EcDoRpc_RopCreateMessage(), and emsmdbp_mailbox_provision_public_freebusy().

§ openchangedb_message_get_property()

enum MAPISTATUS openchangedb_message_get_property ( TALLOC_CTX *  mem_ctx,
struct openchangedb_context *  oc_ctx,
void *  message_object,
uint32_t  proptag,
void **  data 
)

Retrieve a property on a LDB message

Parameters
mem_ctxpointer to the memory context
message_objectthe openchangedb message to retrieve data from
proptagthe MAPI property tag to lookup
datapointer on pointer to the data to return
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by emsmdbp_object_get_properties_message().

§ openchangedb_message_open()

enum MAPISTATUS openchangedb_message_open ( TALLOC_CTX *  mem_ctx,
struct openchangedb_context *  oc_ctx,
const char *  username,
uint64_t  messageID,
uint64_t  folderID,
void **  message_object,
void **  msgp 
)

Initialize and open a message object

Parameters
mem_ctxpointer to the memory context to use for allocation
oc_ctxpointer to the openchangedb context
usernamethe name of the mailbox where the parent folder of the message is.
messageIDthe identifier of the message to open
folderIDthe identifier of the folder where the message is stored
message_objectpointer on pointer to the message object to return
msgppointer on pointer to the mapistore message to return
Returns
MAPI_E_SUCCESS on success, otherwise MAPISTORE error

Referenced by emsmdbp_object_message_open().

§ openchangedb_message_save()

enum MAPISTATUS openchangedb_message_save ( struct openchangedb_context *  oc_ctx,
void *  msg,
uint8_t  SaveFlags 
)

Save (commit) message in openchangedb database

Parameters
msgthe message object
SaveFlagsflags associated to the save operation
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by EcDoRpc_RopSaveChangesMessage(), and emsmdbp_mailbox_provision_public_freebusy().

§ openchangedb_message_set_properties()

enum MAPISTATUS openchangedb_message_set_properties ( TALLOC_CTX *  mem_ctx,
struct openchangedb_context *  oc_ctx,
void *  message_object,
struct SRow *  row 
)

Set a list of properties on a message

Parameters
mem_ctxpointer to the memory context
message_objectpointer to the openchangedb message object
rowpointer to the SRow structure holding the array of properties to set on the message
Returns
MAPI_E_SUCCESS on success, otherwise MAPI errors.

Referenced by emsmdbp_mailbox_provision_public_freebusy(), and emsmdbp_object_set_properties().

§ openchangedb_property_get_attribute()

const char* openchangedb_property_get_attribute ( uint32_t  )

§ openchangedb_set_folder_properties()

enum MAPISTATUS openchangedb_set_folder_properties ( struct openchangedb_context *  oc_ctx,
const char *  username,
uint64_t  fid,
struct SRow *  row 
)

Set a MAPI property value from a folder record

Parameters
oc_ctxpointer to the openchange DB context
usernamename of the mailbox where the folder is
fidthe record folder identifier
rowthe MAPI property to set
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by emsmdbp_mailbox_provision(), emsmdbp_object_folder_commit_creation(), and emsmdbp_object_set_properties().

§ openchangedb_set_folder_property_data()

char* openchangedb_set_folder_property_data ( TALLOC_CTX *  mem_ctx,
struct SPropValue *  value 
)

Build a MAPI property suitable for a OpenChange LDB message

Parameters
mem_ctxpointer to the memory context
valuethe MAPI property
Returns
valid string pointer on success, otherwise NULL

References nil_string.

§ openchangedb_set_locale()

bool openchangedb_set_locale ( struct openchangedb_context *  oc_ctx,
const char *  username,
uint32_t  lcid 
)

Set the current locale of the mailbox

Parameters
oc_ctxpointer to the openchange DB context
usernameName of the mailbox
lcidlanguage id
Returns
Whether the locale has been changed or not

Referenced by emsmdbp_mailbox_provision().

§ openchangedb_set_mapistoreURI()

enum MAPISTATUS openchangedb_set_mapistoreURI ( struct openchangedb_context *  oc_ctx,
const char *  username,
uint64_t  fid,
const char *  mapistoreURL 
)

Store the mapistore URI associated to a mailbox system folder.

Parameters
oc_ctxpointer to the openchange DB context
usernamecurrent user
fidthe Folder identifier to search for
mapistoreURLThe mapistore URI to set
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by emsmdbp_mailbox_provision(), emsmdbp_object_root_mapistore_folder_set(), and emsmdbp_object_set_properties().

§ openchangedb_set_ReceiveFolder()

enum MAPISTATUS openchangedb_set_ReceiveFolder ( struct openchangedb_context *  oc_ctx,
const char *  recipient,
const char *  MessageClass,
uint64_t  fid 
)

Set the receive folder for a specific message class.

Parameters
oc_ctxpointer to the openchange DB context
recipientpointer to the mailbox's username
MessageClassmessage class (e.g. IPM.whatever) to set
fidfolder identifier for the recipient folder for the message class
Returns
MAPI_E_SUCCESS on success, otherwise MAPI_E_NOT_FOUND

Referenced by emsmdbp_mailbox_provision(), and RopSetReceiveFolder().

§ openchangedb_set_system_idx()

enum MAPISTATUS openchangedb_set_system_idx ( struct openchangedb_context *  oc_ctx,
const char *  username,
uint64_t  fid,
int  system_idx 
)

Store the system index associated to a mailbox system folder.

Parameters
oc_ctxpointer to the openchange DB context
usernamecurrent user
fidthe Folder identifier to search for
system_idxthe system index
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by emsmdbp_mailbox_provision().

§ openchangedb_table_get_property()

enum MAPISTATUS openchangedb_table_get_property ( TALLOC_CTX *  ,
struct openchangedb_context *  ,
void *  ,
enum  MAPITAGS,
uint32_t  ,
bool  ,
void **   
)

§ openchangedb_table_init()

enum MAPISTATUS openchangedb_table_init ( TALLOC_CTX *  mem_ctx,
struct openchangedb_context *  self,
const char *  username,
uint8_t  table_type,
uint64_t  folderID,
void **  table_object 
)

/details Initialize an openchangedb table

Parameters
mem_ctxpointer to the memory context to use for allocation
usernameThe name of the mailbox where the folder is
table_typethe type of table this object represents
folderIDthe identifier of the folder this table represents
table_objectpointer on pointer to the table object to return
Returns
MAPI_E_SUCCESS on success, otherwise MAPISTORE error

Referenced by emsmdbp_folder_open_table().

§ openchangedb_table_set_restrictions()

enum MAPISTATUS openchangedb_table_set_restrictions ( struct openchangedb_context *  ,
void *  ,
struct mapi_SRestriction *   
)

Referenced by EcDoRpc_RopFindRow().

§ openchangedb_table_set_sort_order()

enum MAPISTATUS openchangedb_table_set_sort_order ( struct openchangedb_context *  self,
void *  table_object,
struct SSortOrderSet *  lpSortCriteria 
)

Set sort order to specified openchangedb table object

Parameters
table_objectpointer to the table object
lpSortCriteriapointer to the sort order to save
Returns
MAPI_E_SUCCESS on success, otherwise MAPI error

Referenced by EcDoRpc_RopSortTable().

§ openchangedb_transaction_commit()

enum MAPISTATUS openchangedb_transaction_commit ( struct openchangedb_context *  )

§ openchangedb_transaction_start()

enum MAPISTATUS openchangedb_transaction_start ( struct openchangedb_context *  )

Variable Documentation

§ GUID_NSPI

const uint8_t GUID_NSPI[]
static
Initial value:
= {
0xDC, 0xA7, 0x40, 0xC8, 0xC0, 0x42, 0x10, 0x1A, 0xB4, 0xB9,
0x08, 0x00, 0x2B, 0x2F, 0xE1, 0x82
}

Represents the NSPI Protocol in Permanent Entry IDs.

Referenced by emsabp_set_PermanentEntryID(), and entryid_set_AB_EntryID().


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/