Sun Java System Messaging Server 6 2005Q4 MTA Developer's Reference

Description

Call the mtaInit() routine to initialize the MTA SDK. As part of the initialization process, the SDK will load the MTA configuration. This loading process will be the typical cause of initialization failures; either there’s an error in a configuration file, a missing but required configuration file, or a configuration file can’t be accessed for reading. To prevent that last error case, ensure that your programs run under a UID that has read access to the MTA configuration files, especially the compiled configuration file produced by the imsimta cnbuild utility.

While there is no benefit to doing so, it is safe to call mtaInit() multiple times, either before or after calling mtaDone(). (To de-initialize the SDK, use mtaDone().)

Although the MTA SDK is self-initializing, the initialization must occur while the process is single-threaded. As such, multi-threaded programs must call mtaInit() and must do so while still single threaded.

When the SDK is initialized, the SDK can be told using an item code whether or not the calling program will be functioning as an interactive utility or not. When being used by an interactive utility, such as a management utility or a user agent, the SDK ensures that accounting files are closed after every operation that records accounting information. This prevents the accounting file from being left open by a single process for long periods of time. To specify that the SDK will be used by an interactive utility, specify the MTA_INTERACTIVE item code. By default, the SDK assumes that it will be run by a channel program or other program that wishes to achieve maximum performance while using the SDK. This corresponds to the MTA_CHANNEL item code. Also, when the SDK self-initializes itself, it assumes MTA_CHANNEL and not MTA_INTERACTIVE. As part of initializing the SDK, a number of diagnostic facilities can be enabled. These are enabled using the MTA_DEBUG_ item codes described in the following table. These diagnostic facilities may also be enabled at any time using the mtaDebug() routine.

Item Code  

Additional Arguments  

Description  

MTA_CHANNEL

None 

Indicate that the SDK is being used by a channel program or other non-interactive program. By default this is the assumed usage. Interactive programs should use the MTA_INTERACTIVE item code.

MTA_DEBUG_DECODE

None 

Enable diagnostic output from the low-level MIME decoding routines used by the MTA SDK. This diagnostic output may prove helpful when attempting to understand any MIME conversions that occur either when enqueuing messages to the MTA and the destination channel is configured to invoke MIME conversions (for example, marked with channel keywords such as thurman or inner), or when using the SDK message decoding routine, mtaDecodeMessage.()

MTA_DEBUG_DEQUEUE

None 

Enable diagnostic output from the low-level queue processing routines used by the MTA SDK. Use this diagnostic output when attempting to understand issues surrounding reading and processing of queued message files. This diagnostic output will not help diagnose the selection of queued messages as that is handled by a separate process: the MTA Job Controller. 

Enabling this diagnostic output is equivalent to setting DEQUEUE_DEBUG=1 in the MTA option file, option.dat.

MTA_DEBUG_ENQUEUE

None 

Enable diagnostic output from the low-level message enqueue routines used by the MTA SDK. Enqueue diagnostics can be used to diagnose the address rewriting process, destination channel selection, header processing, and other types of processing that occurs when a message is enqueued to the MTA. 

Enabling this diagnostic output is equivalent to setting MM_DEBUG=5 in the MTA option file.

MTA_DEBUG_MM

size_t level

Enable diagnostic output from the low-level message enqueue routines used by the MTA SDK. 

This item code must be followed by one additional call argument: the debug level to use. 

The debug level is an integer value in the range 0-20. Enqueue diagnostics may be used to diagnose the address rewriting process, destination channel selection, header processing, and other types of processing that occurs when a message is enqueued to the MTA.

Enabling this diagnostic output is equivalent to setting DEQUEUE_DEBUG=level in the MTA option file.

MTA_DEBUG_OS

None 

Enable diagnostic output from the low-level operating system dependent routines used by the MTA SDK. Use of this diagnostic output is helpful when diagnosing problems associated with creating, opening, writing, or reading files. Such problems typically arise when attempting to enqueue messages to the MTA, a process that requires permissions to create and write messages in the MTA queues. 

Enabling this diagnostic output is equivalent to setting OS_DEBUG=1 in the MTA option file.

MTA_DEBUG_SDK

None 

Enable diagnostic output for the MTA SDK. When this output is enabled, diagnostic information will be output whenever the SDK returns an error result. 

MTA_ITEM_LIST

mta_item_list_t *item_list

Specify a pointer to an item list array. The item list array must be terminated with a final array entry with an item code value of zero. For further information on item list usage, see Item Codes and Item Lists.

MTA_INTERACTIVE

None 

Indicate that the SDK will be used by an interactive program. In an interactive scenario, the SDK manages some of the MTA resources differently than when running as a channel program. For instance, closing the MTA log file after every completed message submission or dequeue operation.