The IMTA provides facilities for logging each message as it is enqueued and dequeued. All log entries are made to the mail.log_current file in the IMTA log directory, /var/opt/SUNWmail/imta/log/mail.log_current. Logging is controlled on a per-channel basis. The logging keyword activates logging for a particular channel while the nologging keyword disables it. Logging is enabled on all channels by default.
When logging is turned on, the cumulative mail.log file in the IMTA log directory will continue to grow and grow; the IMTA itself never does anything with this log file and it is up to you to periodically write it to backup and delete it, or truncate it, or whatever your site prefers.
The log file is written as normal ASCII text and the format is quite simple. By default, each entry contains eight or nine fields. For example:
19-Jan-1998 19:16:57.64 l tcp_default_router D 1 adam@acme.com marlow@alpha.com smtp:250<marlowe@alpha.com> Recipient ok
The fields are described in TABLE 3-17:
TABLE 3-17 Log File Fields
19-Jan-1998 19:16:57.64
The date and time when the entry was made.
l (lower case "L")
The channel name for the source channel.
tcp_default_router
The channel name of the destination channel. For SMTP channels when LOG_CONNECTION is enabled, a minus sign (-) indicates inbound to the SMTP server, a plus sign (+) indicates outbound via the SMTP client.
D
The type of entry. See TABLE 3-18.
1
The size of the message. This is expressed in kilobytes by default, although this default can be changed by using the BLOCK_SIZE keyword in the IMTA option file.
adam@acme.com
The envelope From: address. Note that for messages with an empty envelope From: address, such as notification messages, this field will be blank.
marlow@alpha.com
The original form of the envelope To: address.
smtp:250<marlow@alpha.com>
The active (current form of the envelope To: address. (SMTP channels during dequeue only).
Recipient ok
The delivery status (SMTP channels only during dequeue).
The logging entry codes are described in TABLE 3-18:
TABLE 3-18 Logging Entry Codes
In addition to the base set of data logged when the logging keyword is used, there are options to cause the log output to include additional details.
In addition to the base set of logging enabled via the logging channel keyword, the IMTA has options that cause additional information to be included in the entries written to the mail.log* files. Note that logging such additional information tends to incur additional overhead.
In particular, setting LOG_MESSAGE_ID=1, LOG_CONNECTION=1, and LOG_FILENAME=1 in your IMTA option file may be of interest on an IMTA e-mail firewall. Logging the message ID makes it easier to find entries in the log file corresponding to a particular message, or to correlate different entries in the log file corresponding to a single message. Logging the SMTP client connection information can be useful to show just what system really sent the message to your IMTA firewall. Logging the filename can be useful if you wish to correlate log file entries with actual message files currently in the IMTA queue area.
Setting LOG_HEADER=1 may be of interest if you wish to save certain message headers to the mail.log* files.
Additionally, setting LOG_PROCESS=1 and LOG_USERNAME=1 on an IMTA firewall system ought generally to result in fairly monotonous extra information being logged: the process id of the process enqueuing a message on an IMTA firewall system would normally be that of an IMTA SMTP server process (for SMTP messages), and the username would normally just be the username of the user who last restarted the IMTA Service Dispatcher. Enable these options if you wish to confirm that the process ids and usernames of processes enqueuing messages are as expected.
Note - It is up to the individual sites whether or not to implement a log cleaning policy. By default, mail.log is never removed; this can potentially fill up your disk space.