| はじめての自宅サーバ構築 - Fedora/CentOS - | Last Update | 2008/07/25 | |
| It opened to 2004/09/19. 当サイトはFedora9で運用しています |
Visitors Pageviews Today(IP/PV) |
3,374,114 12,762,025 1,272/8,647 |
設定前のメールヘッダ情報 Return-Path: <webmaster@kajuhome.com> X-Original-To: linux@kajuhome.com Delivered-To: linux@kajuhome.com 以下の部分に「Received」受信情報詳細が出力されている Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by fedora.kajuhome.com (Postfix) with ESMTP id C681E344A7 for <linux@kajuhome.com>; Thu, 21 Apr 2005 12:54:15 +0900 (JST) Date: Thu, 21 Apr 2005 12:54:16 +0900 From: webmaster@kajuhome.com To: linux@kajuhome.com Subject: ヘッダー情報試験 Message-Id: <20050421125414.CB8C.WEBMASTER@kajuhome.com> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-2022-JP" Content-Transfer-Encoding: 7bit |
postfix設定ファイルの変更
# vi /etc/postfix/main.cf
# The header_checks parameter specifies an optional table with patterns
# that each logical message header is matched against, including
# headers that span multiple physical lines.
#
# By default, these patterns also apply to MIME headers and to the
# headers of attached messages. With older Postfix versions, MIME and
# attached message headers were treated as body text.
#
# For details, see the sample-filter.cf file.
#
コメントを外す
#header_checks = regexp:/etc/postfix/header_checks
↓
header_checks = regexp:/etc/postfix/header_checks
postfixの再起動
# /etc/rc.d/init.d/postfix restart
Shutting down postfix: [ OK ]
Starting postfix: [ OK ]
|
ヘッダチェックファイルの内容確認
# cat /etc/postfix/header_checks
/^Received:/ IGNORE
【構成】
pattern action
「pattern」:正規表現
「action」 :IGNORE (ヘッダー行を消去)
OK (メッセージを許可)
REJECT (メッセージを拒否)
WARN (ログに記録)
DISCARD(正常に受信した様に見せるが、実際には破棄)
FILTER (他のフィルタを評価)
|
postfixの再起動 # /etc/rc.d/init.d/postfix restart Shutting down postfix: [ OK ] Starting postfix: [ OK ] |
設定後のメールヘッダ情報 Return-Path: <webmaster@kajuhome.com> X-Original-To: linux@kajuhome.com Delivered-To: linux@kajuhome.com Date: Thu, 21 Apr 2005 12:58:53 +0900 From: webmaster@kajuhome.com To: linux@kajuhome.com Subject: ヘッダー情報試験 Message-Id: <20050421125851.CB8F.WEBMASTER@kajuhome.com> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-2022-JP" Content-Transfer-Encoding: 7bit 「Received」情報が表示されなくなった。 |
以下が、ローカル情報の「Received」ヘッダ部分になり、この部分が全て通知されなくなります。 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by fedora.kajuhome.com (Postfix) with ESMTP id B6E59280C9 for <linux@kajuhome.com>; Mon, 5 Sep 2005 11:47:33 +0900 (JST) Received: from fedora.kajuhome.com (localhost.localdomain [127.0.0.1]) by localhost.localdomain (AvMailGate-2.0.2-15) id 17272-5C6A0AC7; Mon, 05 Sep 2005 11:47:33 +0900 Received: from [192.168.100.106] (xxxx.xxxx.co.jp [xxx.xxx.xxx.xxx]) ← 接続元のローカル情報(外出先) by fedora.kajuhome.com (Postfix) with ESMTP id 84CB128061 for <linux@kajuhome.com>; Mon, 5 Sep 2005 11:47:33 +0900 (JST) |
ヘッダチェックファイルの編集 # vi /etc/postfix/header_checks /^Received:/ IGNORE /^Subject:\ =?ISO-2022-JP?B?GyRCTCQ+NUJ6OS05cBsoQg==?=.*/ REJECT 上記の不可解な文字は「未承諾広告」という文字をISO-2022-JPのB-encodingした文字です また、日本語文字列のコンバートにはこちらの「MIME エンコード/デコード」をご利用下さい。 postfixの再起動 # /etc/rc.d/init.d/postfix restart Shutting down postfix: [ OK ] Starting postfix: [ OK ] |
Apr 21 15:14:55 fedora postfix/cleanup[3724]: 52530344A7: reject: header Subject: =?ISO-2022-JP?B?GyRCTCQ+NUJ6OS05cBsoQg==?= from smtp21.mail.bbt.yahoo.co.jp[202.93.85.136]; from=<xxxxxxx@yahoo.co.jp> to=<webmaster@kajuhome.com> proto=SMTP helo=<s mtp21.mail.bbt.yahoo.co.jp>: Message content rejected |
Message from yahoo.co.jp. Unable to deliver message to the following address(es). ====================================================================== ※このメールは、Yahoo!メールサーバーより自動的に送信されています。 このメールには返信しないでください。 ====================================================================== 下記のメールアドレス宛のメールが、配送できませんでした。 以下にメールサーバーからのエラーメッセージを記載いたします。 = エラーメッセージ <webmaster@kajuhome.com>: 210.160.33.75 failed after I sent the message. Remote host said: 550 Error: Message content rejected = Original message follows. = 以下、エラーとなったメール本文です Return-Path: <xxxxxxx@yahoo.co.jp> Received: from unknown (HELO ?192.168.1.141?) (xxx.xxx.xxx.xxx with poptime) by smtp21.mail.bbt.yahoo.co.jp with SMTP; 21 Apr 2005 06:14:39 -0000 X-Apparently-From: <xxxxxxx@yahoo.co.jp> Date: Thu, 21 Apr 2005 15:14:41 +0900 From: xxxxxxx <xxxxxxx@yahoo.co.jp> To: webmaster@kajuhome.com Subject: =?ISO-2022-JP?B?GyRCTCQ+NUJ6OS05cBsoQg==?= Message-Id: <20050421151421.CBAB.XXXXXXX@yahoo.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-2022-JP" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.20.04 [ja] 拒否試験 __________________________________ Do You Yahoo!? Upgrade Your Life http://bb.yahoo.co.jp/ |
postfix設定ファイルへ追加 # vi /etc/postfix/main.cf # The header_checks parameter specifies an optional table with patterns # that each logical message header is matched against, including # headers that span multiple physical lines. # # By default, these patterns also apply to MIME headers and to the # headers of attached messages. With older Postfix versions, MIME and # attached message headers were treated as body text. # # For details, see the sample-filter.cf file. # header_checks = regexp:/etc/postfix/header_checks 以下の行を追加する body_checks = regexp:/etc/postfix/body_checks ボディチェックファイルの作成 # vi /etc/postfix/body_checks /name=.*\.scr/ REJECT /name=.*\.exe/ REJECT /name=.*\.pif/ REJECT 上記の場合は「scr」「exe」「pif」拡張子の添付ファイルがある場合、メールの受け取りを拒否します。 チェックファイルを編集した場合は必ずpostfixを再起動してください。設定が有効になりません postfixの再起動 # /etc/rc.d/init.d/postfix restart Shutting down postfix: [ OK ] Starting postfix: [ OK ] |