[postfix]
clamavをRPMにてインストールするにはまずyumのリポジトリを追加する必要がある。以下CentOS4での手順。
[yumリポジトリの追加]
[dag]
name=Dag RPM Repository for RHEL4
baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag
enabled=1
gpgcheck=1
[GPGキーのインポート]
[clamavインストール]
[clamdの設定]
# vi /etc/clamd.conf
#TCPSocket 3310
[freshclamの設定]
freshclamとはウィルスの定義ファイルをアップデートするためのコマンドです。
LogVerbose #詳細なログを出力
Check 24 #一日に24回、ウィルス定義を更新
[freshclamをデーモンモードで起動]
※/etc/rc.localに上記コマンドを追加して、システム起動時にfreshclamが立ち上がるようにしてください。
[clamdを起動]
#clamdを起動
[amavisdインストール]
[パッケージをアップデート]
[amavisd設定]
$mydomain = 'ドメイン名'; # a convenient default for other settings
#今回はClamAVをスキャンソフトとして使用するので該当部分のコメントをはずす。またソケット名をclamav.confで指定したLocaksocketに合わせます。
\&ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd.sock"],
qr/\bOK$/, qr/\bFOUND$/,
qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
[amavisd起動]
※amavisdがシステム起動時に立ち上がるかntsysvコマンドなどで確認してください
[ウィルス検出時のメール送信先を設定]
ウィルス検出時はamavisd.confにて指定されたメールアドレスに通知メールが配信されるので、このエイリアスを設定します。
virusalert: root
[エイリアスを再構築]
[postfixの設定]
posfixとamavisdが連携するようにPostfixを設定します。 (/usr/share/doc/amavisd-new-2.3.3/README.postfixを参照)
#最終行へ以下を追加 (ポート番号はamavisd.confにある$inet_socket_portに合わせる)
#以下を最終行へ追加
smtp-amavis unix - - n - 2 smtp
-o smtp_data_done_timeout=1200
-o smtp_send_xforward_command=yes
-o disable_dns_lookups=yes
-o max_use=20
127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks_style=host
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks
あとは実際にeicarファイルを送ってウィルスと判定されるかをチェック。
[参考サイト]
DAG: Apt/Yum RPM repository
smtpd_client_connection_rate_limit - 同一クライアントからの接続制限
smtpd_recipient_limit - 同時配信数の制限
fatal: unsupported dictionary type: sdbm
postfixadmin + mysql + courier-imapによるバーチャルドメイン
postfixadminでメールボックスが作成されない
fatal: execvp script_path: Permission denied
postfix - rblの参照
postfix + spamassassin
postfixでのsmtp auth
postfix + amavis + clamav のインストール(RPM編)
postfix - postalias
postfix - メールのサイズ制限
postfix - 基本設定
postfix - pop before smtp
postfix - MaildirとMailbox形式の切り替え
postfix - dracd.dbのエラー
postfix + amavis + clamのインストール
postfix - キューの削除
postfix - transport
postfix - 逆引きが引けないアドレスからのメールを拒否