x400_ms_common.c
1 /* Copyright (c) 2014-2024, 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  size_t ret_len;
159  int i;
160  size_t j;
161  struct X400Message *x400_mp;
162  struct X400Bodypart *bp;
163 
164 
165  printf ("Getting Body Parts\n");
166 
167  status = X400msMsgGetIntParam (mp, X400_N_NUM_ATTACHMENTS, &num_atts);
168  if ( status != X400_E_NOERROR ) {
169  fprintf (stderr, "Error in X400msMsgGetIntParam attachments %s\n",
170  X400msError (status));
171  return status;
172  }
173  printf ("Number of attachments is %d\n", num_atts);
174 
175  buf = (char *) malloc(INIT_BUFFER_SIZE);
176  if (buf == NULL) {
177  fprintf(stderr, "can't alloc %d bytes\n", INIT_BUFFER_SIZE);
178  return X400_E_NOMEMORY;
179  }
180  buflen = INIT_BUFFER_SIZE;
181 
182  for (i = 0; i <= num_atts ; i++) {
183  printf ("\n----- Get attachment ----- %d\n", i);
184  status = X400msMsgGetAttachment(mp, i, &type, buf, buflen, &ret_len);
185  if (status == X400_E_NOSPACE) {
186  char *newbuf;
187  fprintf(stderr, "realloc %ld bytes\n", (long)ret_len);
188  newbuf = (char *) realloc(buf, ret_len + 1);
189  if (newbuf == NULL) {
190  fprintf(stderr, "can't alloc %d bytes\n", INIT_BUFFER_SIZE);
191  free (buf);
192  return X400_E_NOMEMORY;
193  }
194  buf = newbuf;
195  buflen = ret_len;
196  status = X400msMsgGetAttachment(
197  mp, i, &type, buf, buflen, &ret_len);
198  /* fall through with status set */
199  }
200  /* for some attachments you must use the BodyPart functions */
201  if (status == X400_E_COMPLEX_BODY) {
202  printf("got complex bodypart\n");
203  status = get_bp(mp, &bp, i);
204  if (status != X400_E_NOERROR ) {
205  free (buf);
206  return status;
207  }
208  }
209  /* for forwarded messages you must use the BodyPart functions */
210  else if (status == X400_E_MESSAGE_BODY) {
211  printf("got forwarded message bodypart\n");
212  status = get_msgbp(mp, &x400_mp, i);
213  if (status != X400_E_NOERROR ) {
214  free (buf);
215  return status;
216  }
217  }
218  else if (status == X400_E_NOERROR) {
219  /* process text or binary attachment */
220  printf("got FTBP, text or binary attachment\n");
221  switch (type) {
222  case X400_T_FTBP:
223 
224  /* Could retrieve these here: */
225  /* Content Description */
226  /* Filename */
227  /* Creation Date Description */
228  /* Modification Date */
229 
230  // Fall Thru
231  case X400_T_BINARY:
232  printf("First 1000 bytes of Binary Data for %s BP is:",
233  type == X400_T_BINARY ? "Binary" : "FTBP");
234  for (j = 0; j < ret_len && j < 1000; j++)
235  printf("%x ", buf[j]);
236  printf("\n");
237  break;
238  case X400_T_IA5TEXT:
239  printf("IA5 BP is:\n%.*s", (int)ret_len, buf);
240  break;
241  default:
242  printf("Printable Data for BP is:\n%.*s", (int)ret_len, buf);
243  break;
244  }
245  }
246  else if (status == X400_E_MISSING_ATTR) {
247  printf("attachment %d not found\n", i);
248  }
249  else {
250  /* got an error */
251  fprintf (stderr, "Error in X400msMsgGetAttachment %s\n",
252  X400msError (status));
253  break;
254  }
255  }
256  free (buf);
257  return status;
258 }
259 
260 static int get_bp(
261  struct X400msMessage *mp,
262  struct X400Bodypart **bpp,
263  int att_num
264 )
265 {
266  int status;
267  int type;
268  int bp_type;
269  size_t j;
270  char *buf;
271  size_t buflen;
272  char buf2[INIT_BUFFER2_SIZE];
273  int buf2len = sizeof buf2;
274  size_t ret_len;
275 
276 #define INIT_BUFFER_SIZE 10000
277  printf ("Get Bodypart %d\n", att_num);
278 
279  /* firstly get the Bodypart */
280  status = X400msMsgGetBodypart(mp, att_num, &type, bpp);
281  if (status != X400_E_NOERROR) {
282  fprintf(stderr, "X400msMsgGetBodypart %d failed %s\n", att_num,
283  X400msError (status));
284  return status;
285  }
286  printf("got Bodypart %d, type = %d\n", att_num, type);
287 
288  /* What kind of Bodypart using a attribute of the BP */
289  status = X400BodypartGetIntParam(*bpp, X400_N_BODY_TYPE, &bp_type);
290  if (status != X400_E_NOERROR) {
291  fprintf(stderr, "X400msMsgGetBodypart failed %s\n",
292  X400msError (status));
293  return status;
294  }
295  printf("got Bodypart %d, type = %s\n", att_num,
296  bp_type == X400_T_IA5TEXT ? "IA5" :
297  bp_type == X400_T_ISO8859_1 ? "ISO8859-1" :
298  bp_type == X400_T_ISO8859_2 ? "ISO8859_2" :
299  bp_type == X400_T_BINARY ? "Binary" :
300  bp_type == X400_T_MESSAGE ? "Message" :
301  bp_type == X400_T_FTBP ? "File Transfer BP" :
302  bp_type == X400_T_GENERAL_TEXT ? "General Text" : "Unknown"
303  );
304 
305  /* setup buffer to use to return BP data */
306  buf = (char *) malloc(INIT_BUFFER_SIZE);
307  if (buf == NULL) {
308  fprintf(stderr, "can't alloc %d bytes\n", INIT_BUFFER_SIZE);
309  return X400_E_NOMEMORY;
310  }
311  buflen = INIT_BUFFER_SIZE;
312  /* Read data from the Bodypart */
313  status = X400BodypartGetStrParam(*bpp, X400_S_BODY_DATA, buf,
314  buflen, &ret_len);
315  if (status == X400_E_NOSPACE) {
316  char *newbuf;
317  fprintf(stderr, "realloc %ld bytes\n", (long)ret_len);
318  newbuf = (char *) realloc(buf, ret_len + 1);
319  if (newbuf == NULL) {
320  free (buf);
321  fprintf(stderr, "can't alloc %d bytes\n", INIT_BUFFER_SIZE);
322  return X400_E_NOMEMORY;
323  }
324  buf = newbuf;
325  buflen = ret_len;
326  status = X400BodypartGetStrParam(*bpp, X400_S_BODY_DATA, buf,
327  buflen, &ret_len);
328  /* fall through with status set */
329  }
330  if (status != X400_E_NOERROR) {
331  fprintf(stderr, "X400msMsgGetBodypart failed %s\n",
332  X400msError (status));
333  return status;
334  }
335  printf("got %ld bytes of Bodypart data\n", (long)ret_len);
336  switch (bp_type) {
337  case X400_T_FTBP:
338 
339  /* Content Description */
340  status = X400BodypartGetStrParam(*bpp,
341  X400_S_FTBP_CONTENT_DESCRIPTION, buf2, buf2len, &ret_len);
342  if (status != X400_E_NOERROR) {
343  fprintf(stderr, "X400BodypartGetStrParam (%d) failed %s\n",
345  } else {
346  printf("FTBP Content Description '%.*s'\n",
347  (int)ret_len, buf2);
348  }
349  /* Filename */
350  status = X400BodypartGetStrParam(*bpp,
351  X400_S_FTBP_FILENAME, buf2, buf2len, &ret_len);
352  if (status != X400_E_NOERROR) {
353  fprintf(stderr, "X400BodypartGetStrParam (%d) failed %s\n",
355  } else {
356  printf("FTBP Filename '%.*s'\n",
357  (int)ret_len, buf2);
358  }
359  /* Creation Date Description */
360  status = X400BodypartGetStrParam(*bpp,
361  X400_S_FTBP_CREATION_DATE, buf2, buf2len, &ret_len);
362  if (status != X400_E_NOERROR) {
363  fprintf(stderr, "X400BodypartGetStrParam (%d) failed %s\n",
365  } else {
366  printf("FTBP Content Description '%.*s'\n",
367  (int)ret_len, buf2);
368  }
369  /* Modification Date */
370  status = X400BodypartGetStrParam(*bpp,
371  X400_S_FTBP_MODIFICATION_DATE, buf2, buf2len, &ret_len);
372  if (status != X400_E_NOERROR) {
373  fprintf(stderr, "X400BodypartGetStrParam (%d) failed %s\n",
375  } else {
376  printf("FTBP Modification Date '%.*s'\n",
377  (int)ret_len, buf2);
378  }
379 
380  // Fall Thru
381  case X400_T_BINARY:
382  printf("First 1000 bytes of Binary Data for %s BP is:",
383  type == X400_T_BINARY ? "Binary" : "FTBP");
384  for (j = 0; j < ret_len && j < 1000; j++)
385  printf("%x ", buf[j]);
386  printf("\n");
387  break;
388  case X400_T_IA5TEXT:
389  printf("IA5 BP is:\n%s", buf);
390  break;
391  default:
392  printf("Printable Data for BP is:\n%.*s", (int)ret_len, buf);
393  break;
394  }
395 
396  free (buf);
397  return X400_E_NOERROR;
398 }
399 
400 /*
401  * Extract and return a Bodypart from an MS Message
402  */
403 static int get_msgbp(
404  struct X400msMessage *mp,
405  struct X400Message **x400_mpp,
406  int bp_num
407 )
408 {
409  struct X400Message *x400_mp;
410  int status;
411  char buf[INIT_BUFFER_SIZE];
412  int buflen = sizeof buf;
413  size_t ret_len;
414 
415  status = X400msMsgGetMessageBody(mp, bp_num, x400_mpp);
416  if (status != X400_E_NOERROR) {
417  fprintf(stderr, "X400MsgGetMessageBody (%d) failed %s\n",
418  bp_num, X400msError (status));
419  return status;
420  }
421  printf("Got Message BP from BP %d\n", bp_num);
422  x400_mp = *x400_mpp;
423 
424  status = X400MsgGetStrParam(x400_mp, X400_S_OBJECTTYPE, buf, buflen,
425  &ret_len);
426  if (status != X400_E_NOERROR) {
427  fprintf(stderr, "X400MsgGetStrParam (%d) failed %s\n",
428  X400_S_OBJECTTYPE, X400msError (status));
429  return status;
430  }
431  printf("Message BP from BP is '%.*s'\n", (int)ret_len, buf);
432  if (strncmp(buf, "message", ret_len) == 0 ) {
433  status = do_xmsg_headers(x400_mp);
434  if (status != X400_E_NOERROR)
435  return status;
436  status = do_xmsg_content_as_bp(x400_mp);
437  if (status != X400_E_NOERROR)
438  return status;
439  }
440  else if (strncmp(buf, "report", ret_len) == 0 ) {
441  status = do_xrep_headers(x400_mp);
442  if (status != X400_E_NOERROR)
443  return status;
444  status = do_xrep_content_as_bp(x400_mp);
445  if (status != X400_E_NOERROR)
446  return status;
447  }
448  else if (strncmp(buf, "probe", ret_len) == 0 ) {
449  status = do_xmsg_headers(x400_mp);
450  if (status != X400_E_NOERROR)
451  return status;
452  }
453  else {
454  fprintf(stderr, "got unknown object: %s\n", buf);
455  return X400_E_BADPARAM;
456  }
457 
458 
459  return X400_E_NOERROR;
460 }
461 
462 static int do_xmsg_content_as_bp(
463  struct X400Message *x400_mp
464 #ifdef __GNUC__
465  __attribute__((unused))
466 #endif
467 )
468 {
469  printf("do_xmsg_content_as_bp NYI\n");
470  return X400_E_NOERROR;
471 }
472 
473 
474 static int do_xrep_headers(
475  struct X400Message *x400_mp
476 #ifdef __GNUC__
477  __attribute__((unused))
478 #endif
479 )
480 {
481  printf("do_xrep_headers NYI\n");
482  return X400_E_NOERROR;
483 }
484 
485 
486 static int do_xrep_content_as_bp(
487  struct X400Message *x400_mp
488 #ifdef __GNUC__
489  __attribute__((unused))
490 #endif
491 )
492 {
493  printf("do_xrep_content_as_bp NYI\n");
494  return X400_E_NOERROR;
495 }
496 
497 static int do_xmsg_headers(
498  struct X400Message *x400_mp
499 )
500 {
501  int status;
502  char buf[INIT_BUFFER_SIZE];
503  int buflen = sizeof buf;
504  size_t ret_len;
505  int num_atts;
506 
507  printf("do_xmsg_headers\n");
508  status = X400MsgGetStrParam(x400_mp, X400_S_IPM_IDENTIFIER, buf, buflen,
509  &ret_len);
510  if (status != X400_E_NOERROR) {
511  fprintf(stderr, "X400MsgGetStrParam (%d) failed %s\n",
512  X400_S_OBJECTTYPE, X400msError (status));
513  return status;
514  }
515  printf("IPM Identifier from Message BP '%.*s'\n", (int)ret_len, buf);
516 
517  status = X400MsgGetStrParam(x400_mp, X400_S_SUBJECT, buf, buflen,
518  &ret_len);
519  if (status != X400_E_NOERROR) {
520  fprintf(stderr, "X400MsgGetStrParam (%d) failed %s\n",
521  X400_S_OBJECTTYPE, X400msError (status));
522  return status;
523  }
524  printf("Subject from Message BP '%.*s'\n", (int)ret_len, buf);
525 
526  status = X400MsgGetIntParam(x400_mp, X400_N_NUM_ATTACHMENTS, &num_atts);
527  if (status != X400_E_NOERROR) {
528  fprintf(stderr, "X400MsgGetStrParam (%d) failed %s\n",
529  X400_S_OBJECTTYPE, X400msError (status));
530  return status;
531  }
532  printf("Number of attachments in Message BP %d'\n", num_atts);
533 
534  status = get_recips(x400_mp, X400_ORIGINATOR);
535  if (status != X400_E_NOERROR) {
536  return status;
537  }
538 
539  status = get_recips(x400_mp, X400_RECIP_PRIMARY);
540  if (status != X400_E_NOERROR) {
541  return status;
542  }
543 
544  status = get_recips(x400_mp, X400_RECIP_ENVELOPE);
545  if (status != X400_E_NOERROR) {
546  return status;
547  }
548 
549  return X400_E_NOERROR;
550 }
551 
552 static int do_redirection_hist (
553  struct X400Recipient *rp
554 )
555 {
556  char redirection_time [BUFSIZ];
557  char or_address [BUFSIZ];
558  char dn [BUFSIZ];
559  int rr;
560 
561  size_t length;
562  int n;
563  int status;
564 
565  struct X400RediHist *hist = NULL;
566 
567  for ( n=1; ;n++ ) {
568 
569  status = X400RediHistGet (rp,n,&hist);
570  if (status != X400_E_NOERROR)
571  break;
572 
574  redirection_time, BUFSIZ,&length);
575 
576  if (status == X400_E_NO_VALUE) {
577  return X400_E_NO_VALUE;
578  }
579 
580  if ( status == X400_E_NOERROR ) {
581  redirection_time[length] = '\0';
582  printf ("Redirection time: %i %s\n",n,redirection_time);
583  } else {
584  fprintf (stderr, "Error in do_redirection_hist: %s\n",
585  X400msError (status));
586  }
587 
589  or_address, BUFSIZ , &length);
590  if ( status == X400_E_NOERROR ) {
591  or_address[length] = '\0';
592  printf ("Redirection OR address %i :%s\n",n,or_address);
593  } else {
594  fprintf (stderr, "Error in do_redirection_hist: %s\n",
595  X400msError (status));
596  }
597 
599  dn, BUFSIZ , &length);
600  if ( status == X400_E_NOERROR ) {
601  dn[length] = '\0';
602  printf ("Redirection DN %i :%s\n",n,dn);
603  } else {
604  fprintf (stderr, "Error in do_redirection_hist: %s\n",
605  X400msError (status));
606  }
607 
609  if ( status == X400_E_NOERROR ) {
610  printf ("DSI routing action %d :%s\n",n,X400RediReason(rr));
611  } else {
612  fprintf (stderr, "Error in do_redirection_hist: %s\n",
613  X400msError (status));
614  }
615 
616  }
617  if (n == 1) {
618  printf("No Redirection histories found in message\n");
619  } else {
620  printf("%d Redirection histories found in message\n", n - 1);
621  }
622  return X400_E_NOERROR;
623 
624 }
625 
626 /* Military priority utilities */
627 char * get_x400_pty_str_from_4406(int s4406_pty) {
628  switch (s4406_pty) {
629  case 0 : return "deferred";
630  case 1 : return "routine";
631  case 2 : return "priority";
632  case 3 : return "immediate";
633  case 4 : return "flash";
634  case 5 : return "override";
635  default: return "priority";
636  }
637 }
638 
639 
640 int get_x400_pty_qual_from_4406(int s4406_pty) {
641  switch (s4406_pty) {
642  case 0 :
643  case 2 :
644  case 4 :
645  return 0;
646  case 1 :
647  case 3 :
648  case 5 :
649  return 1;
650  default:
651  return 0;
652  }
653 
654 }
655 
656 
657 int get_x400_pty_from_4406(int s4406_pty) {
658  switch (s4406_pty) {
659  case 0 :
660  case 1 :
661  return 1;
662  case 2 :
663  case 3 :
664  return 0;
665  case 4 :
666  case 5 :
667  return 2;
668  default:
669  return 0;
670  }
671 
672 }
673 
int X400BodypartGetIntParam(struct X400Bodypart *bp, int paramtype, int *valp)
Return a integer-valued parameter from the body part object.
const char * X400RediReason(int redirection_reason)
Return a human readable string based on a redirection reason.
#define X400_AUTH_ORIG
Definition: x400_att.h:308
#define X400_S_OBJECTTYPE
Definition: x400_att.h:470
#define X400_RECIP_BCC
Definition: x400_att.h:302
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_S_BODY_DATA
Definition: x400_att.h:1170
int X400msMsgGetBodypart(struct X400msMessage *mp, int number, int *typep, struct X400Bodypart **bpp)
Return a pointer to a body part object.
int X400RecipGetStrParam(struct X400Recipient *rp, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
Return a string-valued parameter from the recipient object.
#define X400_S_FTBP_CONTENT_DESCRIPTION
Definition: x400_att.h:1200
#define X400_E_COMPLEX_BODY
Definition: x400_att.h:166
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_NUM_ATTACHMENTS
Definition: x400_att.h:796
#define X400_RECIP_INTENDED
Definition: x400_att.h:317
#define X400_S_REDIRECTION_TIME
Definition: x400_att.h:511
#define X400_E_NO_RECIP
Definition: x400_att.h:109
#define X400_E_MESSAGE_BODY
Definition: x400_att.h:169
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.
int X400MsgGetRecip(struct X400Message *mp, int recip_type, int number, struct X400Recipient **rpp)
Get recipient object from message.
#define X400_E_NO_VALUE
Definition: x400_att.h:100
#define X400_T_BINARY
Definition: x400_att.h:825
#define X400_S_DIRECTORY_NAME
Definition: x400_att.h:397
#define X400_RECIP_CC
Definition: x400_att.h:299
#define X400_T_MESSAGE
Definition: x400_att.h:828
int X400MsgGetIntParam(struct X400Message *mp, int paramtype, int *valuep)
Return a integer-valued parameter from the message object.
#define X400_ORIGINATOR
Definition: x400_att.h:305
#define X400_T_ISO8859_2
Definition: x400_att.h:817
#define X400_T_ISO8859_1
Definition: x400_att.h:809
const char * X400msError(int error)
Obtain a string describing the meaning of the given error code.
#define X400_T_IA5TEXT
Definition: x400_att.h:799
#define X400_S_FTBP_CREATION_DATE
Definition: x400_att.h:1206
int X400msMsgGetMessageBody(struct X400msMessage *mp, int number, struct X400Message **mpp)
Return a pointer to a message part object.
#define X400_S_FTBP_MODIFICATION_DATE
Definition: x400_att.h:1209
#define X400_E_NOERROR
Definition: x400_att.h:46
int X400RediHistGetIntParam(struct X400RediHist *info, int paramtype, int *valuep)
Get int parameter from Redirection History object.
#define X400_N_REDIRECTION_REASON
Definition: x400_att.h:508
AMHS Symbolic Constants.
X400 MA/MS (P3/P7) Interface.
int X400msMsgGetIntParam(struct X400msMessage *mp, int paramtype, int *valp)
Return a integer-valued parameter from the message object.
#define X400_E_MISSING_ATTR
Definition: x400_att.h:88
#define X400_RECIP_PRIMARY
Definition: x400_att.h:296
#define X400_E_BADPARAM
Definition: x400_att.h:55
#define X400_S_FTBP_FILENAME
Definition: x400_att.h:1203
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_T_FTBP
Definition: x400_att.h:834
#define X400_S_SUBJECT
Definition: x400_att.h:723
#define X400_N_BODY_TYPE
Definition: x400_att.h:1167
#define X400_S_IPM_IDENTIFIER
Definition: x400_att.h:702
#define X400_RECIP_REPLY
Definition: x400_att.h:311
#define X400_E_NOMEMORY
Definition: x400_att.h:52
#define X400_T_GENERAL_TEXT
Definition: x400_att.h:841
#define X400_E_NOSPACE
Definition: x400_att.h:112
int X400RediHistGet(struct X400Recipient *recip, int entry, struct X400RediHist **hist)
Get the Redirection History object from a recipient.
#define X400_S_OR_ADDRESS
Definition: x400_att.h:349
#define X400_RECIP_REPORT
Definition: x400_att.h:314
#define X400_RECIP_ENVELOPE
Definition: x400_att.h:335