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_ms_common.c
1 /* Copyright (c) 2014, 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  * Set of MS functions to get and display attribute from MS messages
16  */
17 
18 #include <stdio.h>
19 #include <x400_msapi.h>
20 #include <amhs_att.h>
21 #include <seclabel_api.h> /* For security labels */
22 #include "example.h"
23 
24 #include "ms_example.h"
25 
26 static int get_bp(
27  struct X400msMessage *mp,
28  struct X400Bodypart **bp,
29  int att_num
30 );
31 
32 static int get_msgbp(
33  struct X400msMessage *mp,
34  struct X400Message **x400_mp,
35  int att_num
36 );
37 
38 static int do_xmsg_content_as_bp(
39  struct X400Message *x400_mp
40 );
41 
42 static int do_xrep_content_as_bp(
43  struct X400Message *x400_mp
44 );
45 
46 static int do_xrep_headers(
47  struct X400Message *x400_mp
48 );
49 
50 static int do_xmsg_headers(
51  struct X400Message *x400_mp
52 );
53 
54 static int do_redirection_hist (
55  struct X400Recipient *rp
56 );
57 
58 
59 int get_recips(
60  struct X400Message *x400_mp,
61  int type
62 )
63 {
64 
65  struct X400Recipient *rp;
66  int status;
67  int recip_num;
68 
69  for (recip_num = 1; ; recip_num++ ) {
70 
71  char buf[INIT_BUFFER_SIZE];
72  int buflen = sizeof buf;
73  size_t ret_len;
74 
75  status = X400MsgGetRecip(x400_mp, type, recip_num, &rp);
76  if (status == X400_E_NO_RECIP) {
77  if (recip_num == 1) {
78  printf("no recips of type %x\n", type);
79  return X400_E_NOERROR;
80  } else {
81  printf("no more recips of type %x\n", type);
82  }
83  return X400_E_NOERROR;
84  }
85  else if (status != X400_E_NOERROR) {
86  fprintf(stderr, "X400MsgGetRecip (%d) failed %s\n",
87  X400_S_OBJECTTYPE, X400msError (status));
88  return status;
89  }
90  printf("got recip number %d of type %s (%x)\n", recip_num,
91  type == X400_RECIP_PRIMARY ? "Primary" :
92  type == X400_RECIP_CC ? "CC" :
93  type == X400_RECIP_BCC ? "BCC" :
94  type == X400_ORIGINATOR ? "Originator" :
95  type == X400_AUTH_ORIG ? "Auth Orig" :
96  type == X400_RECIP_REPLY ? "Reply" :
97  type == X400_RECIP_REPORT ? "Reported Recip" :
98  type == X400_RECIP_INTENDED ? "Intended" :
99  type == X400_RECIP_ENVELOPE ? "Envelope" :
100  "Unknown",
101  type);
102  if (type == X400_RECIP_ENVELOPE) {
103  // These aren't expected as the message will be forwarded
104  // message with no envelope
105  status = X400RecipGetStrParam(rp, X400_S_OR_ADDRESS, buf, buflen,
106  &ret_len);
107  if (status != X400_E_NOERROR) {
108  fprintf(stderr, "X400MsgGetStrParam (%d) failed %s\n",
109  X400_S_OBJECTTYPE, X400msError (status));
110  } else {
111  printf("Originator OR Address'%.*s'\n", (int)ret_len, buf);
112  }
113  } else {
114  status = X400RecipGetStrParam(rp, X400_S_OR_ADDRESS, buf, buflen,
115  &ret_len);
116  if (status != X400_E_NOERROR) {
117  fprintf(stderr, "X400MsgGetStrParam (%d) failed %s\n",
118  X400_S_OBJECTTYPE, X400msError (status));
119  } else {
120  printf("Originator OR Address'%.*s'\n", (int)ret_len, buf);
121  }
122 
123  }
124 
125 #define USE_REDIRECTION_HISTORY 1
126 #ifdef USE_REDIRECTION_HISTORY
127  {
128  status = do_redirection_hist(rp);
129  if ( status == X400_E_NO_VALUE ) {
130  /* do nothing */
131  } else if (status == X400_E_MISSING_ATTR ) {
132  printf("There is no Redirection History\n");
133  } else if (status == X400_E_NOERROR ) {
134  printf("Found some Redirection History\n");
135  } else {
136  printf("error getting Redirection History\n");
137  fprintf (stderr, "Error fetching Redirection History: %s\n",
138  X400msError (status));
139  return status;
140  }
141  }
142 #endif
143  }
144 
145 }
146 
147 int get_body_parts(
148  struct X400msMessage *mp
149 )
150 {
151 #define INIT_BUFFER_SIZE 10000
152 #define INIT_BUFFER2_SIZE 256
153  int status;
154  int num_atts = 0;
155  int type;
156  char *buf;
157  size_t buflen;
158  char buf2[INIT_BUFFER2_SIZE];
159  int buf2len = sizeof buf2;
160  size_t ret_len;
161  int i;
162  size_t j;
163  struct X400Message *x400_mp;
164  struct X400Bodypart *bp;
165 
166 
167  printf ("Getting Body Parts\n");
168 
169  status = X400msMsgGetIntParam (mp, X400_N_NUM_ATTACHMENTS, &num_atts);
170  if ( status != X400_E_NOERROR ) {
171  fprintf (stderr, "Error in X400msMsgGetIntParam attachments %s\n",
172  X400msError (status));
173  return status;
174  }
175  printf ("Number of attachments is %d\n", num_atts);
176 
177  buf = (char *) malloc(INIT_BUFFER_SIZE);
178  if (buf == NULL) {
179  fprintf(stderr, "can't alloc %d bytes\n", INIT_BUFFER_SIZE);
180  return X400_E_NOMEMORY;
181  }
182  buflen = INIT_BUFFER_SIZE;
183 
184  for (i = 0; i <= num_atts ; i++) {
185  printf ("\n----- Get attachment ----- %d\n", i);
186  status = X400msMsgGetAttachment(mp, i, &type, buf, buflen, &ret_len);
187  if (status == X400_E_NOSPACE) {
188  char *newbuf;
189  fprintf(stderr, "realloc %ld bytes\n", (long)ret_len);
190  newbuf = (char *) realloc(buf, ret_len + 1);
191  if (newbuf == NULL) {
192  fprintf(stderr, "can't alloc %d bytes\n", INIT_BUFFER_SIZE);
193  free (buf);
194  return X400_E_NOMEMORY;
195  }
196  buf = newbuf;
197  buflen = ret_len;
198  status = X400msMsgGetAttachment(
199  mp, i, &type, buf, buflen, &ret_len);
200  /* fall through with status set */
201  }
202  /* for some attachments you must use the BodyPart functions */
203  if (status == X400_E_COMPLEX_BODY) {
204  printf("got complex bodypart\n");
205  status = get_bp(mp, &bp, i);
206  if (status != X400_E_NOERROR ) {
207  free (buf);
208  return status;
209  }
210  }
211  /* for forwarded messages you must use the BodyPart functions */
212  else if (status == X400_E_MESSAGE_BODY) {
213  printf("got forwarded message bodypart\n");
214  status = get_msgbp(mp, &x400_mp, i);
215  if (status != X400_E_NOERROR ) {
216  free (buf);
217  return status;
218  }
219  }
220  else if (status == X400_E_NOERROR) {
221  /* process text or binary attachment */
222  printf("got FTBP, text or binary attachment\n");
223  switch (type) {
224  case X400_T_FTBP:
225 
226  /* Could retrieve these here: */
227  /* Content Description */
228  /* Filename */
229  /* Creation Date Description */
230  /* Modification Date */
231 
232  // Fall Thru
233  case X400_T_BINARY:
234  printf("First 1000 bytes of Binary Data for %s BP is:",
235  type == X400_T_BINARY ? "Binary" : "FTBP");
236  for (j = 0; j < ret_len && j < 1000; j++)
237  printf("%x ", buf[j]);
238  printf("\n");
239  break;
240  case X400_T_IA5TEXT:
241  printf("IA5 BP is:\n%.*s", (int)ret_len, buf);
242  break;
243  default:
244  printf("Printable Data for BP is:\n%.*s", (int)ret_len, buf);
245  break;
246  }
247  }
248  else if (status == X400_E_MISSING_ATTR) {
249  printf("attachment %d not found\n", i);
250  }
251  else {
252  /* got an error */
253  fprintf (stderr, "Error in X400msMsgGetAttachment %s\n",
254  X400msError (status));
255  break;
256  }
257  }
258  free (buf);
259  return status;
260 }
261 
262 static int get_bp(
263  struct X400msMessage *mp,
264  struct X400Bodypart **bpp,
265  int att_num
266 )
267 {
268  int status;
269  int type;
270  int bp_type;
271  size_t j;
272  char *buf;
273  size_t buflen;
274  char buf2[INIT_BUFFER2_SIZE];
275  int buf2len = sizeof buf2;
276  size_t ret_len;
277 
278 #define INIT_BUFFER_SIZE 10000
279  printf ("Get Bodypart %d\n", att_num);
280 
281  /* firstly get the Bodypart */
282  status = X400msMsgGetBodypart(mp, att_num, &type, bpp);
283  if (status != X400_E_NOERROR) {
284  fprintf(stderr, "X400msMsgGetBodypart %d failed %s\n", att_num,
285  X400msError (status));
286  return status;
287  }
288  printf("got Bodypart %d, type = %d\n", att_num, type);
289 
290  /* What kind of Bodypart using a attribute of the BP */
291  status = X400BodypartGetIntParam(*bpp, X400_N_BODY_TYPE, &bp_type);
292  if (status != X400_E_NOERROR) {
293  fprintf(stderr, "X400msMsgGetBodypart failed %s\n",
294  X400msError (status));
295  return status;
296  }
297  printf("got Bodypart %d, type = %s\n", att_num,
298  bp_type == X400_T_IA5TEXT ? "IA5" :
299  bp_type == X400_T_ISO8859_1 ? "ISO8859-1" :
300  bp_type == X400_T_ISO8859_2 ? "ISO8859_2" :
301  bp_type == X400_T_BINARY ? "Binary" :
302  bp_type == X400_T_MESSAGE ? "Message" :
303  bp_type == X400_T_FTBP ? "File Transfer BP" :
304  bp_type == X400_T_GENERAL_TEXT ? "General Text" : "Unknown"
305  );
306 
307  /* setup buffer to use to return BP data */
308  buf = (char *) malloc(INIT_BUFFER_SIZE);
309  if (buf == NULL) {
310  fprintf(stderr, "can't alloc %d bytes\n", INIT_BUFFER_SIZE);
311  return X400_E_NOMEMORY;
312  }
313  buflen = INIT_BUFFER_SIZE;
314  /* Read data from the Bodypart */
315  status = X400BodypartGetStrParam(*bpp, X400_S_BODY_DATA, buf,
316  buflen, &ret_len);
317  if (status == X400_E_NOSPACE) {
318  char *newbuf;
319  fprintf(stderr, "realloc %ld bytes\n", (long)ret_len);
320  newbuf = (char *) realloc(buf, ret_len + 1);
321  if (newbuf == NULL) {
322  free (buf);
323  fprintf(stderr, "can't alloc %d bytes\n", INIT_BUFFER_SIZE);
324  return X400_E_NOMEMORY;
325  }
326  buf = newbuf;
327  buflen = ret_len;
328  status = X400BodypartGetStrParam(*bpp, X400_S_BODY_DATA, buf,
329  buflen, &ret_len);
330  /* fall through with status set */
331  }
332  if (status != X400_E_NOERROR) {
333  fprintf(stderr, "X400msMsgGetBodypart failed %s\n",
334  X400msError (status));
335  return status;
336  }
337  printf("got %ld bytes of Bodypart data\n", (long)ret_len);
338  switch (bp_type) {
339  case X400_T_FTBP:
340 
341  /* Content Description */
342  status = X400BodypartGetStrParam(*bpp,
343  X400_S_FTBP_CONTENT_DESCRIPTION, buf2, buf2len, &ret_len);
344  if (status != X400_E_NOERROR) {
345  fprintf(stderr, "X400BodypartGetStrParam (%d) failed %s\n",
347  } else {
348  printf("FTBP Content Description '%.*s'\n",
349  (int)ret_len, buf2);
350  }
351  /* Filename */
352  status = X400BodypartGetStrParam(*bpp,
353  X400_S_FTBP_FILENAME, buf2, buf2len, &ret_len);
354  if (status != X400_E_NOERROR) {
355  fprintf(stderr, "X400BodypartGetStrParam (%d) failed %s\n",
357  } else {
358  printf("FTBP Filename '%.*s'\n",
359  (int)ret_len, buf2);
360  }
361  /* Creation Date Description */
362  status = X400BodypartGetStrParam(*bpp,
363  X400_S_FTBP_CREATION_DATE, buf2, buf2len, &ret_len);
364  if (status != X400_E_NOERROR) {
365  fprintf(stderr, "X400BodypartGetStrParam (%d) failed %s\n",
367  } else {
368  printf("FTBP Content Description '%.*s'\n",
369  (int)ret_len, buf2);
370  }
371  /* Modification Date */
372  status = X400BodypartGetStrParam(*bpp,
373  X400_S_FTBP_MODIFICATION_DATE, buf2, buf2len, &ret_len);
374  if (status != X400_E_NOERROR) {
375  fprintf(stderr, "X400BodypartGetStrParam (%d) failed %s\n",
377  } else {
378  printf("FTBP Modification Date '%.*s'\n",
379  (int)ret_len, buf2);
380  }
381 
382  // Fall Thru
383  case X400_T_BINARY:
384  printf("First 1000 bytes of Binary Data for %s BP is:",
385  type == X400_T_BINARY ? "Binary" : "FTBP");
386  for (j = 0; j < ret_len && j < 1000; j++)
387  printf("%x ", buf[j]);
388  printf("\n");
389  break;
390  case X400_T_IA5TEXT:
391  printf("IA5 BP is:\n%s", buf);
392  break;
393  default:
394  printf("Printable Data for BP is:\n%.*s", (int)ret_len, buf);
395  break;
396  }
397 
398  return X400_E_NOERROR;
399 }
400 
401 /*
402  * Extract and return a Bodypart from an MS Message
403  */
404 static int get_msgbp(
405  struct X400msMessage *mp,
406  struct X400Message **x400_mpp,
407  int bp_num
408 )
409 {
410  struct X400Message *x400_mp;
411  int status;
412  char buf[INIT_BUFFER_SIZE];
413  int buflen = sizeof buf;
414  size_t ret_len;
415 
416  status = X400msMsgGetMessageBody(mp, bp_num, x400_mpp);
417  if (status != X400_E_NOERROR) {
418  fprintf(stderr, "X400MsgGetMessageBody (%d) failed %s\n",
419  bp_num, X400msError (status));
420  return status;
421  }
422  printf("Got Message BP from BP %d\n", bp_num);
423  x400_mp = *x400_mpp;
424 
425  status = X400MsgGetStrParam(x400_mp, X400_S_OBJECTTYPE, buf, buflen,
426  &ret_len);
427  if (status != X400_E_NOERROR) {
428  fprintf(stderr, "X400MsgGetStrParam (%d) failed %s\n",
429  X400_S_OBJECTTYPE, X400msError (status));
430  return status;
431  }
432  printf("Message BP from BP is '%.*s'\n", (int)ret_len, buf);
433  if (strncmp(buf, "message", ret_len) == 0 ) {
434  status = do_xmsg_headers(x400_mp);
435  if (status != X400_E_NOERROR)
436  return status;
437  status = do_xmsg_content_as_bp(x400_mp);
438  if (status != X400_E_NOERROR)
439  return status;
440  }
441  else if (strncmp(buf, "report", ret_len) == 0 ) {
442  status = do_xrep_headers(x400_mp);
443  if (status != X400_E_NOERROR)
444  return status;
445  status = do_xrep_content_as_bp(x400_mp);
446  if (status != X400_E_NOERROR)
447  return status;
448  }
449  else if (strncmp(buf, "probe", ret_len) == 0 ) {
450  status = do_xmsg_headers(x400_mp);
451  if (status != X400_E_NOERROR)
452  return status;
453  }
454  else {
455  fprintf(stderr, "got unknown object: %s\n", buf);
456  return X400_E_BADPARAM;
457  }
458 
459 
460  return X400_E_NOERROR;
461 }
462 
463 static int do_xmsg_content_as_bp(
464  struct X400Message *x400_mp
465 #ifdef __GNUC__
466  __attribute__((unused))
467 #endif
468 )
469 {
470  printf("do_xmsg_content_as_bp NYI\n");
471  return X400_E_NOERROR;
472 }
473 
474 
475 static int do_xrep_headers(
476  struct X400Message *x400_mp
477 #ifdef __GNUC__
478  __attribute__((unused))
479 #endif
480 )
481 {
482  printf("do_xrep_headers NYI\n");
483  return X400_E_NOERROR;
484 }
485 
486 
487 static int do_xrep_content_as_bp(
488  struct X400Message *x400_mp
489 #ifdef __GNUC__
490  __attribute__((unused))
491 #endif
492 )
493 {
494  printf("do_xrep_content_as_bp NYI\n");
495  return X400_E_NOERROR;
496 }
497 
498 static int do_xmsg_headers(
499  struct X400Message *x400_mp
500 )
501 {
502  int status;
503  char buf[INIT_BUFFER_SIZE];
504  int buflen = sizeof buf;
505  size_t ret_len;
506  int num_atts;
507 
508  printf("do_xmsg_headers\n");
509  status = X400MsgGetStrParam(x400_mp, X400_S_IPM_IDENTIFIER, buf, buflen,
510  &ret_len);
511  if (status != X400_E_NOERROR) {
512  fprintf(stderr, "X400MsgGetStrParam (%d) failed %s\n",
513  X400_S_OBJECTTYPE, X400msError (status));
514  return status;
515  }
516  printf("IPM Identifier from Message BP '%.*s'\n", (int)ret_len, buf);
517 
518  status = X400MsgGetStrParam(x400_mp, X400_S_SUBJECT, buf, buflen,
519  &ret_len);
520  if (status != X400_E_NOERROR) {
521  fprintf(stderr, "X400MsgGetStrParam (%d) failed %s\n",
522  X400_S_OBJECTTYPE, X400msError (status));
523  return status;
524  }
525  printf("Subject from Message BP '%.*s'\n", (int)ret_len, buf);
526 
527  status = X400MsgGetIntParam(x400_mp, X400_N_NUM_ATTACHMENTS, &num_atts);
528  if (status != X400_E_NOERROR) {
529  fprintf(stderr, "X400MsgGetStrParam (%d) failed %s\n",
530  X400_S_OBJECTTYPE, X400msError (status));
531  return status;
532  }
533  printf("Number of attachments in Message BP %d'\n", num_atts);
534 
535  status = get_recips(x400_mp, X400_ORIGINATOR);
536  if (status != X400_E_NOERROR) {
537  return status;
538  }
539 
540  status = get_recips(x400_mp, X400_RECIP_PRIMARY);
541  if (status != X400_E_NOERROR) {
542  return status;
543  }
544 
545  status = get_recips(x400_mp, X400_RECIP_ENVELOPE);
546  if (status != X400_E_NOERROR) {
547  return status;
548  }
549 
550  return X400_E_NOERROR;
551 }
552 
553 static int do_redirection_hist (
554  struct X400Recipient *rp
555 )
556 {
557  char redirection_time [BUFSIZ];
558  char or_address [BUFSIZ];
559  char dn [BUFSIZ];
560  int rr;
561 
562  size_t length;
563  int n;
564  int status;
565 
566  struct X400RediHist *hist = NULL;
567 
568  for ( n=1; ;n++ ) {
569 
570  status = X400RediHistGet (rp,n,&hist);
571  if (status != X400_E_NOERROR)
572  break;
573 
575  redirection_time, BUFSIZ,&length);
576 
577  if (status == X400_E_NO_VALUE) {
578  return X400_E_NO_VALUE;
579  }
580 
581  if ( status == X400_E_NOERROR ) {
582  redirection_time[length] = '\0';
583  printf ("Redirection time: %i %s\n",n,redirection_time);
584  } else {
585  fprintf (stderr, "Error in do_redirection_hist: %s\n",
586  X400msError (status));
587  }
588 
590  or_address, BUFSIZ , &length);
591  if ( status == X400_E_NOERROR ) {
592  or_address[length] = '\0';
593  printf ("Redirection OR address %i :%s\n",n,or_address);
594  } else {
595  fprintf (stderr, "Error in do_redirection_hist: %s\n",
596  X400msError (status));
597  }
598 
600  dn, BUFSIZ , &length);
601  if ( status == X400_E_NOERROR ) {
602  dn[length] = '\0';
603  printf ("Redirection DN %i :%s\n",n,dn);
604  } else {
605  fprintf (stderr, "Error in do_redirection_hist: %s\n",
606  X400msError (status));
607  }
608 
610  if ( status == X400_E_NOERROR ) {
611  printf ("DSI routing action %d :%s\n",n,X400RediReason(rr));
612  } else {
613  fprintf (stderr, "Error in do_redirection_hist: %s\n",
614  X400msError (status));
615  }
616 
617  }
618  if (n == 1) {
619  printf("No Redirection histories found in message\n");
620  } else {
621  printf("%d Redirection histories found in message\n", n - 1);
622  }
623  return X400_E_NOERROR;
624 
625 }
626 
627 /* Military priority utilities */
628 char * get_x400_pty_str_from_4406(int s4406_pty) {
629  switch (s4406_pty) {
630  case 0 : return "deferred";
631  case 1 : return "routine";
632  case 2 : return "priority";
633  case 3 : return "immediate";
634  case 4 : return "flash";
635  case 5 : return "override";
636  default: return "priority";
637  }
638 }
639 
640 
641 int get_x400_pty_qual_from_4406(int s4406_pty) {
642  switch (s4406_pty) {
643  case 0 :
644  case 2 :
645  case 4 :
646  return 0;
647  case 1 :
648  case 3 :
649  case 5 :
650  return 1;
651  default:
652  return 0;
653  }
654 
655 }
656 
657 
658 int get_x400_pty_from_4406(int s4406_pty) {
659  switch (s4406_pty) {
660  case 0 :
661  case 1 :
662  return 1;
663  case 2 :
664  case 3 :
665  return 0;
666  case 4 :
667  case 5 :
668  return 2;
669  default:
670  return 0;
671  }
672 
673 }
674 
#define X400_S_DIRECTORY_NAME
Definition: x400_att.h:394
int X400RediHistGet(struct X400Recipient *recip, int entry, struct X400RediHist **hist)
Get the Redirection History object from a recipient.
#define X400_T_GENERAL_TEXT
Definition: x400_att.h:837
int X400msMsgGetAttachment(struct X400msMessage *mp, int number, int *typep, char *buffer, size_t buflen, size_t *lengthp)
Return the data of an attachment (=bodypart) from the message object.
#define X400_S_FTBP_CONTENT_DESCRIPTION
Definition: x400_att.h:1188
int X400msMsgGetIntParam(struct X400msMessage *mp, int paramtype, int *valp)
Return a integer-valued parameter from the message object.
#define X400_AUTH_ORIG
Definition: x400_att.h:305
#define X400_RECIP_CC
Definition: x400_att.h:296
#define X400_S_BODY_DATA
Definition: x400_att.h:1158
int X400BodypartGetIntParam(struct X400Bodypart *bp, int paramtype, int *valp)
Return a integer-valued parameter from the body part object.
const char * X400msError(int error)
Obtain a string describing the meaning of the given error code.
int X400msMsgGetBodypart(struct X400msMessage *mp, int number, int *typep, struct X400Bodypart **bpp)
Return a pointer to a body part object.
#define X400_E_NO_RECIP
Definition: x400_att.h:109
#define X400_S_FTBP_FILENAME
Definition: x400_att.h:1191
#define X400_T_MESSAGE
Definition: x400_att.h:824
#define X400_T_ISO8859_1
Definition: x400_att.h:805
#define X400_E_NO_VALUE
Definition: x400_att.h:100
#define X400_S_FTBP_CREATION_DATE
Definition: x400_att.h:1194
#define X400_S_FTBP_MODIFICATION_DATE
Definition: x400_att.h:1197
#define X400_S_OBJECTTYPE
Definition: x400_att.h:467
#define X400_T_IA5TEXT
Definition: x400_att.h:795
#define X400_E_NOERROR
Definition: x400_att.h:46
#define X400_ORIGINATOR
Definition: x400_att.h:302
#define X400_N_NUM_ATTACHMENTS
Definition: x400_att.h:792
#define X400_S_REDIRECTION_TIME
Definition: x400_att.h:508
#define X400_S_OR_ADDRESS
Definition: x400_att.h:346
int X400MsgGetRecip(struct X400Message *mp, int recip_type, int number, struct X400Recipient **rpp)
Get recipient object from message.
int X400MsgGetIntParam(struct X400Message *mp, int paramtype, int *valuep)
Return a integer-valued parameter from the message object.
#define X400_T_ISO8859_2
Definition: x400_att.h:813
const char * X400RediReason(int redirection_reason)
Return a human readable string based on a redirection reason.
int X400msMsgGetMessageBody(struct X400msMessage *mp, int number, struct X400Message **mpp)
Return a pointer to a message part object.
#define X400_T_BINARY
Definition: x400_att.h:821
#define X400_E_BADPARAM
Definition: x400_att.h:55
#define X400_RECIP_PRIMARY
Definition: x400_att.h:293
int X400RediHistGetStrParam(struct X400RediHist *hist, int paramtype, char *value, size_t length, size_t *lengthp)
Get string-valued parameter from the X400RediHist object.
#define X400_N_BODY_TYPE
Definition: x400_att.h:1155
int X400MsgGetStrParam(struct X400Message *mp, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
Return a string-valued parameter from the message object.
#define X400_S_IPM_IDENTIFIER
Definition: x400_att.h:698
#define X400_RECIP_INTENDED
Definition: x400_att.h:314
X400 MA/MS (P3/P7) Interface.
#define X400_E_MISSING_ATTR
Definition: x400_att.h:88
#define X400_E_COMPLEX_BODY
Definition: x400_att.h:163
AMHS Symbolic Constants.
#define X400_E_NOMEMORY
Definition: x400_att.h:52
int X400BodypartGetStrParam(struct X400Bodypart *bp, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
Return a string-valued parameter from the body part object.
#define X400_RECIP_REPLY
Definition: x400_att.h:308
#define X400_S_SUBJECT
Definition: x400_att.h:719
#define X400_RECIP_ENVELOPE
Definition: x400_att.h:332
#define X400_E_MESSAGE_BODY
Definition: x400_att.h:166
#define X400_N_REDIRECTION_REASON
Definition: x400_att.h:505
#define X400_E_NOSPACE
Definition: x400_att.h:112
#define X400_T_FTBP
Definition: x400_att.h:830
int X400RediHistGetIntParam(struct X400RediHist *info, int paramtype, int *valuep)
Get int parameter from Redirection History object.
#define X400_RECIP_BCC
Definition: x400_att.h:299
#define X400_RECIP_REPORT
Definition: x400_att.h:311
int X400RecipGetStrParam(struct X400Recipient *rp, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
Return a string-valued parameter from the recipient object.