| amavisd.confの$final_bad_header_destinyをD_PASSなどに修正します。
ヘッダーの不具合を検出した際の挙動に、D_BOUNCEを指定していると、「Undeliverable mail, invalid header: improper use of control char」というような標題のメールが戻ってきます。amavisd.confをエディタで開き、変更した後、amavisd-newを再起動します。
返却する
$final_bad_header_destiny = D_BOUNCE;
送信者にも受信者にも知らせず削除する
$final_bad_header_destiny = D_DISCARD;
何もしない設定
$final_bad_header_destiny = D_PASS;
! 不具合の例
Jul 10 02:09:49 sv2 postfix/pickup[55291]: 7AD8D17057: uid=1 from=
Jul 10 02:09:49 sv2 postfix/cleanup[55515]: 7AD8D17057: message-id=<07GcP6xw.1152464989.4817460.hostmaster@test.com>?
Jul 10 02:09:49 sv2 postfix/qmgr[55292]: 7AD8D17057: from=, size=1285, nrcpt=1 (queue active)
Jul 10 02:09:49 sv2 amavis[55371]: (55371-02) ESMTP::10024 /var/amavis/tmp/amavis-20060710T020909-55371: -> SIZE=1285 Received: from mail.daoffice.net ([127.0.0.1]) by localhost (sv2.test.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP for ; Mon, 10 Jul 2006 02:09:49 +0900 (JST)
Jul 10 02:09:49 sv2 amavis[55371]: (55371-02) Checking: pTaOpx0UUfE3 ->
Jul 10 02:09:49 sv2 amavis[55371]: (55371-02) cached 8276326fc1bd4948ad940c6aba8adc33 from (1,1)
Jul 10 02:09:49 sv2 amavis[55371]: (55371-02) p001 1 Content-Type: text/plain, size: 370 B, name:
Jul 10 02:09:49 sv2 amavis[55371]: (55371-02) local delivery: <> -> , mbx=/var/virusmails/badh-pTaOpx0UUfE3
Jul 10 02:09:49 sv2 amavis[55371]: (55371-02) DSN: NOTIFICATION: Action:failed, LOCAL 550 BadHdrChar, ->
Jul 10 02:09:49 sv2 postfix/smtpd[55523]: connect from localhost[127.0.0.1]
Jul 10 02:09:49 sv2 postfix/smtpd[55523]: B3D7917058: client=localhost[127.0.0.1]
Jul 10 02:09:49 sv2 postfix/cleanup[55515]: B3D7917058: message-id=
Jul 10 02:09:49 sv2 postfix/qmgr[55292]: B3D7917058: from=<>, size=4816, nrcpt=1 (queue active)
Jul 10 02:09:49 sv2 postfix/smtpd[55523]: disconnect from localhost[127.0.0.1]
Jul 10 02:09:49 sv2 amavis[55371]: (55371-02) SEND via SMTP: <> -> , 250 2.6.0 Ok, id=55371-02, from MTA([127.0.0.1]:10025): 250 Ok: queued as B3D7917058
Jul 10 02:09:49 sv2 amavis[55371]: (55371-02) Blocked BAD-HEADER, [202.224.215.64] -> , quarantine: badh-pTaOpx0UUfE3, Message-ID: <07GcP6xw.1152464989.4817460.hostmaster@test.com>\\015, mail_id: pTaOpx0UUfE3, Hits: -1.072, 350 ms
Jul 10 02:09:49 sv2 amavis[55371]: (55371-02) TIMING [total 353 ms] - SMTP EHLO: 3 (1%)1, SMTP pre-MAIL: 1 (0%)1, SMTP pre-DATA-flush: 3 (1%)2, SMTP DATA: 98 (28%)30, body_digest: 1 (0%)30, gen_mail_id: 0 (0%)30, mime_decode: 8 (2%)33, get-file-type1: 21 (6%)38, decompose_part: 1 (0%)39, parts_decode: 0 (0%)39, spam-wb-list: 17 (5%)44, update_cache: 1 (0%)44, decide_mail_destiny: 2 (1%)44, write-header: 13 (4%)48, save-to-local-mailbox: 0 (0%)48, prepare-dsn: 41 (12%)60, fwd-connect: 7 (2%)61, fwd-mail-from: 2 (1%)62, fwd-rcpt-to: 3 (1%)63, fwd-data-cmd: 2 (1%)63, write-header: 4 (1%)65, fwd-data-contents: 8 (2%)67, fwd-data-end: 103 (29%)96, fwd-rundown: 2 (1%)97, main_log_entry: 8 (2%)99, update_snmp: 1 (0%)99, unlink-1-files: 2 (1%)100, rundown: 0 (0%)100
Jul 10 02:09:49 sv2 postfix/virtual[55527]: B3D7917058: to=, relay=virtual, delay=0, status=sent (delivered to maildir)
Jul 10 02:09:49 sv2 postfix/smtp[55518]: 7AD8D17057: to=, relay=127.0.0.1[127.0.0.1], delay=0, status=sent (250 2.5.0 Ok, id=55371-02, BOUNCE)
Jul 10 02:09:49 sv2 postfix/qmgr[55292]: B3D7917058: removed
Jul 10 02:09:49 sv2 postfix/qmgr[55292]: 7AD8D17057: removed
! メールの例
The message WAS NOT relayed to:
:
550 5.7.1 Rejected, id=55371-09 - BAD_HEADER: Improper use of control character (char 0D hex): Received: ...aoffice.net@123.123.123.123...
:
550 5.7.1 Rejected, id=55371-09 - BAD_HEADER: Improper use of control character (char 0D hex): Received: ...aoffice.net@123.123.123.123...
This nondelivery report was generated by the program amavisd-new at host
server.test.com. Our internal reference code for your message is
55371-09/DnkZWupvIclY
INVALID HEADER: INVALID CONTROL CHARACTERS IN HEADER
Improper use of control character (char 0D hex): Received:
...aoffice.net@123.123.123.123)\r\n by w...
Improper use of control character (char 0D hex): X-IlohaMail-Blah:
hostmaster@test.com\r\n
Improper use of control character (char 0D hex): X-IlohaMail-Method: mail()
[mem]\r\n
Improper use of control character (char 0D hex): X-IlohaMail-Dummy: moo\r\n
Improper use of control character (char 0D hex): X-Mailer: ...ail/0.8.14
(On: www.iloha.test.com)\r\n
Improper use of control character (char 0D hex): Message-ID:
....1152467335.3526110.hostmaster@test.com>\r\n
Improper use of control character (char 0D hex): From:
\r\n
Improper use of control character (char 0D hex): Bounce-To:
\r\n
Improper use of control character (char 0D hex): Errors-To:
\r\n
Improper use of control character (char 0D hex): CC:
hostmaster@test.com\r\n
Improper use of control character (char 0D hex): MIME-Version: 1.0\r\n
Improper use of control character (char 0D hex): Content-Type: text/plain;
charset="us-ascii"\r\n
Return-Path:
Message-ID: \015
Subject: BAD_HEADER
IMPROPER USE OF CONTROL CHARACTER IN MESSAGE HEADER
The RFC 2822 standard specifies rules for forming internet messages.
It does not allow the use of control characters NUL and bare CR
to be used directly in mail header. |