X400 MS (P3/P7) API


Modules

 Session Types
 Event Types
 Message Store Entry Classes
 Error codes for passing into X400msMsgGetFinish

Typedefs

typedef void X400msConnEstablishedCb (struct X400msSession *session, int errorcode, int alert)
 A callback which will be invoked when a P7 bind completes asynchronously, whether the completion is successful or unsuccessful.
typedef void X400msConnDroppedCb (struct X400msSession *session, int reason_code, char *diagnostic)
 A callback which will be invoked when a P7 connection is lost.
typedef void X400msMsgSubmittedCb (struct X400msSession *session, struct X400msMessage *message, int errorcode)
 A callback which will be invoked when a P7 Submission operation completes asynchronously, whether the completion is successful or unsuccessful.
typedef void X400msMsgFetchedCb (struct X400msSession *session, struct X400msMessage *message, int type, int seqno, int errorcode)
 A callback which will be invoked when a P7 Fetch operation completes asynchronously, whether the completion is successful or unsuccessful.
typedef void X400msMsgDeletedCb (struct X400msSession *session, int seqno, int errorcode)
 A callback which will be invoked when a P7 Delete operation completes asynchronously, whether the completion is successful or unsuccessful.
typedef void X400msMsgWaitingCb (struct X400msSession *session, int num_messages_waiting, int errorcode)
 A callback which will be invoked when a P7 Summarize operation (invoked via X400msWait) completes asynchronously, whether the completion is successful or unsuccessful.
typedef void X400msListCb (struct X400msSession *session, struct X400msListResult *lrp, int errorcode)
 A callback which will be invoked when a P7 List operation completes asynchronously, whether the completion is successful or unsuccessful.
typedef void X400msRegisterCb (struct X400msSession *session, int errorcode)
 A callback which will be invoked when a P7 Register operation completes asynchronously, whether the completion is successful or unsuccessful.
typedef void X400msAlertCb (struct X400msSession *session)
 A callback which will be invoked when a P7 Alert invoke is received.
typedef int X400msManageCb (struct X400msSession *session, int fd, int event_mask)
 A callback which will be invoked when a particular file descriptor either needs to be monitored for a given set of event types, or no longer needs to be monitored for the specified event types.

Functions

const char * X400msError (int error)
 Obtain a string describing the meaning of the given error code.
int X400msOpenAsync (int type, const char *oraddr, const char *dirname, const char *credentials, const char *pa, const char *ret_psw, X400msConnEstablishedCb *conupcb, X400msConnDroppedCb *condowncb, X400msMsgSubmittedCb *msgsubcb, X400msMsgFetchedCb *msgfetchcb, X400msMsgDeletedCb *msgdelcb, X400msMsgWaitingCb *msgwaitcb, X400msListCb *listcb, X400msRegisterCb *registercb, X400msAlertCb *alertcb, X400msManageCb *managecb, X400msManageCb *unmanagecb, struct X400msSession **spp)
 Initiate an asynchronous opening of a session to a Message Store (P7).
int X400msOpenAsyncSession (struct X400msSession *sp, const char *addr, const char *dn, const char *credentials, const char *pa, const char *ret_psw, X400msConnEstablishedCb *conupcb, X400msConnDroppedCb *condowncb, X400msMsgSubmittedCb *msgsubcb, X400msMsgFetchedCb *msgfetchcb, X400msMsgDeletedCb *msgdelcb, X400msMsgWaitingCb *msgwaitcb, X400msListCb *listcb, X400msRegisterCb *registercb, X400msAlertCb *alertcb, X400msManageCb *managecb, X400msManageCb *unmanagecb)
 Initiate an asynchronous opening of a session to a Message Store (P7) using an existing session object.
X400msSession * X400msNewAsyncSession (int type)
 Create a new X400msSession object of the specified type.
int X400msGetHandle (struct X400msSession *session)
 Get a handle suitable for use in a call to select().
void X400msSetUserPointer (struct X400msSession *session, void *ptr)
 Set a user pointer value in a session object.
void * X400msGetUserPointer (struct X400msSession *session)
 Get a user pointer value from a session object.
int X400msOpen (int type, const char *oraddr, const char *dirname, const char *credentials, const char *pa, int *messages, struct X400msSession **spp)
 Open a session to a Message Store (P7) or MTA (P3) in synchronous mode.
int X400msOpenCheck (int type, const char *oraddr, const char *dirname, const char *credentials, const char *pa, const char *ret_psw, int *messages, struct X400msSession **spp)
 Open a session to a Message Store (P7) or MTA (P3) in synchronous mode, checking the password which the Message Store or MTA returns.
void X400msSetConfigRequest (int val)
 Disable and enable configuration requests in MS Bind operations.
int X400msClose (struct X400msSession *sp)
 Close a X400 Session.
int X400msList (struct X400msSession *sp, char *since_time, struct X400msListResult **lrp)
 List messages in the P7 Message Store.
int X400msListEx (struct X400msSession *sp, char *since_time, int entryclass, struct X400msListResult **lrp)
 List messages in the P7 Message Store, specifying entryclass.
int X400msListExAux (struct X400msSession *sp, char *since_time, int entryclass, int entrystatus, struct X400msListResult **lrp)
 List messages in the P7 Message Store, specifying entryclass and entrystatus.
int X400msListGetIntParam (struct X400msListResult *lr, int paramtype, int number, int *valp)
 Get an integer attribute value from an element of a ListResult.
int X400msListGetStrParam (struct X400msListResult *lr, int paramtype, int number, char *buffer, size_t buflen, size_t *paramlenp)
 Get a string attribute value from an element of a ListResult.
void X400msListFree (struct X400msListResult *lr)
 Free the memory occupied by a ListResult.
int X400msMsgNew (struct X400msSession *sp, int type, struct X400msMessage **mpp)
 Creates new message.
int X400msMsgCountRecip (struct X400msMessage *mp, int type, int *cp)
 Returns count of addresses of given type in message object.
int X400msMsgSend (struct X400msMessage *mp)
 Send message object.
int X400msMsgDelete (struct X400msMessage *mp, int retain)
 Delete message object.
int X400msMsgAddStrParam (struct X400msMessage *mp, int paramtype, const char *value, size_t length)
 Add string-valued parameter to the message.
int X400msMsgAddIntParam (struct X400msMessage *mp, int paramtype, int value)
 Add integer-valued parameter to the message.
int X400msMsgAddAttachment (struct X400msMessage *mp, int type, const char *string, size_t length)
 Add attachment to the message.
int X400msMsgAddBodypart (struct X400msMessage *mp, struct X400Bodypart *bp)
 Add a body part object to a message.
int X400msMsgAddMessageBodyWType (struct X400msMessage *mp, struct X400Message *mbp, int type)
 Add a message body part object to a message.
int X400msMsgAddMessageBody (struct X400msMessage *mp, struct X400Message *mbp)
int X400msRecipNew (struct X400msMessage *mp, int type, struct X400Recipient **rpp)
 Add new recipient to a message.
int X400msRecipAddStrParam (struct X400Recipient *rp, int paramtype, const char *value, size_t length)
 Add string-valued parameter to the message.
int X400msRecipAddIntParam (struct X400Recipient *rp, int paramtype, int value)
 Add integer-valued parameter to the message.
int X400msWait (struct X400msSession *sp, int seconds, int *count)
 Wait for messages to be ready to be read.
int X400msWaitNew (struct X400msSession *sp, int seconds, int *count)
 Wait for new messages to be ready to be read.
int X400msMsgGet (struct X400msSession *sp, int number, struct X400msMessage **mpp, int *typep, int *seqp)
 Get message object for transfer out from MTA.
int X400msMsgGetEx (struct X400msSession *sp, int number, int entryclass, struct X400msMessage **mpp, int *typep, int *seqp)
 Get message object for transfer out from MTA.
int X400msMsgGetStart (struct X400msSession *sp, int number, struct X400msMessage **mpp, int *typep, int *seqp)
 Get message object for transfer out from MTA.
int X400msMsgGetStartEx (struct X400msSession *sp, int number, int entryclass, struct X400msMessage **mpp, int *typep, int *seqp)
 Get message object for transfer out from MTA.
int X400msMsgGetFinish (struct X400msMessage *mp, int errnum, int problem)
 Generate delivery result or error for a message.
int X400msMsgGetStrParam (struct X400msMessage *mp, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
 Return a string-valued parameter from the message object.
int X400msMsgGetIntParam (struct X400msMessage *mp, int paramtype, int *valp)
 Return a integer-valued parameter from the message object.
int X400msMsgGetAttachment (struct X400msMessage *mp, int number, int *typep, char *buffer, size_t buflen, size_t *lengthp)
 Return a integer-valued parameter from the message object.
int X400msMsgGetBodypart (struct X400msMessage *mp, int number, int *typep, struct X400Bodypart **bpp)
 Return a pointer to a body part object.
int X400msMsgGetMessageBody (struct X400msMessage *mp, int number, struct X400Message **mpp)
 Return a pointer to a message part object.
int X400msMakeIPN (struct X400msMessage *mp, int non_receipt_reason, struct X400msMessage **mpp)
 Get recipient object from message.
int X400msRecipGet (struct X400msMessage *mp, int type, int number, struct X400Recipient **rpp)
 Get recipient object from message.
int X400msRecipGetStrParam (struct X400Recipient *rp, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
 Return a string-valued parameter from the recipient object.
int X400msRecipGetIntParam (struct X400Recipient *rp, int paramtype, int *valp)
 Return a integer-valued parameter from the recipient object.
int X400msSetIntDefault (struct X400msSession *sp, int paramtype, int value)
 Set a default integer parameter value in a session.
int X400msSetStrDefault (struct X400msSession *sp, int paramtype, const char *value, size_t length)
 Set a default string parameter value in a session.
int X400msRegisterAutoAction (struct X400msSession *sp, int type, int id, struct X400msAutoActionParameter *aa_param)
 Register an autoaction with the Message Store.
int X400msDeregisterAutoAction (struct X400msSession *sp, int type, int id)
 Deregister an autoaction from the Message Store.
X400msAutoActionParameter * X400msNewAutoActionParameter (void)
 Create a new (empty) autoaction parameter structure.
void X400msFreeAutoActionParameter (struct X400msAutoActionParameter *aa_param)
 Free an autoaction parameter.
int X400msAutoActionParameterAddRecip (struct X400msAutoActionParameter *aap, int reciptype, struct X400Recipient *recip)
 Add a receipient to the autoaction parameter.
int X400msAutoActionParameterAddIntParam (struct X400msAutoActionParameter *aap, int paramtype, int value)
 Add integer-valued parameter to the autoaction parameter.
int X400msAutoActionParameterAddStrParam (struct X400msAutoActionParameter *aap, int paramtype, const char *value, size_t length)
 Add string-valued parameter to the autoaction parameter.
int X400msDLExpHistGet (struct X400msMessage *mp, int entry, struct X400DLExpHist **hist)
 Create a new DL Expansion History object from the message object.
int X400msDLExpHistNew (struct X400msMessage *mp, struct X400DLExpHist **histp)
 Create a new DL Expansion History object, and associate it with the existing message.
int X400msALINew (struct X400msMessage *mp, struct X400ALI **ali)
 Create a new Address List Indicator Object, and associate it with the existing message.
int X400msALIGet (struct X400msMessage *mp, int entry, struct X400ALI **info)
 Get a Address List Indicator Object for a message object.
int X400msPSSNew (struct X400msMessage *mp, struct X400PSS **pss, int type)
 Create a new Printable String Syntax Object, and associate it with the existing message.
int X400msPSSGet (struct X400msMessage *mp, int type, int entry, struct X400PSS **pss)
 Get a Printable String Syntax Object for a message object.
int X400msDistFieldNew (struct X400msMessage *mp, struct X400DistField **pss)
 Create a new P772 Distribution Field object for a message object.
int X400msDistFieldGet (struct X400msMessage *mp, int entry, struct X400DistField **pss)
 Get a new P772 Distribution Field object for a message object.
int X400msOtherRecipNew (struct X400msMessage *mp, struct X400OtherRecip **otherrecip)
 Create a new P772 Other Recipient object for a message object.
int X400msOtherRecipGet (struct X400msMessage *mp, int entry, struct X400OtherRecip **otherrecip)
 Get a new P772 Other Recipient object for a message object.
int X400msRediHistGetEnv (struct X400msMessage *msg, int entry, struct X400RediHist **hist)
 Get the Redirection History object from a message envelope this is represented by 8.3.1.2.1.5 in X.411.
int X400msTraceInfoGet (struct X400msMessage *mp, int entry, struct X400TraceInfo **info, int type)
 Get a Trace Info object for a message object.
int X400msInternalTraceInfoGet (struct X400msMessage *mp, int entry, struct X400InternalTraceInfo **info)
 Get an Internal Trace Info object for a message object.
int X400msORandDLGet (struct X400msMessage *msg, int entry, struct X400ORandDL **or_and_dl)
 Get Originator and DL expansion history object.

Detailed Description

The function calls which make up the P3 or P7 (X.400 UA) interface.

Typedef Documentation

typedef void X400msConnEstablishedCb(struct X400msSession *session, int errorcode, int alert)

A callback which will be invoked when a P7 bind completes asynchronously, whether the completion is successful or unsuccessful.

Parameters:
session [in] Session to which callback applies
errorcode [in] Indicates success or failure of connection attempt
alert [in] Set for alert indication

Definition at line 358 of file x400_msapi.h.

typedef void X400msConnDroppedCb(struct X400msSession *session, int reason_code, char *diagnostic)

A callback which will be invoked when a P7 connection is lost.

Parameters:
session [in] Session to which callback applies
reason_code [in] Reason for connection loss
diagnostic [in] Diagnostic text

Definition at line 368 of file x400_msapi.h.

typedef void X400msMsgSubmittedCb(struct X400msSession *session, struct X400msMessage *message, int errorcode)

A callback which will be invoked when a P7 Submission operation completes asynchronously, whether the completion is successful or unsuccessful.

Parameters:
session [in] Session to which callback applies
message [in] On success, gives message submission result attributes
errorcode [in] Indicates success or failure of submission

Definition at line 380 of file x400_msapi.h.

typedef void X400msMsgFetchedCb(struct X400msSession *session, struct X400msMessage *message, int type, int seqno, int errorcode)

A callback which will be invoked when a P7 Fetch operation completes asynchronously, whether the completion is successful or unsuccessful.

Parameters:
session [in] Session to which callback applies
message [in] On success, message which has been fetched
type [in] On success, message type
seqno [in] On success, message sequence number
errorcode [in] Indicates success or failure of fetch operation

Definition at line 394 of file x400_msapi.h.

typedef void X400msMsgDeletedCb(struct X400msSession *session, int seqno, int errorcode)

A callback which will be invoked when a P7 Delete operation completes asynchronously, whether the completion is successful or unsuccessful.

Parameters:
session [in] Session to which callback applies
errorcode [in] Indicates success or failure of delete operation

Definition at line 407 of file x400_msapi.h.

typedef void X400msMsgWaitingCb(struct X400msSession *session, int num_messages_waiting, int errorcode)

A callback which will be invoked when a P7 Summarize operation (invoked via X400msWait) completes asynchronously, whether the completion is successful or unsuccessful.

Parameters:
session [in] Session to which callback applies
num_messages_waiting [in] Number of messages waiting
errorcode [in] Indicates success or failure of summarize operation

Definition at line 419 of file x400_msapi.h.

typedef void X400msListCb(struct X400msSession *session, struct X400msListResult *lrp, int errorcode)

A callback which will be invoked when a P7 List operation completes asynchronously, whether the completion is successful or unsuccessful.

Parameters:
session [in] Session to which callback applies
lrp [in] List result pointer on success
errorcode [in] Indicates success or failure of list operation

Definition at line 431 of file x400_msapi.h.

typedef void X400msRegisterCb(struct X400msSession *session, int errorcode)

A callback which will be invoked when a P7 Register operation completes asynchronously, whether the completion is successful or unsuccessful.

Parameters:
session [in] Session to which callback applies
errorcode [in] Indicates success or failure of register operation

Definition at line 442 of file x400_msapi.h.

typedef void X400msAlertCb(struct X400msSession *session)

A callback which will be invoked when a P7 Alert invoke is received.

Parameters:
session [in] Session to which callback applies

Definition at line 450 of file x400_msapi.h.

typedef int X400msManageCb(struct X400msSession *session, int fd, int event_mask)

A callback which will be invoked when a particular file descriptor either needs to be monitored for a given set of event types, or no longer needs to be monitored for the specified event types.

Parameters:
session [in] Session to which callback applies
fd [in] File descriptor to which the callback applies
event_mask [in] The set of events which need to be managed or can now be ignored.

Definition at line 500 of file x400_msapi.h.


Function Documentation

const char* X400msError ( int  error  ) 

Obtain a string describing the meaning of the given error code.

Parameters:
error [in] error code
Returns:
Pointer to NUL terminated string for error
Examples:
examples/x400_mslist.c, examples/x400_msraa.c, examples/x400_msrcv.c, examples/x400_msrcv_sign.c, examples/x400_mssend.c, examples/x400_mssend_sign.c, and x400_msasync.c.

int X400msOpenAsync ( int  type,
const char *  oraddr,
const char *  dirname,
const char *  credentials,
const char *  pa,
const char *  ret_psw,
X400msConnEstablishedCb conupcb,
X400msConnDroppedCb condowncb,
X400msMsgSubmittedCb msgsubcb,
X400msMsgFetchedCb msgfetchcb,
X400msMsgDeletedCb msgdelcb,
X400msMsgWaitingCb msgwaitcb,
X400msListCb listcb,
X400msRegisterCb registercb,
X400msAlertCb alertcb,
X400msManageCb managecb,
X400msManageCb unmanagecb,
struct X400msSession **  spp 
)

Initiate an asynchronous opening of a session to a Message Store (P7).

Parameters:
type [in] Connection type: X400_TYPE_MS, X400_TYPE_MTA_SUBMIT or X400_TYPE_MTA_BOTH
oraddr [in] String encoding of OR-Address to use when binding
dirname [in] String encoding of Directory name to use when binding
credentials [in] String giving the credentials for the session
pa [in] String encoding of MS or Presentation Address to contact.
ret_psw [in] String giving the expected password from the MS or MTA
conupcb [in] Function to be called when connection is open
condowncb [in] Function to be called when connection is lost
msgsubcb [in] Function to be called when submission completes
msgfetchcb [in] Function to be called when fetch completes
msgdelcb [in] Function to be called when delete completes
msgwaitcb [in] Function to be called when wait completes
listcb [in] Function to be called when list completes
registercb [in] Function to be called when register completes
alertcb [in] Function to be called when alert occurs
managecb [in] Function to be called when an event type needs to be handled
unmanagecb [in] Function to be called when an event type does not need to be handled
spp [out] Pointer to receive pointer to opaque session data
Returns:
zero on success or non-zero error code
Both the credentials and ret_psw strings are passwords, for simple authentication. The ret_psw value (if non-NULL) specifies the password we expect to get back from the MS or MTA to which we are binding. The API will perform a check that the returned password matches the expected value and will return an error if they do not match.

The function will return X400_E_WAIT_WRITE, indicating that the client application need to wait for the file descriptor associated with the X400msSession object to become writeable. At this point, X400msProcessEvent needs to be called to handle the 'write' event (which actually indicates that the network-level connection has been established). X400msProcessEvent will then return X400_E_WAIT_READ, to indicate that the application needs to wait for the file descriptor to become readable before calling X400msProcessEvent again. The application will need to call X400msProcessEvent multiple times before the association becomes open - at this point the "X400msConnEstablishedCb" callback will be invoked.

Examples:
x400_msasync.c.

int X400msOpenAsyncSession ( struct X400msSession *  sp,
const char *  addr,
const char *  dn,
const char *  credentials,
const char *  pa,
const char *  ret_psw,
X400msConnEstablishedCb conupcb,
X400msConnDroppedCb condowncb,
X400msMsgSubmittedCb msgsubcb,
X400msMsgFetchedCb msgfetchcb,
X400msMsgDeletedCb msgdelcb,
X400msMsgWaitingCb msgwaitcb,
X400msListCb listcb,
X400msRegisterCb registercb,
X400msAlertCb alertcb,
X400msManageCb managecb,
X400msManageCb unmanagecb 
)

Initiate an asynchronous opening of a session to a Message Store (P7) using an existing session object.

Parameters:
sp [in] Session to connect
addr [in] String encoding of OR-Address to use when binding
dn [in] String encoding of Directory name to use when binding
credentials [in] String giving the credentials for the session
pa [in] String encoding of MS or Presentation Address to contact.
ret_psw [in] String giving the expected password from the MS or MTA
conupcb [in] Function to be called when connection is open
condowncb [in] Function to be called when connection is lost
msgsubcb [in] Function to be called when submission completes
msgfetchcb [in] Function to be called when fetch completes
msgdelcb [in] Function to be called when delete completes
msgwaitcb [in] Function to be called when wait completes
listcb [in] Function to be called when list completes
registercb [in] Function to be called when register completes
alertcb [in] Function to be called when alert occurs
managecb [in] Function to be called when an event type needs to be handled
unmanagecb [in] Function to be called when an event type does not need to be handled
Returns:
zero on success or non-zero error code
Both the credentials and ret_psw strings are passwords, for simple authentication. The ret_psw value (if non-NULL) specifies the password we expect to get back from the MS or MTA to which we are binding. The API will perform a check that the returned password matches the expected value and will return an error if they do not match.

The function will return X400_E_WAIT_WRITE, indicating that the client application need to wait for the file descriptor associated with the X400msSession object to become writeable. At this point, X400msProcessEvent needs to be called to handle the 'write' event (which actually indicates that the network-level connection has been established). X400msProcessEvent will then return X400_E_WAIT_READ, to indicate that the application needs to wait for the file descriptor to become readable before calling X400msProcessEvent again. The application will need to call X400msProcessEvent multiple times before the association becomes open - at this point the "X400msConnEstablishedCb" callback will be invoked.

struct X400msSession* X400msNewAsyncSession ( int  type  ) 

Create a new X400msSession object of the specified type.

Parameters:
type [in] Connection type: X400_TYPE_MS, X400_TYPE_MTA_SUBMIT or X400_TYPE_MTA_BOTH
Returns:
Valid session pointer on success or NULL on error

int X400msGetHandle ( struct X400msSession *  session  ) 

Get a handle suitable for use in a call to select().

Parameters:
session [in] Session to get handle for
Returns:
Valid fd on success or -1 on error
Examples:
x400_msasync.c.

void X400msSetUserPointer ( struct X400msSession *  session,
void *  ptr 
)

Set a user pointer value in a session object.

Parameters:
session [in] Session to set pointer in
ptr [in] Pointer value to set
Returns:
None

void* X400msGetUserPointer ( struct X400msSession *  session  ) 

Get a user pointer value from a session object.

Parameters:
session [in] Session to get pointer from
Returns:
Pointer value

int X400msOpen ( int  type,
const char *  oraddr,
const char *  dirname,
const char *  credentials,
const char *  pa,
int *  messages,
struct X400msSession **  spp 
)

Open a session to a Message Store (P7) or MTA (P3) in synchronous mode.

Parameters:
type [in] Connection type: X400_TYPE_MS, X400_TYPE_MTA_SUBMIT or X400_TYPE_MTA_BOTH
oraddr [in] String encoding of OR-Address to use when binding
dirname [in] String encoding of Directory name to use when binding
credentials [in] String giving the credentials for the session
pa [in] String encoding of MS or MTA Presentation Address to contact.
messages [out] Pointer to integer to get number of messages, or NULL if the result of the Summarize is not required
spp [out] Pointer to receive pointer to opaque session data
Returns:
zero on success or non-zero error code
The credentials string is a password, for simple authentication.

Bear in mind that if you are binding only to submit a message, and don't need to know how many messages there are in the inbox, it's better to pass NULL to the messages paremeter, as that will prevent an expensive SUMMARIZE operation.

Examples:
examples/x400_mslist.c, examples/x400_msraa.c, examples/x400_msrcv.c, examples/x400_msrcv_sign.c, examples/x400_mssend.c, and examples/x400_mssend_sign.c.

int X400msOpenCheck ( int  type,
const char *  oraddr,
const char *  dirname,
const char *  credentials,
const char *  pa,
const char *  ret_psw,
int *  messages,
struct X400msSession **  spp 
)

Open a session to a Message Store (P7) or MTA (P3) in synchronous mode, checking the password which the Message Store or MTA returns.

Parameters:
type [in] Connection type: X400_TYPE_MS, X400_TYPE_MTA_SUBMIT or X400_TYPE_MTA_BOTH
oraddr [in] String encoding of OR-Address to use when binding
dirname [in] String encoding of Directory name to use when binding
credentials [in] String giving the credentials for the session
pa [in] String encoding of MS or MTA Presentation Address to contact.
ret_psw [in] String for the expected password from the MS or MTA
messages [out] Pointer to integer to get number of messages, or NULL if the result of the Summarize is not required
spp [out] Pointer to receive pointer to opaque session data
Returns:
zero on success or non-zero error code
The Directory Name parameter is optional, specify it as NULL to omit.

Both the credentials and ret_psw strings are passwords, for simple authentication. The ret_psw value (if non-NULL) specifies the password we expect to get back from the MS or MTA to which we are binding. The API will perform a check that the returned password matches the expected value and will return an error if they do not match.

Bear in mind that if you are binding only to submit a message, and don't need to know how many messages there are in the inbox, it's better to pass NULL to the messages paremeter, as that will prevent an expensive SUMMARIZE operation.

void X400msSetConfigRequest ( int  val  ) 

Disable and enable configuration requests in MS Bind operations.

Parameters:
val [in] Boolean to turn on or off configuration requests
Returns:
None
Disables and enables configuration requests in MS Bind operations. Default setting is TRUE.
Examples:
examples/x400_mslist.c, examples/x400_msrcv.c, examples/x400_mssend.c, and x400_msasync.c.

int X400msClose ( struct X400msSession *  sp  ) 

Close a X400 Session.

Parameters:
sp [in] Pointer to session data
Returns:
Zero on success or non-zero error code
Closes a session and deletes all resources associated with the session.
Examples:
examples/x400_mslist.c, examples/x400_msraa.c, examples/x400_msrcv.c, examples/x400_msrcv_sign.c, examples/x400_mssend.c, examples/x400_mssend_sign.c, and x400_msasync.c.

int X400msList ( struct X400msSession *  sp,
char *  since_time,
struct X400msListResult **  lrp 
)

List messages in the P7 Message Store.

Parameters:
sp [in] Pointer to session data
since_time [in] Optional UTC time string
lrp [out] Pointer to receive pointer to opaque list result
Returns:
zero on success or non-zero error code
The "since" parameter is optional, specify it as NULL to omit. If specified, it should be a UTC time string, and is used to select only messages which were delivered after that time & date.
Examples:
x400_msasync.c.

int X400msListEx ( struct X400msSession *  sp,
char *  since_time,
int  entryclass,
struct X400msListResult **  lrp 
)

List messages in the P7 Message Store, specifying entryclass.

Parameters:
sp [in] Pointer to session data
since_time [in] Optional UTC time string
entryclass [in] Entry class to list within
lrp [out] Pointer to receive pointer to opaque list result
Returns:
zero on success or non-zero error code
The "since" parameter is optional, specify it as NULL to omit. If specified, it should be a UTC time string, and is used to select only messages which were delivered after that time & date.

int X400msListExAux ( struct X400msSession *  sp,
char *  since_time,
int  entryclass,
int  entrystatus,
struct X400msListResult **  lrp 
)

List messages in the P7 Message Store, specifying entryclass and entrystatus.

Parameters:
sp [in] Pointer to session data
since_time [in] Optional UTC time string
entryclass [in] Entry class to list within
entrystatus [in] Entry status of messages to list
lrp [out] Pointer to receive pointer to opaque list result
Returns:
zero on success or non-zero error code
The "since" parameter is optional, specify it as NULL to omit. If specified, it should be a UTC time string, and is used to select only messages which were delivered after that time & date.
Examples:
examples/x400_mslist.c.

int X400msListGetIntParam ( struct X400msListResult *  lr,
int  paramtype,
int  number,
int *  valp 
)

Get an integer attribute value from an element of a ListResult.

Parameters:
lr [in] List result to access
paramtype [in] Type of parameter to get
number [in] Index of element in ListResult to access
valp [out] Pointer to receive attribute value
Returns:
zero on success or non-zero error code
Retrieve an integer parameter value from an element of a ListResult. Index starts at 1 for the first element of the ListResult. The error code X400_E_NO_MORE_RESULTS is returned when the specified element does not exist. Error code X400_E_NO_VALUES is returned when a particular parameter type is not present in the element.
Examples:
examples/x400_mslist.c, and x400_msasync.c.

int X400msListGetStrParam ( struct X400msListResult *  lr,
int  paramtype,
int  number,
char *  buffer,
size_t  buflen,
size_t *  paramlenp 
)

Get a string attribute value from an element of a ListResult.

Parameters:
lr [in] List result to access
paramtype [in] Type of parameter to get
number [in] Index of element in ListResult to access
buffer [out] Buffer receive attribute value
buflen [in] Length of buffer
paramlenp [out] Pointer to receive length of value
Returns:
zero on success or non-zero error code
Retrieve an string parameter value from an element of a ListResult. Index starts at 1 for the first element of the ListResult. The error code X400_E_NO_MORE_RESULTS is returned when the specified element does not exist. Error code X400_E_NO_VALUES is returned when a particular parameter type is not present in the element.
Examples:
examples/x400_mslist.c, and x400_msasync.c.

void X400msListFree ( struct X400msListResult *  lr  ) 

Free the memory occupied by a ListResult.

Parameters:
lr [in] List result to free
Returns:
none
Free the memory occupied by the given ListResult.
Examples:
examples/x400_mslist.c, and x400_msasync.c.

int X400msMsgNew ( struct X400msSession *  sp,
int  type,
struct X400msMessage **  mpp 
)

Creates new message.

Parameters:
sp [in] X400 session pointer
type [in] Type of message object
mpp [out] pointer to receive pointer to message object
Returns:
zero on success or non-zero error code
Message types are
  • X400_MSG_MESSAGE A Message object
  • X400_MSG_REPORT A Report object
  • X400_MSG_PROBE A Probe object
Examples:
examples/x400_mssend.c, examples/x400_mssend_sign.c, and x400_msasync.c.

int X400msMsgCountRecip ( struct X400msMessage *  mp,
int  type,
int *  cp 
)

Returns count of addresses of given type in message object.

Parameters:
mp [in] X400 MS message
type [in] Type of address to count
cp [out] pointer integer to receive count of addresses
Returns:
zero on success or non-zero error code
Examples:
examples/x400_msrcv.c.

int X400msMsgSend ( struct X400msMessage *  mp  ) 

Send message object.

Parameters:
mp [in] Message pointer
Returns:
Zero on success or non-zero error code
Examples:
examples/x400_mssend.c, examples/x400_mssend_sign.c, and x400_msasync.c.

int X400msMsgDelete ( struct X400msMessage *  mp,
int  retain 
)

Delete message object.

Parameters:
mp [in] Message pointer
retain [in] If true, message is not deleted from Message Store
Returns:
Zero on success or non-zero error code
This is called after submitting a message object or to abandon submission. Also called when a message which has been read has been finished with. By default, for a P7 connection, the message is deleted from the message store at the same time. However, if the retain flag is set, then the message is not deleted from the Store. This flag has no effect for a P3 connection.
Examples:
examples/x400_msrcv.c, examples/x400_msrcv_sign.c, examples/x400_mssend.c, examples/x400_mssend_sign.c, and x400_msasync.c.

int X400msMsgAddStrParam ( struct X400msMessage *  mp,
int  paramtype,
const char *  value,
size_t  length 
)

Add string-valued parameter to the message.

Parameters:
mp [in] Message pointer
paramtype [in] Type of parameter
value [in] Value of parameter
length [in] Length of parameter, -1 if NUL terminated
Returns:
Zero on success or non-zero error code
Examples:
examples/x400_mssend.c, examples/x400_mssend_sign.c, and x400_msasync.c.

int X400msMsgAddIntParam ( struct X400msMessage *  mp,
int  paramtype,
int  value 
)

Add integer-valued parameter to the message.

Parameters:
mp [in] Message pointer
paramtype [in] Type of parameter
value [in] Value of parameter
Returns:
Zero on success or non-zero error code
Examples:
examples/x400_mssend.c, and examples/x400_mssend_sign.c.

int X400msMsgAddAttachment ( struct X400msMessage *  mp,
int  type,
const char *  string,
size_t  length 
)

Add attachment to the message.

Parameters:
mp [in] Message pointer
type [in] Type of attachment
string [in] String value for attachment
length [in] Length of string
Returns:
Zero on success or non-zero error code
Examples:
examples/x400_mssend.c, and examples/x400_mssend_sign.c.

int X400msMsgAddBodypart ( struct X400msMessage *  mp,
struct X400Bodypart *  bp 
)

Add a body part object to a message.

Parameters:
mp [in] Message pointer
bp [in] Bodypart pointer
Returns:
Zero on success or non-zero error code

int X400msMsgAddMessageBodyWType ( struct X400msMessage *  mp,
struct X400Message *  mbp,
int  type 
)

Add a message body part object to a message.

Parameters:
mp [in] Message pointer
mbp [in] Message body part pointer
type [in] BodyPart type (E.G X400_T_MESSAGE)
Returns:
Zero on success or non-zero error code
The message body part must be a message delivery object for forwarded-message body part.

If the message object being created has an IPN content, then any envelope information is ignored.

int X400msMsgAddMessageBody ( struct X400msMessage *  mp,
struct X400Message *  mbp 
)

Deprecated:
Use X400msMsgAddMessageBodyWType instead.
Examples:
examples/x400_mssend.c.

int X400msRecipNew ( struct X400msMessage *  mp,
int  type,
struct X400Recipient **  rpp 
)

Add new recipient to a message.

Parameters:
mp [in] Message pointer
type [in] type of recipient
rpp [out] Pointer to place for pointer to recipient information
Returns:
Zero on success or non-zero error code
Creates a recipient object associated with the message. There are several different types for recipient object. Normal recipients can be specified separately for the envelope (i.e. controlling where the message actually goes) and the header which is part of the content. They ca