●Qmail Scannerのインストール |
Qmail Scannerをインストールするためには,あらかじめリスト1のツールを導入しておく必要がある。ここではQmail本体およびunzipについては,すでにインストールされている前提で解説するが,Qmail Scannerを導入するためには,Qmailにパッチをあてて再コンパイルする必要がある。それについては後述する。
リスト1■Qmail Scannerをインストールするために必要なツール
|
・reformimeのインストール
Qmail Scannerのインストールには,メールフィルタ「MailDrop」からメールの添付ファイルを展開するために「reformime」が必要になる。ここでは「MailDrop」はインストールせず,reformimeのみを「/usr/local/bin」にコピーする。
$ wget http://download.sourceforge.net/courier/maildrop-1.3.7.tar.gz |
・Time::HiResのインストール
次にPerlモジュールの「Time::HiRes」をインストールする。PerlモジュールはCPANから入手できる。
$ wget http://www.cpan.org/modules/by-module/Time/Time-HiRes-01.20.tar.gz $ tar xzvf Time-HiRes-01.20.tar.gz $ cd Time-HiRes-01.20 $ perl Makefile.PL $ make $ make test $ su Password:(パスワードを入力) # make install |
※「# perl -e 'use CPAN; install Time::HiRes'」でもインストールできる
なお,インストールされているPerlのバージョンは「Perl 5.005_03+」以上である必要があるので,あらかじめ「perl -v」コマンドで確認しておこう。
$ perl -v This is perl, v5.6.0 built for i386-linux Copyright 1987-2000, Larry Wall Perl may be copied only under the
terms of either the Artistic License or the Complete documentation for Perl,
including FAQ lists, should be found on |
・TNEFのインストール
引き続き,TNEFをインストールする。
$ wget http://world.std.com/~damned/tnef-1.1.1.tar.gz $ tar xvzf tnef-1.1.1.tar.gz $ cd tnef-1.1.1 $ ./configure $ make $ su Password:(パスワードを入力) # make install |
・Qmailにパッチをあて再コンパイル
最後に,Qmailにqmailqueue-patchをあてて再コンパイルする。事前にQmailを停止してからmake setupを行えばよい。
$ wget http://cr.yp.to/software/qmail-1.03.tar.gz $ tar xvzf qmail-1.03.tar.gz $ wget http://www.qmail.org/qmailqueue-patch $ cd qmail-1.03 $ patch < ../qmailqueue-patch patching file Makefile patching file qmail.c $ su Password:(パスワードを入力) # make setup |
・Qmail Scanner本体のインストール
Qmail Scannerのインストールは,「--install」オプションをつけて行えば,対話形式でのインストールが開始される。ウイルスに感染したメールをスキャンした際に,サーバ名や通知先(root)は自動的に設定される。デフォルト以外のものに,通知する宛先やドメイン名を指定する場合は「--admin」および「--domain」をつけてインストールする。
まず,perlスクリプトをsetuidで実行できるようにするため,下記のように設定を行う。
# chown root /usr/bin/suidperl # chmod 4711 /usr/bin/suidperl |
そして,Qmail Scannerをインストールする。
$ wget http://prdownloads.sourceforge.net/qmail-scanner/qmail-scanner-1.01.tgz $ tar zxvf qmail-scanner-1.01.tgz $ cd qmail-scanner-1.01 $ su Password:(パスワードを入力) # ./configure --install |
※もしくは./configure --admin 管理者アドレス --domain ドメイン名 --install とすればよい。
例:./configure --admin root --domain example.com --install
「--install」オプションにより,以下のように問いに答えながら対話形式でインストールすることが可能だ。
Qmail-Scanner doesn't have language
translations for ja_JP.eucJP, [Hit <RETURN> to continue] ←リターンキーを押す This script will search your system
for the virus scanners it knows It will then generate qmail-scanner-queue.pl
- it is up to you to install it Continue? ([Y]/N) ←「y」を選択 /usr/bin/uudecode works as expected on system... The following binaries and scanners were found on your system: reformime=/usr/local/bin/reformime Content/Virus Scanners installed on your System sweep=/usr/local/bin/sweep Qmail-Scanner details. log-details=0 If that looks correct, I will now
generate qmail-scanner-queue.pl Continue? ([Y]/N) ←「y」を選択 Hit RETURN to create initial directory
structure under /var/spool/qmailscan, |
ここでリターンキーを押すとqmail-scanner-queue.plが「/var/qmail/bin」以下にインストールされる。
perlscanner: generate new DB file Finished installation of initial
directory structure for Qmail-Scanner Finished. Please read README(.html)
and then go over the script "/var/qmail/bin/qmail-scanner-queue.pl
-r" should return some well-known virus That's it! 〜(以下省略)〜 |
・Qmail起動スクリプトの編集
Qmail起動スクリプト(/etc/rc.d/init.d/qmailなど)に,リスト2の部分を追加し編集する。編集が終わったらQmailを再起動する。
リスト2■起動スクリプトに加える部分
|
2/6 |