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

mtaDebug()

Enable generation of MTA SDK diagnostic output.

Syntax

int mtaDebug(int item_code, ...);

Arguments

Arguments  

Description  

item_code

An optional list of item codes. The list must be terminated with an integer argument with value 0.

Description

Many of the low-level MTA subroutine libraries can produce diagnostic output as can the MTA SDK itself. This output, when enabled, is directed to stdout. When a channel program is run by the Job Controller, stdout is directed to the channel’s debug log file. Use this diagnostic output when developing programs.


Note –

mtaDebug() may also be used in production programs; however, caution should be used, as it can be quite verbose and voluminous, thereby degrading performance and consuming disk space.


As described in the following table, item codes are used to select specific types of diagnostic output.

Item Codes  

Additional Arguments  

Description  

MTA_DEBUG_DECODE

None 

Enable diagnostic output from the low-level MIME decoding routines. This might be helpful when trying to understand MIME conversions that occur either when enqueuing messages (and the destination channel is configured to invoke MIME conversions, for example, marked with channel keywords such a thurman or inner), or when using mtaDecodeMessage.()

MTA_DEBUG_DEQUEUE

None 

Enable diagnostic output from low-level queue processing routines. Use this when trying to understand issues around reading and processing of queued message files. This will not help diagnose the selection of queued messages, which is handled by the Job Controller. 

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

MTA_DEBUG_ENQUEUE

None 

Enables output from low-level message enqueue routines. 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. 

Enabling this diagnostic output is the equivalent of setting MM_DEBUG=5 in the option.dat file.

MTA_DEBUG_MM

size_t level

Enable diagnostic output from the low-level message enqueue routines. The item code must be followed by one additional call argument: the debug level to use. The value of level ranges from 0 to 20. 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.

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

MTA_DEBUG_OS

None 

Enable diagnostic output from the low-level operating system dependent routines. This output is helpful when diagnosing problems associated with creating, opening, writing, or reading files. This typically happens when attempting to enqueue messages, which requires permissions to create and write messages in the MTA queues. 

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

MTA_DEBUG_SDK

None 

Enable diagnostic output for the MTA SDK. When this 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 0. For further information on item lists, see Item Codes and Item Lists.

Return Values

Return Values  

Description  

0

Successful, normal completion. 

MTA_BADARGS

A NULL value was supplied for a pointer to an item list array. 

MTA_FOPEN

Unable to initialize the MTA SDK. Unable to read one or more configuration files. For further information, issue the following command: 

imsimta test -rewrite

MTA_NO

Unable to initialize the MTA SDK. For further information issue the following command: 

imsimta test -rewrite

MTA_NOSUCHITEM

An invalid item code was specified. 

Example

mtaDebug(MTA_DEBUG_SDK, MTA_MM_DEBUG, 8, 0);