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_msrcv.c
1 /* Copyright (c) 2003-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  * Simple example program for receiving a message from a store.
14  */
15 #include <stdio.h>
16 #include <stdlib.h>
17 #ifndef _WIN32
18 #include <unistd.h>
19 #endif
20 #include <x400_msapi.h>
21 #include <amhs_att.h>
22 #include <seclabel_api.h> /* For security labels */
23 #include "example.h"
24 #include "ms_example.h"
25 
26 static char *optstr = "u371m:d:p:w:M:D:P:W:";
27 
28 static void usage(void);
29 
30 static int get_msg (
31  struct X400msSession *sp
32 );
33 
34 #ifdef WANT_DL_EXP_HIST
35 static int do_dl_hist (
36  struct X400msMessage *mp
37 );
38 #endif
39 
40 static int do_redirection_hist_env (
41  struct X400msMessage *mp
42 );
43 
44 static int do_trace_info (
45  struct X400msMessage *mp
46 );
47 
48 static int do_internal_trace_info (
49  struct X400msMessage *mp
50 );
51 
52 static int do_orig_and_dl (
53  struct X400msMessage *mp
54 );
55 
59 int
60 main(
61  int argc,
62  char **argv)
63 {
64  char buffer[BUFSIZ];
65  char pa[BUFSIZ];
66  char orn[BUFSIZ];
67  int status;
68  int nummsg;
69  int nummsg_ready;
70  struct X400msSession *sp;
71  int contype;
72  char *def_oraddr;
73  char *def_dn;
74  char *def_pa;
75  /* period to pass into X400msWait() */
76  int ms_timeout_period = 10;
77  /* number of timeouts from X400msWait() before exiting */
78  # define NUM_MSWAIT_TIMEOUTS 10
79  int max_timeouts = NUM_MSWAIT_TIMEOUTS;
80 
81  if (get_args(argc, argv, optstr)) {
82  usage();
83  exit(-1);
84  }
85 
86  printf("Connection type (0 = P7, 1 = P3 submit only, 2 = P3 both directions) [%d]: ", x400_contype);
87  contype = ic_fgetc(x400_contype, stdin);
88  if (contype != 10)
89  ic_fgetc(x400_contype, stdin);
90 
91  if ( contype < '0' || '2' < contype )
92  contype = x400_contype;
93  else
94  contype -= '0';
95 
96  if (contype == 0) {
97  def_oraddr = x400_ms_user_addr;
98  def_dn = x400_ms_user_dn;
99  def_pa = x400_ms_presentation_address;
100  }
101  else {
102  def_oraddr = x400_mta_user_addr;
103  def_dn = x400_mta_user_dn;
104  def_pa = x400_mta_presentation_address;
105  }
106 
107  printf("Your ORAddress [%s] > ", def_oraddr);
108  ic_fgets(orn, sizeof orn, stdin);
109 
110  if (orn[strlen(orn) - 1] == '\n')
111  orn[strlen(orn) - 1] = '\0';
112 
113  if (orn[0] == '\0')
114  strcpy(orn, def_oraddr);
115 
116  /* Prompt for password; note: reflected. */
117  printf("Password [%s]: ",
118  contype == 0 ? x400_p7_password : x400_p3_password);
119  if (ic_fgets(buffer, sizeof buffer, stdin) == NULL)
120  exit(1);
121 
122  if (buffer[strlen(buffer) - 1] == '\n')
123  buffer[strlen(buffer) - 1] = '\0';
124  if (buffer[0] == '\0')
125  strcpy(buffer, contype == 0 ? x400_p7_password : x400_p3_password);
126 
127  printf("Presentation Address [%s] > ", def_pa);
128  ic_fgets(pa, sizeof pa, stdin);
129 
130  if (pa[strlen(pa) - 1] == '\n')
131  pa[strlen(pa) - 1] = '\0';
132 
133  if (pa[0] == '\0')
134  strcpy(pa, def_pa);
135 
136  if (talking_to_marben_ms)
138 
139  status = X400msOpen(contype, orn, def_dn, buffer, pa, &nummsg, &sp);
140  if (status != X400_E_NOERROR) {
141  fprintf(stderr, "Error in Open: %s\n", X400msError(status));
142  exit(status);
143  }
144 
145  if (talking_to_marben_ms)
147 
148 #ifdef USING_ALERTS
149  /* If we register the alert auto-action, we will get an alert indication
150  when a message is delivered. So there is no need to poll at
151  short intervals within X400ms_Wait - we can do a slow background
152  poll and rely on the Alert indication to wake the code up instead */
154 #endif
155 
156  /* setup logging from $(ETCDIR)x400api.xml or $(SHAREDIR)x400api.xml */
157  X400msSetStrDefault(sp, X400_S_LOG_CONFIGURATION_FILE, "x400api.xml", 0);
158 
160 
161  if (contype == 0) {
162 #ifdef WANT_AUTOFORWARDING
163  struct X400msAutoActionParameter *aa_param;
164 
165  /* Register an Autoforwarding Autoaction. */
166  aa_param = X400msNewAutoActionParameter();
167 
168  /* Add mandatory things to AutoAction parameter for auto-forwarding:
169  i.e. recipient address */
170  X400RecipNew(0, &rp);
171 
172  X400RecipAddStrParam(rp, X400_S_OR_ADDRESS, def_oraddr,
173  strlen(def_oraddr));
174 
176 
179  "AF contentid", -1);
180 
182 
185  1);
186 
189  1);
190 
193  1);
194 
196 
199  "This message was autoforwarded",
200  -1);
201 
204  "This is a cover note", -1);
205 
208  "AutoForwarded:", -1);
209 
211  4, aa_param);
212  if (status != X400_E_NOERROR) {
213  fprintf(stderr,
214  "Error in RegisterAutoAction: %s\n", X400msError(status));
215  /* tidily close the session */
216  (void) X400msClose(sp);
217  exit(status);
218  }
219  printf("Registered AutoForwarding autoaction (id = 4) OK\n");
221 #endif
222 
223 #ifdef USING_ALERTS
224  /* No parameter needed for Alert autoaction - we do not support
225  configuration of requested-attributes in this API yet. */
226  status = X400msRegisterAutoAction(sp, X400_AUTO_ALERT, 9, NULL);
227  if (status != X400_E_NOERROR) {
228  fprintf(stderr, "Error in RegisterAutoAction: %s\n",
229  X400msError(status));
230  /* tidily close the session */
231  (void) X400msClose(sp);
232  exit(status);
233  }
234  printf("Registered AutoAlert autoaction (id = 9) OK\n");
235 #endif
236 
237  /* Just test the register and deregister functions */
238  status = X400msRegisterAutoAction(sp, X400_AUTO_ALERT, 10, NULL);
239  if (status != X400_E_NOERROR) {
240  fprintf(stderr, "Error in RegisterAutoAction: %s\n",
241  X400msError(status));
242  /* tidily close the session */
243  (void) X400msClose(sp);
244  exit(status);
245  }
246  printf("Registered AutoAlert autoaction (id = 10) OK\n");
247 
248  /* Lets do a deregistration of the action we just registered */
250  if (status != X400_E_NOERROR) {
251  fprintf(stderr, "Error in DeregisterAutoAction: %s\n",
252  X400msError(status));
253  /* tidily close the session */
254  (void) X400msClose(sp);
255  exit(status);
256  }
257  printf("Deregistered AutoAlert autoaction (id = 10) OK\n");
258  }
259 
260  ms_timeout_period = 20;
261 
262  if (nummsg == 0) {
263  if (ms_timeout_period == 0) {
264  printf ("\n\nno messages - looping in msWait(%d) .....\n",
265  ms_timeout_period);
266  } else {
267  printf ("\n\nno messages - calling msWait(%d) .....\n",
268  ms_timeout_period);
269  }
270  } else {
271  printf("%d messages waiting\n", nummsg);
272  }
273 
274  while (1) {
275  /* Using P3
276  * - if ms_timeout_period > 0, wait once then break
277  * - if ms_timeout_period == 0, loop through NUM_MSWAIT_TIMEOUTS
278  * times, then break.
279  */
280  status = X400msWait(sp, ms_timeout_period, &nummsg_ready);
281  if (status == X400_E_NOERROR) {
282  printf("====== Getting next msg ======= (%d)\n", nummsg_ready);
283  (void) get_msg(sp);
284  max_timeouts = NUM_MSWAIT_TIMEOUTS;
285  } else {
286  if (status != X400_E_TIMED_OUT) {
287  /* tidily close the session */
288  fprintf(stderr, "X400msWait returned error: %s\n",
289  X400msError(status));
290  status = X400msClose(sp);
291  exit(status);
292  }
293  /* printf("X400msWait returned timeout\n"); */
294  sleep(1);
295  if (max_timeouts-- == 0)
296  break;
297  }
298  if (ms_timeout_period != 0)
299  break;
300  }
301 
302  status = X400msClose(sp);
303  return(status);
304 }
305 
306 static int get_msg (
307  struct X400msSession *sp
308 )
309 {
310  int n;
311  size_t length;
312  int intparam;
313  char recipient_str[BUFSIZ];
314  int num_recips = -1;
315  int type;
316  int seqn;
317  char buffer[BUFSIZ];
318  int status;
319  struct X400Recipient *rp;
320  struct X400Recipient *orig;
321  struct X400msMessage *mp;
322 
323  printf("Getting message\n");
324  status = X400msMsgGet(sp, 0, &mp, &type, &seqn);
325  switch (status) {
326  case X400_E_NOERROR:
327  fprintf(stderr, "MsgGet successfully got message\n");
328  break;
329  default :
330  fprintf(stderr, "Error from MsgGet: %s\n", X400msError(status));
331  /* tidily close the session */
332  status = X400msClose(sp);
333  exit(status);
334  break;
335  }
336 
337  if (type != X400_MSG_MESSAGE) {
338  fprintf(stderr, "Got a report (printing only some attributes)\n");
339 
340  /* The ORADDRESS in the message is the (envelope) originator */
342  buffer, sizeof buffer, &length);
343  if (status != X400_E_NOERROR) {
344  fprintf(stderr, "Error from MsgGetStrParam: %s\n",
345  X400msError(status));
346  /* tidily close the session */
347  status = X400msClose(sp);
348  exit(status);
349  }
350  printf("Subject Identifier: %.*s\n", (int)length, buffer);
351 
352  /* Get hold of the Originator and DL history*/
353  status = do_orig_and_dl (mp);
354  if (status != X400_E_NOERROR &&
355  status != X400_E_MISSING_ATTR) {
356  fprintf(stderr,"Failed to fetch originator and dl history: %s\n",
357  X400msError (status));
358  }
359 
360  /* Get the primary recipients */
361  for (n = 1;; n++) {
362  status = X400msRecipGet(mp, X400_RECIP_REPORT, n, &rp);
363  if (status == X400_E_NO_RECIP)
364  break;
365  if (status != X400_E_NOERROR) {
366  fprintf(stderr, "Error from RecipGet: %s\n",
367  X400msError(status));
368  /* tidily close the session */
369  status = X400msClose(sp);
370  exit(status);
371  }
372 
373  /* Note: recipient may not actually have an O/R address */
375  recipient_str,
376  sizeof recipient_str, &length);
377  if (status != X400_E_NOERROR) {
378  fprintf(stderr, "Error from RecipGetStrParam: %s\n",
379  X400msError(status));
380  /* tidily close the session */
381  status = X400msClose(sp);
382  exit(status);
383  }
384 
385  /* The original message delivery time, if this attribute exists,
386  * then the report is a positive Delivery Report */
388  buffer, sizeof buffer, &length);
389  if (status == X400_E_NOERROR) {
390  /* Positive Delivery Report */
391  printf("Positive Delivery Report for recipient %d: %s\n", n,
392  recipient_str);
393  printf("Delivery Time: %.*s\n", (int)length, buffer);
394  }
395  else {
396  /* Negative Delivery Report */
397  printf("Negative Delivery Report for recipient %d: %s\n", n,
398  recipient_str);
399 
400  /* Supplementary Info to the report */
402  buffer, sizeof buffer,
403  &length);
404  if (status != X400_E_NOERROR) {
405  fprintf(stderr, "Error from RecipGetStrParam: %s\n",
406  X400msError(status));
407  buffer[0] = '\0';
408  }
409  printf("Supplementary Info: %.*s\n", (int)length, buffer);
410 
411  /* The reason why the message was not delivered */
412  status =
414  &intparam);
415  if (status != X400_E_NOERROR) {
416  fprintf(stderr, "Error from MsgGetIntParam: %s\n",
417  X400msError(status));
418  }
419  printf("Non-Delivery Reason: %d\n", intparam);
420 
421  /* The diagnostics of the report for this recipient */
422  status =
424  &intparam);
425  if (status != X400_E_NOERROR) {
426  fprintf(stderr, "Error from MsgGetIntParam: %s\n",
427  X400msError(status));
428  }
429  printf("Non-Delivery Diagnostic: %d\n", intparam);
430  }
431  }
432 
433  (void) X400msMsgDelete(mp, 0);
434  status = X400msClose(sp);
435  exit(status);
436  }
437 
438 
439  /* The message identifier */
441  buffer, sizeof buffer, &length);
442  if (status != X400_E_NOERROR) {
443  fprintf(stderr, "Error from MsgGetStrParam: %s\n",
444  X400msError(status));
445  /* tidily close the session */
446  status = X400msClose(sp);
447  exit(status);
448  }
449  printf("Message Identifier: %.*s\n", (int)length, buffer);
450 
451  /* The ORADDRESS in the message is the (envelope) originator */
453  buffer, sizeof buffer, &length);
454  if (status != X400_E_NOERROR) {
455  fprintf(stderr, "Error from MsgGetStrParam: %s\n",
456  X400msError(status));
457  /* tidily close the session */
458  status = X400msClose(sp);
459  exit(status);
460  }
461  printf("Envelope Originator: %.*s\n", (int)length, buffer);
462 
463  /* The header originator is retrieved using GetRecip() */
464  status = X400msRecipGet(mp, X400_ORIGINATOR, 1, &orig);
465  if (status != X400_E_NOERROR) {
466  fprintf(stderr, "Error from RecipGet: %s\n", X400msError(status));
467  /* tidily close the session */
468  status = X400msClose(sp);
469  exit(status);
470  }
471  /* The X400_ORIGINATOR in the reicpient is the header originator */
473  buffer, sizeof buffer, &length);
474  if (status == X400_E_NOERROR) {
475  printf("Header Originator %.*s\n", (int)length, buffer);
476  } else {
477  printf("No Header Originator\n");
478  }
479 
480  status = X400msMsgCountRecip(mp, X400_RECIP_PRIMARY, &num_recips);
481  if (status != X400_E_NOERROR) {
482  fprintf(stderr, "Error from MsgCountRecip: %s\n",
483  X400msError(status));
484  /* tidily close the session */
485  status = X400msClose(sp);
486  exit(status);
487  }
488 
489  printf("There are %d recipients\n", num_recips);
490 
491  /* Get the envelope recipients */
492  for (n = 1;; n++) {
493  status = X400msRecipGet(mp, X400_RECIP_ENVELOPE, n, &rp);
494  if (status == X400_E_NO_RECIP)
495  break;
496  if (status != X400_E_NOERROR) {
497  fprintf(stderr, "Error from RecipGet: %s\n", X400msError(status));
498  /* tidily close the session */
499  status = X400msClose(sp);
500  exit(status);
501  }
502 
503  /* Note: recipient may not actually have an O/R address */
505  buffer, sizeof buffer, &length);
506  if (status == X400_E_NOERROR) {
507  printf("Header Recipient %d: %.*s\n", n, (int)length, buffer);
508  }
509  }
510 
511 
512  /* Get the primary recipients */
513  for (n = 1;; n++) {
514  status = X400msRecipGet(mp, X400_RECIP_PRIMARY, n, &rp);
515  if (status == X400_E_NO_RECIP)
516  break;
517  if (status != X400_E_NOERROR) {
518  fprintf(stderr, "Error from RecipGet: %s\n", X400msError(status));
519  /* tidily close the session */
520  status = X400msClose(sp);
521  exit(status);
522  }
523 
524  /* Note: recipient may not actually have an O/R address */
526  buffer, sizeof buffer, &length);
527  if (status == X400_E_NOERROR) {
528  printf("Primary Recipient %d: %.*s\n", n, (int)length, buffer);
529  }
530  }
531 
532 #ifdef WANT_DL_EXP_HIST
533  /* DL Expansion history */
534  {
535 
536  status = do_dl_hist(hist);
537 
538  /* Normally the status is "X400_E_NO_VALUE" If there is no
539  * DL Expansion history.
540  * Or X400_E_MISSING_ATTR if the DL Expansion history entry is missing
541  * (so end of loop)
542  */
543  if ( status == X400_E_NO_VALUE) {
544  /* do nothing */
545  } else if (status == X400_E_MISSING_ATTR ) {
546  printf("There is no DL expansion history\n");
547  } else {
548  /* There has been an error fetching the DL expansion history*/
549  printf("error getting DL Expansion History\n");
550  fprintf (stderr, "Error in X400mtDLExpHistGet: %s\n",
551  X400msError (status));
552  return status;
553  }
554  }
555 #endif
556 
557 #define WANT_TRACE_INFO 1
558 #ifdef WANT_TRACE_INFO
559  {
560 
561  status = do_trace_info(mp);
562  if ( status == X400_E_NOERROR) {
563  printf("Got Trace Info\n");
564  } else if ( status == X400_E_NO_VALUE) {
565  printf("There is no value for Trace Info\n");
566  } else if (status == X400_E_MISSING_ATTR ) {
567  printf("There is no Trace Info\n");
568  } else {
569  printf("error getting Trace Info\n");
570  fprintf (stderr, "Error fetching trace info: %s\n",
571  X400msError (status));
572  return status;
573  }
574 
575  }
576 
577 #endif
578 
579 #define USE_INTERNAL_TRACE_INFO 1
580 #ifdef USE_INTERNAL_TRACE_INFO
581  {
582 
583  status = do_internal_trace_info(mp);
584  if ( status == X400_E_NOERROR) {
585  printf("Got Trace Info\n");
586  } else if ( status == X400_E_NO_VALUE) {
587  printf("There is no value for internal Trace Info\n");
588  } else if (status == X400_E_MISSING_ATTR ) {
589  printf("There is no internal Trace Info\n");
590  } else {
591  printf("error getting int Trace Info\n");
592  fprintf (stderr, "Error fetching int trace info: %s\n",
593  X400msError (status));
594  return status;
595  }
596 
597  }
598 #endif
599 
600 
601 
602 #define USE_REDIRECTION_HISTORY 1
603 #ifdef USE_REDIRECTION_HISTORY
604  {
605  status = do_redirection_hist_env(mp);
606  if ( status == X400_E_NOERROR) {
607  printf("Got Redirection History\n");
608  } else if ( status == X400_E_NO_VALUE) {
609  /* do nothing */
610  printf("There is no value for Redirection History\n");
611  } else if (status == X400_E_MISSING_ATTR ) {
612  printf("There is no Redirection History\n");
613  } else {
614  printf("error getting Redirection History\n");
615  fprintf (stderr, "Error fetching Redirection History: %s\n",
616  X400msError (status));
617  return status;
618  }
619  }
620 #endif
621  /* Security Label */
622 
623 #ifdef USE_SEC_LABEL
624 
625 #define XML_BUFSIZE 1024
626  {
627  char xml_buffer[XML_BUFSIZE];
628  unsigned char slab_buffer[XML_BUFSIZE];
629 
630  status = X400msMsgGetStrParam(mp,
632  (char*)slab_buffer,
633  XML_BUFSIZE,
634  &length);
635  if (status == X400_E_NO_VALUE) {
636  printf("No security label\n");
637  } else if (status != X400_E_NOERROR) {
638  fprintf(stderr,"Failed to fetch security label: %d",status);
639  exit(1);
640  } else {
641  int sec_status = 0;
642 
643  sec_status = SecLabelInit("Example program");
644  if (sec_status != SECLABEL_E_NOERROR) {
645  fprintf(stderr, "SecLabelInit returned error %d\n", sec_status);
646  exit(1);
647  }
648 
649  status = SecLabelPrint(slab_buffer,
650  length,
651  xml_buffer,
652  XML_BUFSIZE);
653 
654  if (status != SECLABEL_E_NOERROR) {
655  fprintf(stderr, "SecLabelPrint returned error %d\n", status);
656  exit(1);
657  }
658 
659  /* You could now write out the XML file, or parse it in memory..*/
660  printf("Got security label:%s\n",xml_buffer);
661  }
662 
663 
664  }
665 
666 #endif
667 
668 
669 
670  /* Subject is optional */
672  buffer, sizeof buffer, &length);
673  if (status == X400_E_NOERROR)
674  printf("Subject: %.*s\n", (int)length, buffer);
675 
676 
677  /* content type */
678  status = X400msMsgGetIntParam(mp, X400_N_CONTENT_TYPE, &intparam);
679  if (status == X400_E_NOERROR)
680  printf ("Content type : P%d\n", intparam);
681 
682  /* external content type */
684  buffer, sizeof buffer, &length);
685  if (status == X400_E_NOERROR)
686  printf("External Content Type: %.*s\n", (int)length, buffer);
687 
688  /* And message text (or it could be another type) */
690  buffer, sizeof buffer, &length);
691  if (status == X400_E_NOERROR)
692  printf("\nIA5 Text:\n%.*s\n\n", (int)length, buffer);
693  else
694  printf("No IA5 Text content (%d: %s)\n", status, X400msError(status));
695 
696 
697  /* ATS attributes */
699  buffer, sizeof buffer, &length);
700  if (status == X400_E_NOERROR)
701  printf("ATS Priority Indicator: %.*s\n", (int)length, buffer);
702 
704  buffer, sizeof buffer, &length);
705  if (status == X400_E_NOERROR)
706  printf("ATS Filing Time: %.*s\n", (int)length, buffer);
707 
709  buffer, sizeof buffer, &length);
710  if (status == X400_E_NOERROR)
711  printf("ATS Optional Heading Info: %.*s\n", (int)length, buffer);
712 
713  status = X400msMsgGetStrParam(mp, ATS_S_TEXT,
714  buffer, sizeof buffer, &length);
715  if (status == X400_E_NOERROR)
716  printf("ATS Text: %.*s\n", (int)length, buffer);
717 
718  /* get all the attachments */
719  (void) get_body_parts(mp);
720 
721  /* Deletes message in message store as well as internal copy */
722  printf("\n+++ got message - deleting it and returning+++\n");
723  status = X400msMsgDelete(mp, 0);
724 
725  return(status);
726 }
727 
728 #ifdef WANT_DL_EXP_HIST
729 static int do_dl_hist (
730  struct X400msMessage *mp
731 )
732 {
733  char DLORAddress[BUFSIZ];
734  char DLORDN[BUFSIZ];
735  char DLExpTime[BUFSIZ];
736  size_t length;
737  int n;
738  int status;
739  struct X400DLExpHist *hist = NULL;
740 
741  /* Loop through the entries, pulling out the OR Address, DN, and expansion
742  * time for each entry.
743  * Stop looping when there is no n entry
744  */
745  for ( n=1; ;n++ ) {
746 
747  status = X400msDLExpHistGet (mp,n,&hist);
748  if (status != X400_E_NOERROR) {
749  return status;
750  }
751 
752  status = X400DLGetStrParam (hist, X400_S_OR_ADDRESS,
753  DLORAddress, BUFSIZ , &length);
754  if (status == X400_E_NO_VALUE) {
755  return X400_E_NO_VALUE;
756  }
757  if ( status == X400_E_NOERROR ) {
758  DLORAddress[length] = '\0';
759  printf ("DLExpansion List entry %d OR Address:%s\n",
760  n,DLORAddress);
761  } else {
762  fprintf (stderr, "Error in :X400mtDLGetStrParam OR %s\n",
763  X400msError (status));
764  }
765 
766 
767 
768  status = X400DLGetStrParam (hist, X400_S_DIRECTORY_NAME,
769  DLORDN, BUFSIZ , &length);
770  if ( status == X400_E_NOERROR ) {
771  DLORDN[length] = '\0';
772  printf ("DLExpansion List entry %d DN :%s\n",n,DLORDN);
773  } else {
774  fprintf (stderr, "Error in :X400mtDLGetStrParam DN %s\n",
775  X400msError (status));
776  }
777 
778  status = X400DLGetStrParam (hist, X400_S_DLEXP_TIME,
779  DLExpTime, BUFSIZ , &length);
780  if ( status == X400_E_NOERROR ) {
781  DLExpTime[length] = '\0';
782  printf ("DLExpansion List entry %d Time :%s\n",n,DLExpTime);
783  } else {
784  fprintf (stderr, "Error in :X400mtDLGetStrParam Time %s\n",
785  X400msError (status));
786  }
787 
788  }
789  if (n == 1) {
790  printf("No DLEH found in message");
791  } else {
792  printf("%d DLEH entries found in message", n - 1);
793  }
794  return X400_E_NOERROR;
795 }
796 #endif
797 
798 static int do_redirection_hist_env (
799  struct X400msMessage *mp
800 )
801 {
802  char redirection_time [BUFSIZ];
803  char or_address [BUFSIZ];
804  char dn [BUFSIZ];
805  int rr;
806 
807  size_t length;
808  int n;
809  int status;
810 
811  struct X400RediHist *hist = NULL;
812 
813  for ( n=1; ;n++ ) {
814 
815  status = X400msRediHistGetEnv (mp,n,&hist);
816  if (status != X400_E_NOERROR)
817  break;
818 
820  redirection_time, BUFSIZ,&length);
821 
822  if (status == X400_E_NO_VALUE) {
823  return X400_E_NO_VALUE;
824  }
825 
826  if ( status == X400_E_NOERROR ) {
827  redirection_time[length] = '\0';
828  printf ("Redirection time: %i %s\n",n,redirection_time);
829  } else {
830  fprintf (stderr, "Error in do_redirection_hist_env: %s\n",
831  X400msError (status));
832  }
833 
835  or_address, BUFSIZ , &length);
836  if ( status == X400_E_NOERROR ) {
837  or_address[length] = '\0';
838  printf ("Redirection OR address %i :%s\n",n,or_address);
839  } else {
840  fprintf (stderr, "Error in do_redirection_hist_env: %s\n",
841  X400msError (status));
842  }
843 
845  dn, BUFSIZ , &length);
846  if ( status == X400_E_NOERROR ) {
847  dn[length] = '\0';
848  printf ("Redirection DN %i :%s\n",n,dn);
849  } else {
850  fprintf (stderr, "Error in do_redirection_hist_env: %s\n",
851  X400msError (status));
852  }
853 
855  if ( status == X400_E_NOERROR ) {
856  printf ("DSI routing action %d :%s\n",n,X400RediReason(rr));
857  } else {
858  fprintf (stderr, "Error in do_redirection_hist_env: %s\n",
859  X400msError (status));
860  }
861 
862  }
863  if (n == 1) {
864  printf("No Redirection histories found in envelope\n");
865  } else {
866  printf("%d Redirection histories found in envelope\n", n - 1);
867  }
868  return X400_E_NOERROR;
869 
870 }
871 
872 
873 static int do_trace_info (
874  struct X400msMessage *mp
875 )
876 {
877  char GDI [BUFSIZ];
878  char DSI_arrival_time[BUFSIZ];
879  int DSI_routing_action;
880  char DSI_attempted_domain[BUFSIZ];
881 
882  char DSI_AA_def_time[BUFSIZ];
883  char DSI_AA_CEIT[BUFSIZ];
884  int DSI_AA_redirected = 0;
885  int DSI_AA_dl_operation = 0;
886 
887  size_t length;
888  int n;
889  int status;
890 
891  struct X400TraceInfo *info = NULL;
892 
893  for ( n=1; ;n++ ) {
894  status = X400msTraceInfoGet (mp, n, &info, X400_TRACE_INFO);
895  if (status != X400_E_NOERROR)
896  break;
897 
899  GDI, BUFSIZ , &length);
900 
901  if ( status == X400_E_NOERROR ) {
902  GDI[length] = '\0';
903  printf ("GDI entry %d OR Address:%s\n",n,GDI);
904  } else {
905  fprintf (stderr, "Error in do_trace_info: %s\n",
906  X400msError (status));
907  }
908 
910  DSI_arrival_time, BUFSIZ , &length);
911  if ( status == X400_E_NOERROR ) {
912  DSI_arrival_time[length] = '\0';
913  printf ("DSI arrival time %d :%s\n",n,DSI_arrival_time);
914  } else {
915  fprintf (stderr, "Error in do_trace_info: %s\n",
916  X400msError (status));
917  }
918 
920  &DSI_routing_action);
921  if ( status == X400_E_NOERROR ) {
922  printf ("DSI routing action %d :%s\n",n,
923  DSI_routing_action ? "rerouted" : "relayed");
924  } else {
925  fprintf (stderr, "Error in do_trace_info: %s\n",
926  X400msError (status));
927  }
928 
929  /* This one is optional*/
930  status = X400TraceInfoGetStrParam (info,
932  DSI_attempted_domain,
933  BUFSIZ ,&length);
934  if ( status == X400_E_NOERROR ) {
935  DSI_attempted_domain[length] = '\0';
936  printf ("DSI attempted domain %d :%s\n",n,DSI_attempted_domain);
937  } else {
938  fprintf (stderr, "Error in do_trace_info optional component: %s\n",
939  X400msError (status));
940  }
941 
942  /*optional*/
943  status = X400TraceInfoGetStrParam (info,
945  DSI_AA_def_time,
946  BUFSIZ ,&length);
947  if ( status == X400_E_NOERROR ) {
948  DSI_AA_def_time[length] = '\0';
949  printf ("DSI AA %d :%s\n",n,DSI_AA_def_time);
950  } else {
951  fprintf (stderr, "Error in do_trace_info optional component: %s\n",
952  X400msError (status));
953  }
954 
955  /*optional*/
956  status = X400TraceInfoGetStrParam (info,
958  DSI_AA_CEIT,
959  BUFSIZ ,&length);
960  if ( status == X400_E_NOERROR ) {
961  DSI_AA_CEIT[length] = '\0';
962  printf ("DSI AA %d :%s\n",n,DSI_AA_CEIT);
963  } else {
964  fprintf (stderr, "Error in do_trace_info optional component: %s\n",
965  X400msError (status));
966  }
967 
968 
969  status = X400TraceInfoGetIntParam (info,
971  &DSI_AA_redirected);
972  if ( status == X400_E_NOERROR ) {
973  printf ("DSI AA redirected %d :%d\n",n,DSI_AA_redirected );
974  } else {
975  fprintf (stderr, "Error in do_trace_info: %s\n",
976  X400msError (status));
977  }
978 
979  status = X400TraceInfoGetIntParam (info,
981  &DSI_AA_dl_operation);
982  if ( status == X400_E_NOERROR ) {
983  printf ("DSI AA dl operation %d :%d\n",n,DSI_AA_dl_operation );
984  } else {
985  fprintf (stderr, "Error in do_trace_info: %s\n",
986  X400msError (status));
987  }
988 
989 
990  }
991  if (n == 1) {
992  printf("No Trace Info found in message\n");
993  } else {
994  printf("%d Trace Info entries found in message\n", n - 1);
995  }
996  return X400_E_NOERROR;
997 
998 }
999 
1000 
1001 static int do_internal_trace_info (
1002  struct X400msMessage *mp
1003 )
1004 {
1005 
1006  size_t length;
1007  int n;
1008  int status;
1009  int SI_routing_action = 0;
1010  int SI_attempted_action = 0;
1011  int SI_OA = 0;
1012 
1013  char GDI [BUFSIZ];
1014  char SI_MTA_name [BUFSIZ];
1015  char SI_time [BUFSIZ];
1016  char SI_attempted_MTA_name[BUFSIZ];
1017  char SI_attempted_domain [BUFSIZ];
1018  char SI_defered_time [BUFSIZ];
1019  char SI_CEIT [BUFSIZ];
1020 
1021  struct X400InternalTraceInfo *info = NULL;
1022 
1023  for ( n=1; ;n++ ) {
1024  /*GDI*/
1025  status = X400msInternalTraceInfoGet (mp,n, &info);
1026  if (status == X400_E_NO_VALUE)
1027  break;
1028 
1029  status = X400InternalTraceInfoGetStrParam (info,
1031  GDI, BUFSIZ , &length);
1032  if ( status == X400_E_NOERROR ) {
1033  GDI[length] = '\0';
1034  printf ("GDI entry %d Domain:%s\n",n,GDI);
1035  } else {
1036  fprintf (stderr, "Error in do_trace_info: %s\n",
1037  X400msError (status));
1038  }
1039 
1040  /*MTA Name */
1041  status = X400InternalTraceInfoGetStrParam (info,
1043  SI_MTA_name, BUFSIZ , &length);
1044 
1045  if ( status == X400_E_NOERROR ) {
1046  SI_MTA_name [length] = '\0';
1047  printf ("MTA Name entry %d :%s\n",n,SI_MTA_name);
1048  } else {
1049  fprintf (stderr, "Error in do_internal_trace_info: %s\n",
1050  X400msError (status));
1051  }
1052 
1053  /*SI MTA Name*/
1054 
1055  status = X400InternalTraceInfoGetStrParam (info,
1057  SI_time, BUFSIZ , &length);
1058 
1059  if ( status == X400_E_NOERROR ) {
1060  SI_time[length] = '\0';
1061  printf ("SI MTA TIME entry %d :%s\n",n,SI_time);
1062  } else {
1063  fprintf (stderr, "Error in do_internal_trace_info: %s\n",
1064  X400msError (status));
1065  }
1066 
1067  /* SI routing action */
1068  status = X400InternalTraceInfoGetIntParam (info,
1070  &SI_routing_action);
1071  if ( status == X400_E_NOERROR ) {
1072  if (SI_routing_action == X400_MTA_SI_ROUTING_ACTION_RELAYED) {
1073  printf ("SI routing action %d :relayed\n",n);
1074  } else {
1075  printf ("SI routing action %d :rerouted\n",n);
1076  }
1077 
1078  } else {
1079  fprintf (stderr, "Error in do_internal_trace_info: %s\n",
1080  X400msError (status));
1081  }
1082 
1083  status = X400InternalTraceInfoGetIntParam (info,
1085  &SI_attempted_action);
1086  if ( status == X400_E_NOERROR ) {
1087  if (SI_routing_action == X400_MTA_SI_RA_MTA) {
1088  printf ("SI attempted action %d :MTA\n",n);
1089  } else {
1090  printf ("SI attempted action %d :Domain\n",n);
1091  }
1092 
1093  } else {
1094  fprintf (stderr, "Error in do_internal_trace_info: %s\n",
1095  X400msError (status));
1096  }
1097 
1098  if (SI_attempted_action == X400_MTA_SI_RA_MTA) {
1099  /* SI Attempted MTA Name */
1100  status = X400InternalTraceInfoGetStrParam (info,
1102  SI_attempted_MTA_name,
1103  BUFSIZ,&length);
1104 
1105  if ( status == X400_E_NOERROR ) {
1106  SI_attempted_MTA_name[length] = '\0';
1107  printf ("Supplied information attempted MTA %d"
1108  ":%s\n",n,SI_attempted_MTA_name);
1109  } else {
1110  fprintf (stderr, "Error in do_trace_info: %s\n",
1111  X400msError (status));
1112  }
1113 
1114  } else {
1115 
1116  /*SI Attempted domain*/
1117  status = X400InternalTraceInfoGetStrParam (info,
1119  SI_attempted_domain, BUFSIZ,
1120  &length);
1121 
1122  if ( status == X400_E_NOERROR ) {
1123  SI_attempted_domain[length] = '\0';
1124  printf ("Supplied information attempted Domain entry"
1125  " %d :%s\n",n,SI_attempted_domain);
1126  } else {
1127  fprintf (stderr, "Error in do_internal_trace_info: %s\n",
1128  X400msError (status));
1129  }
1130  }
1131 
1132 
1133 
1134  /* SI MTA Defered time*/
1135  status = X400InternalTraceInfoGetStrParam (info,
1137  SI_defered_time,
1138  BUFSIZ , &length);
1139 
1140  if ( status == X400_E_NOERROR ) {
1141  SI_defered_time[length] = '\0';
1142  printf ("SI_defered_time entry %d :%s\n",n,
1143  SI_defered_time);
1144  } else {
1145  fprintf (stderr, "Error in do_internaltrace_info: %s\n",
1146  X400msError (status));
1147  }
1148 
1149  /* SI MTA Converted Encoded Information Types*/
1150  status = X400InternalTraceInfoGetStrParam (info,
1152  SI_CEIT,
1153  BUFSIZ , &length);
1154 
1155  if ( status == X400_E_NOERROR ) {
1156  SI_CEIT[length] = '\0';
1157  printf ("SI_CEIT entry %d :%s\n",n,
1158  SI_CEIT);
1159  } else {
1160  fprintf (stderr, "Error in do_internaltrace_info: %s\n",
1161  X400msError (status));
1162  }
1163 
1164 
1165  status = X400InternalTraceInfoGetIntParam (info,
1167  &SI_OA);
1168  if ( status == X400_E_NOERROR ) {
1170  printf("SI_Other_Actions: %d: Redirected\n",n);
1171  }
1173  printf("SI_Other_Actions: %d: DLOP\n",n);
1174  }
1175 
1176  } else {
1177  fprintf (stderr, "Error in do_internal_trace_info: %s\n",
1178  X400msError (status));
1179  }
1180 
1181 
1182  }
1183  if (n == 1) {
1184  printf("No Internal Trace Info found in message\n");
1185  } else {
1186  printf("%d Internal Trace Info entries found in message\n", n - 1);
1187  }
1188  return X400_E_NOERROR;
1189 
1190 }
1191 
1192 static int do_orig_and_dl (
1193  struct X400msMessage *mp
1194 )
1195 {
1196  char exp_time [BUFSIZ];
1197  char or_address [BUFSIZ];
1198  char dn_address [BUFSIZ];
1199 
1200  size_t length;
1201  int n;
1202  int status;
1203 
1204  struct X400ORandDL *orig_and_dl = NULL;
1205 
1206  for ( n=1; ;n++ ) {
1207 
1208  status = X400msORandDLGet (mp,n,&orig_and_dl);
1209  if (status == X400_E_NO_VALUE) {
1210  printf("Finished getting originator and dl expansion history\n");
1211  break;
1212  } else if (status != X400_E_NOERROR) {
1213  return status;
1214  }
1215 
1216  status = X400ORandDLGetStrParam (orig_and_dl,
1218  exp_time, BUFSIZ,&length);
1219 
1220  if ( status == X400_E_NOERROR ) {
1221  exp_time[length] = '\0';
1222  printf ("do_orig_and_dl: %i %s\n",n,exp_time);
1223  } else if(status != X400_E_MISSING_ATTR ) {
1224  fprintf (stderr, "Error in do_orig_and_dl: %s\n",
1225  X400msError (status));
1226  }
1227 
1228  status = X400ORandDLGetStrParam(orig_and_dl, X400_S_OR_ADDRESS,
1229  or_address, BUFSIZ , &length);
1230  if ( status == X400_E_NOERROR ) {
1231  or_address[length] = '\0';
1232  printf ("do_orig_and_dl OR address %i :%s\n",n,or_address);
1233  } else if(status != X400_E_MISSING_ATTR ) {
1234  fprintf (stderr, "Error in do_orig_and_dl: %s\n",
1235  X400msError (status));
1236  }
1237 
1238  status = X400ORandDLGetStrParam(orig_and_dl,
1240  dn_address, BUFSIZ , &length);
1241  if ( status == X400_E_NOERROR ) {
1242  dn_address[length] = '\0';
1243  printf ("originator and DL expansion DN %i :%s\n",n,dn_address);
1244  } else if(status != X400_E_MISSING_ATTR ) {
1245  fprintf (stderr, "Error in do_orig_and_dl: %s\n",
1246  X400msError (status));
1247  }
1248 
1249 
1250  }
1251  if (n == 1) {
1252  printf("No orig and dl hist found in message\n");
1253  } else {
1254  printf("%d orig and dl hist found in message\n", n - 1);
1255  }
1256  return X400_E_NOERROR;
1257 }
1258 
1259 
1260 static void usage(void) {
1261  printf("usage: %s\n", optstr);
1262  printf("\t where:\n");
1263  printf("\t -u : Don't prompt to override defaults \n");
1264  printf("\t -3 : Use P3 connection \n");
1265  printf("\t -7 : Use P7 connection \n");
1266  printf("\t -m : OR Address in P7 bind arg \n");
1267  printf("\t -d : DN in P7 bind arg \n");
1268  printf("\t -p : Presentation Address of P7 Store \n");
1269  printf("\t -w : P7 password of P7 user \n");
1270  printf("\t -M : OR Address in P3 bind arg \n");
1271  printf("\t -D : DN in P3 bind arg \n");
1272  printf("\t -P : Presentation Address of P3 server\n");
1273  printf("\t -W : P3 password of P3 user \n");
1274  return;
1275 }
1276 
#define X400_S_DIRECTORY_NAME
Definition: x400_att.h:394
#define X400_MSG_MESSAGE
Definition: x400_att.h:29
#define X400_S_EXTERNAL_CONTENT_TYPE
Definition: x400_att.h:444
#define X400_S_ORIG_OR_EXAP_TIME
Definition: x400_att.h:965
#define X400_S_MTA_SI_DEFERRED_TIME
Definition: x400_att.h:1565
void X400msFreeAutoActionParameter(struct X400msAutoActionParameter *aa_param)
Free an autoaction parameter.
#define X400_S_COVER_NOTE
Definition: x400_att.h:1230
struct X400msAutoActionParameter * X400msNewAutoActionParameter(void)
Create a new (empty) autoaction parameter structure.
#define X400_N_MTA_SI_ATTEMPTED_ACTION
Definition: x400_att.h:1574
#define X400_N_IMPLICIT_CONVERSION_PROHIBITED
Definition: x400_att.h:427
#define X400_S_DLEXP_TIME
Definition: x400_att.h:476
int X400msRegisterAutoAction(struct X400msSession *sp, int type, int id, struct X400msAutoActionParameter *aa_param)
Register an autoaction with the Message Store.
int X400msDLExpHistGet(struct X400msMessage *mp, int entry, struct X400DLExpHist **hist)
Create a new DL Expansion History object from the message object.
#define X400_S_LOG_CONFIGURATION_FILE
Definition: x400_att.h:1080
int X400msSetStrDefault(struct X400msSession *sp, int paramtype, const char *value, size_t length)
Set a default string parameter value in a session.
int X400msInternalTraceInfoGet(struct X400msMessage *mp, int entry, struct X400InternalTraceInfo **info)
Get an Internal Trace Info object for a message object.
#define X400_S_SUBJECT_IDENTIFIER
Definition: x400_att.h:1027
int X400msAutoActionParameterAddStrParam(struct X400msAutoActionParameter *aap, int paramtype, const char *value, size_t length)
Add string-valued parameter to the autoaction parameter.
#define X400_S_CONTENT_IDENTIFIER
Definition: x400_att.h:411
int X400msMsgGetIntParam(struct X400msMessage *mp, int paramtype, int *valp)
Return a integer-valued parameter from the message object.
#define X400_N_MTA_SI_ROUTING_ACTION
Definition: x400_att.h:1556
#define X400_AUTO_ALERT
Definition: x400_att.h:1305
void X400msSetConfigRequest(int val)
Disable and enable configuration requests in MS Bind operations.
int X400msORandDLGet(struct X400msMessage *msg, int entry, struct X400ORandDL **or_and_dl)
Get Originator and DL expansion history object.
#define ATS_S_OPTIONAL_HEADING_INFO
Definition: amhs_att.h:39
#define X400_S_MTA_SI_ATTEMPTED_MTA
Definition: x400_att.h:1559
#define ATS_S_FILING_TIME
Definition: amhs_att.h:36
int X400msMsgGet(struct X400msSession *sp, int number, struct X400msMessage **mpp, int *typep, int *seqp)
Get message object for transfer out from MTA.
#define X400_S_MTA_SI_ATTEMPTED_DOMAIN
Definition: x400_att.h:1562
#define X400_N_DSI_AA_DLOPERATION
Definition: x400_att.h:499
int X400InternalTraceInfoGetStrParam(struct X400InternalTraceInfo *info, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
Get string parameter from Internal Trace Information object.
#define X400_N_STRICT_P7_1988
Definition: x400_att.h:1257
int X400RecipAddStrParam(struct X400Recipient *rp, int paramtype, const char *value, size_t length)
Add string-valued parameter to the recipient.
#define X400_S_SUPPLEMENTARY_INFO
Definition: x400_att.h:1030
#define X400_S_DSI_ARRIVAL_TIME
Definition: x400_att.h:481
const char * X400msError(int error)
Obtain a string describing the meaning of the given error code.
int X400TraceInfoGetStrParam(struct X400TraceInfo *info, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
Get string parameter from Trace Information object.
#define X400_S_MTA_SI_TIME
Definition: x400_att.h:1553
#define X400_N_DSI_AA_REDIRECTED
Definition: x400_att.h:496
int X400TraceInfoGetIntParam(struct X400TraceInfo *info, int paramtype, int *valuep)
Get int parameter from Trace Information object.
#define X400_E_NO_RECIP
Definition: x400_att.h:109
int X400msClose(struct X400msSession *sp)
Close a X400 Session.
#define ATS_S_PRIORITY_INDICATOR
Definition: amhs_att.h:31
#define X400_AUTO_FORWARDING
Definition: x400_att.h:1308
#define X400_S_AUTO_FORWARDING_COMMENT
Definition: x400_att.h:1226
int X400msDeregisterAutoAction(struct X400msSession *sp, int type, int id)
Deregister an autoaction from the Message Store.
#define X400_N_OR_CANONICAL
Definition: x400_att.h:1124
#define X400_E_NO_VALUE
Definition: x400_att.h:100
int X400msRecipGet(struct X400msMessage *mp, int type, int number, struct X400Recipient **rpp)
Get recipient object from message.
#define X400_T_IA5TEXT
Definition: x400_att.h:795
#define X400_E_NOERROR
Definition: x400_att.h:46
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.
#define X400_ORIGINATOR
Definition: x400_att.h:302
int X400RecipNew(int type, struct X400Recipient **rpp)
Create a new recipient object.
#define X400_MTA_SI_OTHER_ACTION_DLOPERATION
Definition: x400_att.h:1592
int X400msMsgCountRecip(struct X400msMessage *mp, int type, int *cp)
Returns count of addresses of given type in message object.
#define X400_S_REDIRECTION_TIME
Definition: x400_att.h:508
#define X400_S_OR_ADDRESS
Definition: x400_att.h:346
#define X400_N_CONTENT_TYPE
Definition: x400_att.h:405
#define X400_MTA_SI_RA_MTA
Definition: x400_att.h:1577
const char * X400RediReason(int redirection_reason)
Return a human readable string based on a redirection reason.
#define X400_S_MESSAGE_IDENTIFIER
Definition: x400_att.h:402
int X400msMsgGetStrParam(struct X400msMessage *mp, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
Return a string-valued parameter from the message object.
#define X400_RECIP_STANDARD
Definition: x400_att.h:338
#define X400_E_TIMED_OUT
Definition: x400_att.h:106
#define X400_N_DISCLOSURE
Definition: x400_att.h:424
int X400msAutoActionParameterAddRecip(struct X400msAutoActionParameter *aap, int reciptype, struct X400Recipient *recip)
Add a receipient to the autoaction parameter.
#define X400_S_GLOBAL_DOMAIN_ID
Definition: x400_att.h:478
int X400msRecipGetIntParam(struct X400Recipient *rp, int paramtype, int *valp)
Return a integer-valued parameter from the recipient object.
#define X400_MTA_SI_ROUTING_ACTION_RELAYED
Definition: x400_att.h:1583
#define X400_S_SECURITY_LABEL
Definition: x400_att.h:1319
#define X400_RECIP_PRIMARY
Definition: x400_att.h:293
#define X400_S_THIS_IPM_PREFIX
Definition: x400_att.h:1233
#define X400_N_WAIT_INTERVAL
Definition: x400_att.h:1073
int X400RediHistGetStrParam(struct X400RediHist *hist, int paramtype, char *value, size_t length, size_t *lengthp)
Get string-valued parameter from the X400RediHist object.
int X400InternalTraceInfoGetIntParam(struct X400InternalTraceInfo *info, int paramtype, int *valuep)
Get int parameter from Internal Trace Information object.
int X400msRecipGetStrParam(struct X400Recipient *rp, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
Return a string-valued parameter from the recipient object.
#define ATS_S_TEXT
Definition: amhs_att.h:42
#define X400_N_MTA_SI_OTHER_ACTIONS
Definition: x400_att.h:1571
#define X400_N_NON_DELIVERY_REASON
Definition: x400_att.h:1039
X400 MA/MS (P3/P7) Interface.
int X400ORandDLGetStrParam(struct X400ORandDL *or_and_dl, int paramtype, char *buffer, size_t buflen, size_t *paramlenp)
Get string parameter from ACP127 Response object.
#define X400_N_PRIORITY
Definition: x400_att.h:419
#define X400_E_MISSING_ATTR
Definition: x400_att.h:88
int X400msTraceInfoGet(struct X400msMessage *mp, int entry, struct X400TraceInfo **info, int type)
Get a Trace Info object for a message object.
int X400msSetIntDefault(struct X400msSession *sp, int paramtype, int value)
Set a default integer parameter value in a session.
#define X400_S_DSI_AA_CEIT
Definition: x400_att.h:493
AMHS Symbolic Constants.
#define X400_TRACE_INFO
Definition: x400_att.h:1322
#define X400_S_MTA_NAME
Definition: x400_att.h:1550
#define X400_N_ALTERNATE_RECIPIENT_ALLOWED
Definition: x400_att.h:430
#define X400_S_SUBJECT
Definition: x400_att.h:719
int X400msWait(struct X400msSession *sp, int seconds, int *count)
Wait for messages to be ready to be read.
#define X400_RECIP_ENVELOPE
Definition: x400_att.h:332
#define X400_S_DSI_ATTEMPTED_DOMAIN
Definition: x400_att.h:487
#define X400_N_NON_DELIVERY_DIAGNOSTIC
Definition: x400_att.h:1042
#define X400_S_MTA_SI_CEIT
Definition: x400_att.h:1568
#define X400_N_REDIRECTION_REASON
Definition: x400_att.h:505
#define X400_S_DSI_AA_DEF_TIME
Definition: x400_att.h:490
#define X400_N_CONTENT_RETURN_REQUEST
Definition: x400_att.h:433
int X400RediHistGetIntParam(struct X400RediHist *info, int paramtype, int *valuep)
Get int parameter from Redirection History object.
#define X400_MTA_SI_OTHER_ACTION_REDIRECTED
Definition: x400_att.h:1589
int X400msRediHistGetEnv(struct X400msMessage *msg, int entry, struct X400RediHist **hist)
Get the Redirection History object from a message envelope this is represented by 8...
#define X400_N_DSI_ROUTING_ACTION
Definition: x400_att.h:484
int X400msAutoActionParameterAddIntParam(struct X400msAutoActionParameter *aap, int paramtype, int value)
Add integer-valued parameter to the autoaction parameter.
#define X400_RECIP_REPORT
Definition: x400_att.h:311
int X400msMsgDelete(struct X400msMessage *mp, int retain)
Delete message object.
#define X400_S_MESSAGE_DELIVERY_TIME
Definition: x400_att.h:439