除了啟用記錄時始終提供的基本資訊之外,您還可以透過設定 MTA 選項檔案中的各種 LOG_* MTA 選項來指定要包含的附加、選擇性資訊欄位。透過 IMTA 調校檔案 (msg-svr-base/config/imta_tailor) 中的 IMTA_OPTION_FILE 選項指定的檔案,將會指定 MTA 選項檔案。依預設,此為 msg-svr-base/config/option.dat 檔案。
如需有關 MTA 選項檔案的完整詳細資訊,請參閱「Sun Java System Messaging Server 6.3 Administration Reference」中的「Option File」。
本節包含以下小節:
編輯 MTA 選項檔案。
將 LOG_MESSAGES_SYSLOG 選項設定為 1。
值 0 會停用系統記錄通知的產生。非零值會啟用系統記錄通知的產生,其中的絕對值會控制系統記錄的優先權和功能遮罩。正值表示系統記錄通知和一般 mail.log* 項目;負值 (不建議) 表示只有系統記錄通知,而停用一般 mail.log* 項目。預設值為 0,表示不執行系統記錄 (事件記錄) 記錄。
編輯 MTA option.dat 檔案。
設定 LOG_FORMAT 選項。
1 (預設值) 標準格式。
2 請求非 null 格式化:空白位址欄位將轉換為字串「<>」。
3 請求計數格式化:所有可變長度欄位前要有 N,此為欄位中字元數的計數。
4 導致記錄項目以 XML 相容的格式寫入記錄項目顯示為包含多個屬性和零個子元素的單一 XML 元素。目前定義有三個元素,en 表示排入佇列/移出佇列項目,co 表示連線項目,而 he 表示標頭項目。
排入佇列/移出佇列 (en) 元素可有以下屬性:
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) |
以下是 en 項目範例:
<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"/> |
請注意,此項目為了清楚起見已經換行:實際記錄項目一律會以單行顯示。
連線 (co) 項目可有以下屬性:
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) |
以下是 co 項目範例:
<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"/> |
標頭 (he) 項目有以下屬性:
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) |
以下是 he 項目範例:
<he ts="2004-12-08T00:38:31.41" pi="1074b3.61.281" va="Subject: foo"/> |
編輯 MTA 選項檔案。
此選項記錄郵件在佇列中已花費的時間量。佇列時間會以秒為單位的整數值加以記錄,並緊跟在非 XML 格式記錄中的應用程式資訊字串之後顯示。此值在 XML 格式記錄中的屬性名稱為 qt。
編輯 MTA 選項檔案。
此選項可使 MTA 記錄 TCP/IP 連線以及郵件通訊。依預設,連線記錄項目被寫入 mail.log* 檔案。(可選擇) 還可以將連線記錄項目寫入 connection.log* 檔案。請參閱 SEPARATE_CONNECTION_LOG 選項,以取得更多資訊。
編輯 MTA 選項檔案。
將 SEPARATE_CONNECTION_LOG 選項設定為 1。
使用此選項以指定將連線記錄項目改為寫入 connection.log 檔案。預設值為 0 將導致連線記錄被儲存在 MTA 記錄檔中。