X.400 Gateway Tcl API examples

Application Features

These examples show how to do the following using the Tcl API

  • Submit X.400 messages
  • Submit delivery reports
  • Submit IPNs
  • Retrieve X.400 messages
  • Retrieve delivery reports
  • Retrieve IPNs

Note that the examples used in this text will work with the values configured by the quickconfig program. However you must configure 3 variables. So If your quickconfig configuration was running on "hay.isode.net" using a country code of "GB" you should set the following:

  • hostname - "hay"
  • domainname - "isode.net"
  • country - "GB"

Configuring the Applications

You can set the default values in the session object in the same way as the C API. For example:

      
$c priority 94
$m original_encoded_information_types ia5-text

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

These examples show how to submit X.400 messages, delivery reports and IPNs using the MHS Tcl API

In order to use them, you have to configure at least the variables found at the beginning of the scripts (between Start configuration and End configuration).

Some of the values set are optional, but appear in the example to show you how they are set.

Transfer via the MTA's gateway channel

Run these scripts under a user that has authorization to run MTA programs (i.e. root or pp under Unix, or Administrator under Windows).

  • x400_mt_send_message.tcl - Transfers a simple text message into the MTA, to one or more addresses
  • x400_mt_rcv_message.tcl - Receives one (or all) messages that are waiting for transfer-out on the MTA's gateway channel, and shows the content on the screen. It can deal with simple text messages, delivery reports and IPNs.
  • x400_mt_send_pos_dr.tcl - Transfers-in a a Positive Delivery Report to an address
  • x400_mt_send_neg_dr.tcl - Transfers-in a Negative Delivery Report to an address

Correlation of messages, delivery reports and IPNs

When a message is submitted via the Message Store API the MTA assigns it a message identifier. This value is then returned by the API in the message_identifier attribute of the message object.

When a report is generated by the destination MTA, the value of the original message identifier is set in the subject_identifier of the delivery report, allowing you to correlate the original message with the report.

When the recipient's X.400 user agent reads the message, an IPN should be created, with the message_identifier field set to the message_identifier of the original message. Please note that the Tcl API example x400_ms_rcv_message.tcl does not generate an IPN when it reads a message.

When a message is transfered-in via the MT API, the message identifier is set by the API user.

When a report is generated by the MT API user, the value of the original message identifier has to be set in the subject_identifier of the delivery report, allowing the recipient to correlate the original message with the report.

Copyright © 2008 Isode privacy   feedback Subscribe to our rss newsfeed