Isode X.400 OpenGroup X.400 Gateway API - Example Applications

API Specification

The OpenGroup APIs can be seen here. For an overview of the Isode X.400 Gateway APIs, click here.

Note that this implementation of the OpenGroup API does not work over protocol, ie the API is procedural, and must therefore be colocated with the MTA.

Application Features

These examples do the following using the Isode implementation of the OpenGroup X.400 Gateway API

  • transfer X.400 messages into the Gateway from the MTA
  • transfer X.400 messages into the MTA from the Gateway

Full specification of the API is here.

Compatibility with quickconfig

The sample xmt program (ex_trout) will attempt to send a message to a default X.400 OR Address:

/GQ=III/I=MT/G=givenname/S=USER/OU4=gateway/OU3=OU3/OU2=OU2/OU1=OU1/O=BODENSEE/PRMD=AVID/ADMD=ICAO/C=XX/

Use EMMA to ensure that the following section of the OR address exists:

/PRMD=AVID/ADMD=ICAO/C=XX/

Then associate the existing Gateway MTA with that section of the OR address space, again using EMMA

Once done clone the x400mt channel, calling the new channel "xmt"

ex_trout will then be able to connect to the "xmt" channel. Submit a message, which will then be routed to the Gateway MTA. The message will then wait on the "xmt" channel until the ex_tin program picks it up

Compiling the Applications

To build the applications an example Makefile is supplied. On Linux run the command

# cd /opt/isode/share/examples/xmt
# make

For Solaris you will need to edit the Makefile depending on the compiler you are using.

Isode Specific Features of XMT

Although the API is a formally specified API, there are some Isode specific features, which are decribed here.

Arguments to mt_open()

The arguments to mt_open() that are of particular interest to XAPI are:

  • client_name which takes the format: channel/mta_name/password

mta_name and password are optional.

However, if you wish to use a password, you must also specify the associated mta_name, or the queue manager will not know to which MTA the password applies.

If an mta_name is not specified, all messages arriving on the channel are listed for delivery. If an mta_name is specified, only messages specifically addressed to that MTA will be delivered. The definition of legal values for these fields is made in the $(TBLDIR)/auth.qmgr file.

  • client_instance_name,which is ignored.

Queue Manager Interaction

  • If you read messages but decide not to accept delivery of them at that time, they will become unavailable for a time period determined by the queue manager:
  • If you read five messages or more and do not take delivery of them, subsequent messages already queued for delivery will also become unavailable for a period of time. This is because the queue manager is attempting to ensure integrity.

Isode Extensions

The example applications provide two useful extensions.

This function prints the object to the file handle specified. The object can be a public or private object.

void ex_print_obj (FILE *out, OM_object obj, int indent);

This function places the information supplied in its parameters in the descriptor indicated.

void add_descriptor (OM_descriptor *desc, OM_type type,OM_syntax syntax, void *value);

Configuring the Applications

Similarly to the Isode Gateway API, the OpenGroup Gateway API requires a passive channel to be configured. See Connection to the MTA below.

Messages are put in the x400mt channel when recipients for the Gateway O/R address space are routed. Message are transferred from the x400mt of the MTA by a Gateway client binding as a passive channel. Message are transferred from the Gateway to the MTA similarly.

All configuration for each application is in a set of strings at the top of examin.c. Some arguments configure the connection to the MTA (clientname and mtaname), and the rest configure the values used in O/R Addresses of the originator and recipients. O/R address attributes which are configured as zero length strings, will not be added to the O/R address.

Transfer out of the Gateway into the MTA

Connection to the MTA

Gateway applications use a procedural, non-protocol interface to the MTA. This means that the client and MTA must be colocated. The only connection arguments required are

  • channel name
  • MTA name (optional)

The channel name must be the name of a valid Gateway channel (eg x400mt). Ie it requires that

  • the outbound protocol is MTA Gateway
  • the prog value is absent
  • the auth.qmgr table is configured with rights=channel for the channel name (eg x400mt). Optionally a password can also be specified. See Connection to MTA above.

The MTA name acts as a filter so that only messages queued on the Gateway channel for the specified MTA are returned.

Transfer into the Gateway out of the MTA

Connection to the MTA

Gateway applications work in the same way whether they are transferring in or out of the Gateway - an application can do both in the same session. Connecting to the MTA for transfer into the Gateway is identical to that of transferring out (see above).

No configuration of program variables isrequired in order to run the example application which transfers message into the Gateway.

Running the Applications

To run the applications you simply run the executable from the command line. No arguments are required.

Not that the transfer in program transfers in both the message as transfered into the Gateway, and the non-delivery report generated by the MTA.

# cd /opt/isode/share/examples/xmt/trout/
# ./ex_trout
Isode OpenGroup Gateway API Example Application - Transfer Out

Attempting to open session
Session opened successfully

arrival_time is 080229145736+0000
trace built in ex is : 
==================================================
type    = om_class
syntax  = object_identifier_string
value   = MH_C_EXTERNAL_TRACE_ENTRY
<deliberately cut short>

# cd ../trin
# ./ex_trin 

Isode OpenGroup Gateway API Example Application - Transfer In

Attempting to open session
Count is 2
Session opened successfully

available = 1
Attempting transfer in of item  0
==================================================
type    = om_class
syntax  = object_identifier_string|om_s_service_generated
value   = MH_C_REPORT
<deliberately cut short>

Copyright © 2008 Isode privacy   feedback Subscribe to our rss newsfeed