Sun Java System Messaging Server 6.3 Administration Guide

25.3.3 Specifying Additional MTA Logging Options

In addition to the basic information always provided when logging is enabled, you can specify that additional, optional information fields be included by setting various LOG_* MTA options in the MTA Option file. The file specified with the IMTA_OPTION_FILE option in the IMTA tailor file (msg-svr-base/config/imta_tailor) specifies the MTA Option file. By default, this is the msg-svr-base/config/option.dat file.

For complete details about the MTA Option file, see the Option File in Sun Java System Messaging Server 6.3 Administration Reference.

This section consists of the following subsections:

ProcedureTo Send MTA Logs to syslog

  1. Edit the MTA Option file.

  2. Set the LOG_MESSAGES_SYSLOG option to 1.

    A value of 0 disables generation of the syslog notices. A non-zero value enables generation of the syslog notices, with the absolute value controlling the syslog priority and facility mask. (Positive values mean syslog notices and the regular mail.log* entries; negative values, which are not recommended, mean syslog notices only, disabling the regular mail.log* entries. A value of 0 is the default and indicates that syslog (event log) logging is not performed.

ProcedureTo Control Formatting of Log Entries

  1. Edit the MTA option.dat file.

  2. Set the LOG_FORMAT option.

    • 1 (default) the standard format.

    • 2 requests non-null formatting: empty address fields are converted to the string “<>.”

    • 3 requests counted formatting: all variable length fields are preceded by N, where N is a count of the number of characters in the field.

    • 4 causes log entries to be written in an XML-compatible format. Entry log entry appears as a single XML element containing multiple attributes and no sub-elements. Three elements are currently defined, en for enqueue/dequeue entries, co for connection entries, and he for header entries.

      Enqueue/dequeue (en) elements can have the following attributes:


      ts - time stamp (always present)
      no - node name (present if LOG_NODE=1)
      pi - process id (present if LOG_PROCESS=1)
      sc - source channel (always present)
      dc - destination channel (always present)
      ac - action (always present)
      sz - size (always present)
      so - source address (always present)
      od - original destination address (always present)
      de - destination address (always present)
      rf - recipient flags (present if LOG_NOTARY=1)
      fi - filename (present if LOG_FILENAME=1)
      ei - envelope id (present if LOG_ENVELOPE_ID=1)
      mi - message id (present if LOG_MESSAGE_ID=1)
      us - username (present if LOG_USERNAME=1)
      ss - source system (present if bit 0 of LOG_CONNECTION
           is set and source system information is available)
      se - sensitivity (present if LOG_SENSITIVITY=1)
      pr - priority (present if LOG_PRIORITY=1)
      in - intermediate address (present if LOG_INTERMEDIATE=1)
      ia - initial address (present if bit 0 of LOG_INTERMEDIATE
           is set and intermediate address information is available)
      fl - filter (present if LOG_FILTER=1 and filter information
           is available)     
      re - reason (present if LOG_REASON=1 and reason string is set)
      di - diagnostic (present if diagnostic info available)
      tr - transport information (present if bit 5 of LOG_CONNECTION
           is set and transport information is available)
      ap - application information (present if bit 6 of LOG_CONNECTION
           is set and application information is available)
      qt - the amount of time a message has spent in the queue (LOG_QUEUE_TIME=1)

      Here is a sample en entry:


      <en ts="2004-12-08T00:40:26.70" pi="0d3730.10.43" sc="tcp_local"
      dc="l" ac="E" sz="12" so="info-E8944AE8D033CB92C2241E@whittlesong.com"
      od="rfc822;ned+2Bcharsets@mauve.sun.com"
      de="ned+charsets@mauve.sun.com" rf="22"
      fi="/path/ZZ01LI4XPX0DTM00IKA8.00" ei="01LI4XPQR2EU00IKA8@mauve.sun.com"
      mi="<11a3b401c4dd01$7c1c1ee0$1906fad0@elara>" us=""
      ss="elara.whittlesong.com ([208.250.6.25])"
      in="ned+charsets@mauve.sun.com" ia="ietf-charsets@innosoft.com"
      fl="spamfilter1:rvLiXh158xWdQKa9iJ0d7Q==, addheader, keep"/>

      Note that this entry has been wrapped for clarity; actual log file entries always appear on a single line.

      Connection (co) entries can have the following attributes:


      ts - time stamp (always present, also used in en entries)
      no - node name (present if LOG_NODE=1, also used in en entries)
      pi - process id (present if LOG_PROCESS=1, also used in en entries)
      sc - source channel (always present, also used in en entries)
      dr - direction (always present)
      ac - action (always present, also used in en entries)
      tr - transport information (always present, also used in en entries)
      ap - application information (always present, also used in en entries)
      mi - message id (present only if message id info available,
           also used in en entries)
      us - username (present only if username information available, also
           used in en entries)
      di - diagnostic (present only if diagnostic information available,
           also used in en entries)
      ct - the amount of time a message has spent in the queue (LOG_QUEUE_TIME=1, 
      also used in en entries)

      Here is a sample co entry:


      <co ts="2004-12-08T00:38:28.41" pi="1074b3.61.281" sc="tcp_local" dr="+"
      ac="O" tr="TCP|209.55.107.55|25|209.55.107.104|33469" ap="SMTP"/>

      Header (he) entries have the following attributes:


      ts - time stamp (always present, also used in en entries)
      no - node name (present if LOG_NODE=1, also used in en entries)
      pi - process id (present if LOG_PROCESS=1, also used in en entries)
      va - header line value (always present)

      Here is a sample he entry:


      <he ts="2004-12-08T00:38:31.41" pi="1074b3.61.281" va="Subject: foo"/>

ProcedureTo Correlate Log Message Entries

  1. Edit the MTA Option file.

  2. Set the LOG_MESSAGE_ID option to 1.

    A value of 0 is the default and indicates that message IDs are not saved in the mail.log file.

ProcedureTo Log Amount of Time Messages Have Spent in the Queue

  1. Edit the MTA Option file.

  2. Set the LOG_QUEUE_TIME option to 1.

    This option logs the amount of time a message has spent in the queue. The queue time is logged as an integer value in seconds. It appears immediately after the application information string in non-XML format logs. The attribute name in XML formatted logs for this value is qt.

ProcedureTo Identify Message Delivery Retries

  1. Edit the MTA Option file.

  2. Set the LOG_FILENAME option to 1.

    This option makes it easier to immediately spot how many times the delivery of a particular message file has been retried. This option can also be useful in understanding when the MTA does or does not split a message to multiple recipients into separate message file copies on disk.

ProcedureTo Log TCP/IP Connections

  1. Edit the MTA Option file.

  2. Set the LOG_CONNECTION option.

    This option causes the MTA to log TCP/IP connections, as well as message traffic. The connection log entries are written to the mail.log* files by default. Optionally, the connection log entries can be written to connection.log* files. See the SEPARATE_CONNECTION_LOG option for more information.

ProcedureTo Write Entries to the connection.log File

  1. Edit the MTA Option file.

  2. Set the SEPARATE_CONNECTION_LOG option to 1.

    Use this option to specify that connection log entries instead be written to connection.log files. The default value of 0 causes the connection logging to be stored in the MTA log files.

ProcedureTo Correlate Log Messages by Process ID

  1. Edit the MTA Option file.

  2. Set the LOG_PROCESS option.

    When used in conjunction with LOG_CONNECTION, this option enables correlation by process ID of which connection entries correspond to which message entries.

ProcedureTo Save User Names Associated with a Process That Enqueues Mail to the mail.log File

  1. Edit the MTA Option file.

  2. Set the LOG_USERNAME option.

    This option controls whether or not the user name associated with a process that enqueues mail is saved in the mail.log file. For SMTP submissions where SASL (SMTP AUTH) is used, the user name field will be the authenticated user name (prefixed with an asterisk character).