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

Enqueue Context

When using a message enqueue context, you must do the following:

  1. Supply the enqueue context along with the MTA_DECODE_NQ item code.

  2. Specification of the message’s recipient list must have already been completed with mtaEnqueueTo() before calling mtaDecodeMessage().

  3. mtaEnqueueFinish() must not yet have been called for the enqueue context.

After the call to mtaDecodeMessage() has completed successfully, complete the message enqueue with mtaEnqueueFinish(). In the event of an error, the message submission should be cancelled with mtaEnqueueFinish(). mtaDecodeMessage() writes the entire message header and content. There is no need for the caller to write anything to the message’s header or content.

Caller-Supplied Output Routine

To use a caller-supplied output routine (for example, decode_write()), supply the address of the output routine along with the MTA_DECODE_PROC item code to mtaDecodeMessage().

Each line passed to the output routine represents a complete line of the message to be output. The output routine must add to the line any line terminators required by the output destination (for example, carriage return, line feed pairs if transmitting over the SMTP protocol, line feed terminators if writing to a UNIX® text file, and so forth).