Summary: Isode provides a number of APIs which allow integrators and product developers to build components that access the Isode Messaging server products or other products supporting the same protocols.
x400_mtapi.h
Go to the documentation of this file.
1 /* Copyright (c) 2003-2017, Isode Limited, London, England.
2  * All rights reserved.
3  *
4  * Acquisition and use of this software and related materials for any
5  * purpose requires a written licence agreement from Isode Limited,
6  * or a written licence from an organisation licenced by Isode Limited
7  * to grant such a licence.
8  *
9  */
10 
11 /*
12  *
13  * @VERSION@
14  */
15 
16 #ifndef _X400_MTAPI_H
17 #define _X400_MTAPI_H
18 
19 #include "cdecl.h"
20 #include "x400_api.h"
21 
22 
23 
182 X400MT_CDECL const char *X400mtError (int error);
183 
184 struct X400mtSession;
185 
196 X400MT_CDECL int X400mtOpen (const char *credentials,
197  struct X400mtSession **spp);
198 
199 
200 
209 X400MT_CDECL int X400mtClose (struct X400mtSession *sp);
210 
224 X400MT_CDECL int X400mtSetIntDefault(struct X400mtSession *sp,
225  int paramtype,
226  int value);
227 
242 X400MT_CDECL int X400mtSetStrDefault(struct X400mtSession *sp,
243  int paramtype,
244  const char *value,
245  size_t length);
246 
247 struct X400mtMessage;
248 
262 X400MT_CDECL int X400mtMsgNew (struct X400mtSession *sp,
263  int type,
264  struct X400mtMessage **mpp);
265 
274 X400MT_CDECL int X400mtMsgCountRecip(struct X400mtMessage *mp, int type, int *cp);
275 
282 X400MT_CDECL int X400mtMsgSend (struct X400mtMessage *mp);
283 
293 X400MT_CDECL int X400mtMsgDelete (struct X400mtMessage *mp);
294 
304 X400MT_CDECL int X400mtMsgAddStrParam (struct X400mtMessage *mp,
305  int paramtype,
306  const char *value,
307  size_t length);
308 
317 X400MT_CDECL int X400mtMsgAddIntParam (struct X400mtMessage *mp,
318  int paramtype,
319  int value);
320 
321 
331 X400MT_CDECL int X400mtMsgAddAttachment (struct X400mtMessage *mp,
332  int type,
333  const char *string,
334  size_t length);
335 
336 
343 X400MT_CDECL int X400mtMsgAddBodypart (struct X400mtMessage *mp,
344  struct X400Bodypart *bp);
345 
349 X400MT_CDECL int X400mtMsgAddMessageBody (struct X400mtMessage *mp,
350  struct X400Message *mbp);
351 
365 X400MT_CDECL int X400mtMsgAddMessageBodyWType (struct X400mtMessage *mp,
366  struct X400Message *mbp,
367  int type);
368 
369 struct X400Recipient;
370 
401 X400MT_CDECL int X400mtRecipNew (struct X400mtMessage *mp,
402  int type,
403  struct X400Recipient **rpp);
404 
405 
415 X400MT_CDECL int X400mtRecipAddStrParam (struct X400Recipient *rp,
416  int paramtype,
417  const char *value,
418  size_t length);
419 
428 X400MT_CDECL int X400mtRecipAddIntParam (struct X400Recipient *rp,
429  int paramtype,
430  int value);
431 
432 
444 X400MT_CDECL int X400mtWait (struct X400mtSession *sp,
445  int seconds,
446  int *count);
447 
457 X400MT_CDECL int X400mtMsgGet (struct X400mtSession *sp,
458  struct X400mtMessage **mpp,
459  int *typep);
460 
475 X400MT_CDECL int X400mtMsgGetStart (struct X400mtSession *sp,
476  struct X400mtMessage **mpp,
477  int *typep);
478 
502 X400MT_CDECL int X400mtMsgGetFinish (struct X400mtMessage *mp,
503  int status,
504  int reason,
505  int diag,
506  const char *info);
507 
518 X400MT_CDECL int X400mtMsgGetStrParam (struct X400mtMessage *mp,
519  int paramtype,
520  char *buffer,
521  size_t buflen,
522  size_t *paramlenp);
523 
532 X400MT_CDECL int X400mtMsgGetIntParam (struct X400mtMessage *mp,
533  int paramtype,
534  int *valp);
535 
550 X400MT_CDECL int X400mtMsgGetAttachment (struct X400mtMessage *mp,
551  int number,
552  int *typep,
553  char *buffer,
554  size_t buflen,
555  size_t *lengthp);
556 
557 
566 X400MT_CDECL int X400mtMsgGetBodypart (struct X400mtMessage *mp,
567  int number,
568  int *typep,
569  struct X400Bodypart **bpp);
570 
571 
580 X400MT_CDECL int X400mtMsgGetMessageBody (struct X400mtMessage *mp,
581  int number,
582  struct X400Message **mpp);
583 
595 X400MT_CDECL int X400mtRecipGet (struct X400mtMessage *mp,
596  int type,
597  int number,
598  struct X400Recipient **rpp);
599 
600 
611 X400MT_CDECL int X400mtRecipGetStrParam (struct X400Recipient *rp,
612  int paramtype,
613  char *buffer,
614  size_t buflen,
615  size_t *paramlenp);
616 
625 X400MT_CDECL int X400mtRecipGetIntParam (struct X400Recipient *rp,
626  int paramtype,
627  int *valp);
628 
636 X400MT_CDECL int X400mtDLExpHistGet (struct X400mtMessage *mp,
637  int entry,
638  struct X400DLExpHist **hist);
639 
640 
641 struct X400DLExpHist;
642 
650 X400MT_CDECL int X400mtDLExpHistNew (
651  struct X400mtMessage *mp,
652  struct X400DLExpHist **histp
653 );
654 
655 
663 X400MT_CDECL struct X400DLExpHist *X400mtDLExpHistDeepCopy (struct X400mtMessage *mp,
664  struct X400DLExpHist *orig);
665 
674 X400MT_CDECL int X400mtTraceInfoGet (
675  struct X400mtMessage *mp,
676  int entry,
677  struct X400TraceInfo **info,
678  int type
679 );
680 struct X400TraceInfo;
681 
682 
690 X400MT_CDECL int X400mtTraceInfoNew(
691  struct X400mtMessage *mp,
692  struct X400TraceInfo **info,
693  int type
694 );
695 
704 X400MT_CDECL struct X400TraceInfo *X400mtTraceInfoDeepCopy (struct X400mtMessage *mp,
705  struct X400TraceInfo *orig,
706  int type);
707 
715 X400MT_CDECL int X400mtInternalTraceInfoGet (
716  struct X400mtMessage *mp,
717  int entry,
718  struct X400InternalTraceInfo **info
719 );
720 struct X400InternalTraceInfo;
721 
722 
729 X400MT_CDECL int X400mtInternalTraceInfoNew(
730  struct X400mtMessage *mp,
731  struct X400InternalTraceInfo **info
732 );
733 
741 X400MT_CDECL struct X400InternalTraceInfo *X400mtInternalTraceInfoDeepCopy (struct X400mtMessage *mp,
742  struct X400InternalTraceInfo *orig);
743 
744 struct X400ALI;
745 
746 
753 X400MT_CDECL int X400mtALINew(
754  struct X400mtMessage *mp,
755  struct X400ALI **ali
756 );
757 
765 X400MT_CDECL struct X400ALI *X400mtALIDeepCopy (struct X400mtMessage *mp,
766  struct X400ALI *orig);
767 
775 X400MT_CDECL int X400mtALIGet (
776  struct X400mtMessage *mp,
777  int entry,
778  struct X400ALI **ali
779 );
780 
781 
782 struct X400PSS;
783 
784 
792 X400MT_CDECL int X400mtPSSNew(
793  struct X400mtMessage *mp,
794  int type,
795  struct X400PSS **pss
796 );
797 
806 X400MT_CDECL struct X400PSS *X400mtPSSDeepCopy (struct X400mtMessage *mp,
807  struct X400PSS *orig,
808  int type);
809 
810 
819 X400MT_CDECL int X400mtPSSGet (
820  struct X400mtMessage *mp,
821  int type,
822  int entry,
823  struct X400PSS **pss
824 );
825 
826 struct X400DistField;
827 
828 
835 X400MT_CDECL int X400mtDistFieldNew(
836  struct X400mtMessage *mp,
837  struct X400DistField **distfield
838 );
839 
847 X400MT_CDECL struct X400DistField *X400mtDistFieldDeepCopy (struct X400mtMessage *mp,
848  struct X400DistField *orig);
849 
857 X400MT_CDECL int X400mtDistFieldGet (
858  struct X400mtMessage *mp,
859  int entry,
860  struct X400DistField **distfield
861 );
862 
863 
864 struct X400OtherRecip;
865 
866 
873 X400MT_CDECL int X400mtOtherRecipNew(
874  struct X400mtMessage *mp,
875  struct X400OtherRecip **otherrecip
876 );
877 
885 X400MT_CDECL struct X400OtherRecip *X400mtOtherRecipDeepCopy (struct X400mtMessage *mp,
886  struct X400OtherRecip *orig);
887 
895 X400MT_CDECL int X400mtOtherRecipGet (
896  struct X400mtMessage *mp,
897  int entry,
898  struct X400OtherRecip **otherrecip
899 );
900 
901 
902 
910 X400MT_CDECL int X400mtRediHistGetEnv(struct X400mtMessage *msg,
911  int entry,
912  struct X400RediHist **hist);
913 
920 X400MT_CDECL int X400mtRediHistNewEnv(
921  struct X400mtMessage *msg,
922  struct X400RediHist **hist
923 );
924 
932 X400MT_CDECL struct X400RediHist *X400mtRediHistDeepCopyEnv(struct X400mtMessage *mp,
933  struct X400RediHist *orig);
934 
941 X400MT_CDECL int X400mtORandDLNew(
942  struct X400mtMessage *msg,
943  struct X400ORandDL **or_and_dl
944 );
945 
953 X400MT_CDECL struct X400ORandDL *X400mtORandDLDeepCopy (struct X400mtMessage *mp,
954  struct X400ORandDL *orig);
955 
963 X400MT_CDECL int X400mtORandDLGet(struct X400mtMessage *msg,
964  int entry,
965  struct X400ORandDL **or_and_dl);
966 
967 struct X400ORandDL;
970 /* Here we add the API versioning into the API, so that it is hidden
971  * from the client
972  */
974 #define X400mtOpen(p1, p2) X400mtOpenVer(p1, p2, X400_API_VERSN)
975 
983 X400MT_CDECL int X400mtOpenVer (const char *credentials,
984  struct X400mtSession **spp, int version);
985 
986 
1003 X400MT_CDECL int X400mtMarkToFault(struct X400mtSession *sp, int attType, int fault);
1004 
1005 
1006 
1018 X400MT_CDECL int X400mtGetContentOctets(struct X400mtMessage *mp,
1019  char *buf,
1020  size_t buflen,
1021  size_t *lenp);
1022 
1023 
1034 X400MT_CDECL int X400mtSetContentOctets(struct X400mtMessage *mp,
1035  char *buf, size_t len);
1036 
1037 
1048 X400MT_CDECL int X400ReadArchive(char *filepath, struct X400Message **mpp);
1049 
1050 
1057 X400MT_CDECL int X400mtACP127RespGet (struct X400mtMessage *mp, struct X400ACP127Resp **respp);
1058 
1065 X400MT_CDECL int X400mtACP127RespNew(struct X400mtMessage *mp, struct X400ACP127Resp **respp);
1066 
1073 X400MT_CDECL struct X400ACP127Resp *X400mtACP127RespDeepCopy(struct X400mtMessage *mp,
1074  struct X400ACP127Resp *orig);
1075 
1076 #endif /* _X400_MTAPI_H */
struct X400ORandDL * X400mtORandDLDeepCopy(struct X400mtMessage *mp, struct X400ORandDL *orig)
Copy an Originator and DL Expansion History object, and associate it with the a message.
int X400mtMsgCountRecip(struct X400mtMessage *mp, int type, int *cp)
Returns count of addresses of given type in message object.
int X400mtMsgAddMessageBody(struct X400mtMessage *mp, struct X400Message *mbp)
int X400mtACP127RespGet(struct X400mtMessage *mp, struct X400ACP127Resp **respp)
Get the ACP127 Notification Response object from a message.
int X400mtDLExpHistNew(struct X400mtMessage *mp, struct X400DLExpHist **histp)
Create a new DL Expansion History object, and associate it with the existing message.
int X400mtMsgGet(struct X400mtSession *sp, struct X400mtMessage **mpp, int *typep)
Transfer message object out from MTA completely.
int X400mtOpenVer(const char *credentials, struct X400mtSession **spp, int version)
Open X400 MT session.
int X400mtSetIntDefault(struct X400mtSession *sp, int paramtype, int value)
Set a default integer parameter value in a session.
struct X400ALI * X400mtALIDeepCopy(struct X400mtMessage *mp, struct X400ALI *orig)
Copy an AddressListIndicator object, and associate it with the a message.
struct X400TraceInfo * X400mtTraceInfoDeepCopy(struct X400mtMessage *mp, struct X400TraceInfo *orig, int type)
Copy a TraceInformation object, and associate it with the a message.
int X400mtOtherRecipNew(struct X400mtMessage *mp, struct X400OtherRecip **otherrecip)
Create a new P772 Other Recipient object for a message object.
int X400mtGetContentOctets(struct X400mtMessage *mp, char *buf, size_t buflen, size_t *lenp)
Obtains the bytes containing the ASN.1 encoding of the Content of a message. The Content is obtained ...
int X400mtOtherRecipGet(struct X400mtMessage *mp, int entry, struct X400OtherRecip **otherrecip)
Get a new P772 Other Recipient object for a message object.
int X400mtMsgGetAttachment(struct X400mtMessage *mp, int number, int *typep, char *buffer, size_t buflen, size_t *lengthp)
Return the data of an attachment (=bodypart) from the message object.
int X400mtMsgGetBodypart(struct X400mtMessage *mp, int number, int *typep, struct X400Bodypart **bpp)
Return a pointer to a body part object.
int X400mtMsgNew(struct X400mtSession *sp, int type, struct X400mtMessage **mpp)
Creates new message.
int X400mtSetContentOctets(struct X400mtMessage *mp, char *buf, size_t len)
Takes a byte stream containing the ASN.1 encoding of a P22 (or P772) content, decodes it and sets it ...
struct X400InternalTraceInfo * X400mtInternalTraceInfoDeepCopy(struct X400mtMessage *mp, struct X400InternalTraceInfo *orig)
Copy an InternalTraceInformation object, and associate it with the a message.
int X400mtRecipGetIntParam(struct X400Recipient *rp, int paramtype, int *valp)
Return a integer-valued parameter from the recipient object.
int X400mtMsgGetStart(struct X400mtSession *sp, struct X400mtMessage **mpp, int *typep)
Get message object for transfer out from MTA.
int X400mtMsgGetFinish(struct X400mtMessage *mp, int status, int reason, int diag, const char *info)
Finish transfer-out of message from MTA, generate DR if required.
int X400mtWait(struct X400mtSession *sp, int seconds, int *count)
Wait for messages to be transferred out.
struct X400RediHist * X400mtRediHistDeepCopyEnv(struct X400mtMessage *mp, struct X400RediHist *orig)
Copy a Redirection History object, and associate it with the a message.
#define X400mtOpen(p1, p2)
Definition: x400_mtapi.h:974
int X400mtMsgGetIntParam(struct X400mtMessage *mp, int paramtype, int *valp)
Return a integer-valued parameter from the message object.
int X400mtMsgGetStrParam(struct X400mtMessage *mp, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
Return a string-valued parameter from the message object.
struct X400PSS * X400mtPSSDeepCopy(struct X400mtMessage *mp, struct X400PSS *orig, int type)
Copy a PrintableStringSequence object, and associate it with the a message.
int X400mtPSSGet(struct X400mtMessage *mp, int type, int entry, struct X400PSS **pss)
Get a new Printable String Syntax object for a message object.
int X400mtRecipNew(struct X400mtMessage *mp, int type, struct X400Recipient **rpp)
Add new recipient to a message.
int X400mtSetStrDefault(struct X400mtSession *sp, int paramtype, const char *value, size_t length)
Set a default string parameter value in a session.
int X400mtMsgGetMessageBody(struct X400mtMessage *mp, int number, struct X400Message **mpp)
Return a pointer to a body part object.
struct X400DistField * X400mtDistFieldDeepCopy(struct X400mtMessage *mp, struct X400DistField *orig)
Copy a P772 DistributionField object, and associate it with the a message.
int X400mtRediHistNewEnv(struct X400mtMessage *msg, struct X400RediHist **hist)
Create a new Redirection History object for a message envelope this is represented by 8...
int X400mtMsgAddIntParam(struct X400mtMessage *mp, int paramtype, int value)
Add integer-valued parameter to the message.
int X400mtRecipAddStrParam(struct X400Recipient *rp, int paramtype, const char *value, size_t length)
Add string-valued parameter to the message.
int X400mtRecipAddIntParam(struct X400Recipient *rp, int paramtype, int value)
Add integer-valued parameter to the message.
int X400mtMsgAddAttachment(struct X400mtMessage *mp, int type, const char *string, size_t length)
Add an attachment to the message.
int X400mtDistFieldGet(struct X400mtMessage *mp, int entry, struct X400DistField **distfield)
Get a new P772 Distribution Field object for a message object.
int X400ReadArchive(char *filepath, struct X400Message **mpp)
Takes the path to a file containing the archived envelope of an X.400 message (i.e. .xar file) and returns an X.400 Message object containing the contents of the envelope an accompanying content if necessary.
const char * X400mtError(int error)
Return string for error code.
int X400mtMsgSend(struct X400mtMessage *mp)
Send message object to MTA.
int X400mtTraceInfoGet(struct X400mtMessage *mp, int entry, struct X400TraceInfo **info, int type)
Get a Trace Info object for a message object.
int X400mtALIGet(struct X400mtMessage *mp, int entry, struct X400ALI **ali)
Get a new Address List Indicator object for a message object.
int X400mtInternalTraceInfoGet(struct X400mtMessage *mp, int entry, struct X400InternalTraceInfo **info)
Get an Internal Trace Info object for a message object.
int X400mtRediHistGetEnv(struct X400mtMessage *msg, int entry, struct X400RediHist **hist)
Get the Redirection History object from a message envelope this is represented by 8...
int X400mtPSSNew(struct X400mtMessage *mp, int type, struct X400PSS **pss)
Create a new Printable String Syntax object for a message object.
int X400mtMarkToFault(struct X400mtSession *sp, int attType, int fault)
Control how extension attributes in Envelopes and Envelope Recipient addresses are handled...
int X400mtORandDLNew(struct X400mtMessage *msg, struct X400ORandDL **or_and_dl)
Create new Originator and DL expansion history object.
int X400mtDistFieldNew(struct X400mtMessage *mp, struct X400DistField **distfield)
Create a new P772 Distribution Field object for a message object.
struct X400ACP127Resp * X400mtACP127RespDeepCopy(struct X400mtMessage *mp, struct X400ACP127Resp *orig)
Copy an ACP127 Notification Response object.
int X400mtMsgAddStrParam(struct X400mtMessage *mp, int paramtype, const char *value, size_t length)
Add string-valued parameter to the message.
struct X400DLExpHist * X400mtDLExpHistDeepCopy(struct X400mtMessage *mp, struct X400DLExpHist *orig)
Copy a new DL Expansion History object, and associate it with the a message.
int X400mtClose(struct X400mtSession *sp)
Close a X400 Session.
X400 Object Interface.
struct X400OtherRecip * X400mtOtherRecipDeepCopy(struct X400mtMessage *mp, struct X400OtherRecip *orig)
Copy a P772 Other Recipient object, and associate it with the a message.
int X400mtTraceInfoNew(struct X400mtMessage *mp, struct X400TraceInfo **info, int type)
Create a new Trace Info object for a message object.
int X400mtMsgAddBodypart(struct X400mtMessage *mp, struct X400Bodypart *bp)
Add a body part object to a message.
int X400mtORandDLGet(struct X400mtMessage *msg, int entry, struct X400ORandDL **or_and_dl)
Get Originator and DL expansion history object.
int X400mtRecipGetStrParam(struct X400Recipient *rp, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
Return a string-valued parameter from the recipient object.
int X400mtRecipGet(struct X400mtMessage *mp, int type, int number, struct X400Recipient **rpp)
Get recipient object from message.
int X400mtMsgAddMessageBodyWType(struct X400mtMessage *mp, struct X400Message *mbp, int type)
Add a message body part object to a message.
int X400mtALINew(struct X400mtMessage *mp, struct X400ALI **ali)
Create a new Address List Indicator object for a message object.
int X400mtInternalTraceInfoNew(struct X400mtMessage *mp, struct X400InternalTraceInfo **info)
Create a new Internal Trace Info object for a message object.
int X400mtDLExpHistGet(struct X400mtMessage *mp, int entry, struct X400DLExpHist **hist)
Create a new DL Expansion History object from the message object.
int X400mtMsgDelete(struct X400mtMessage *mp)
Delete message object.
int X400mtACP127RespNew(struct X400mtMessage *mp, struct X400ACP127Resp **respp)
Create an ACP127 Notification Response object.