
「AntiVir MailGate」の設定
※現在、「AntiVir MailGate」は無償では無くなりましたので、
無償のものを利用するのであれば、「Clam AV」 + 「amavisd-new」等を利用することになります。
AntiVir MailGateにより、メールサーバでウィルスメールを駆除するようにします。
「AntiVir MailGate」は非商用利用では無償で利用できます。
まずはここからユーザ登録をします。
情報を入力後、非商用利用ならば一番下の
「Herewith I assure that I use AntiVir for Linux / FreeBSD exclusively for private, non-commercial purposes」
にチェックを入れます。
登録後、登録したメールアドレスにライセンスキーが添付されて送信されます。
FreeBSD版のダウンロードはここから行います。
「AntiVir MailGate」のインストール
まず、ダウンロードしたファイルを展開します。
FreeBSD# tar xzvf antivir-mailgate-prof-2.0.2.tar.gz
|
インストールスクリプトを実行してインストールします。
FreeBSD# cd antivir-mailgate-prof-2.0.2/ <= 展開してできたディレクトリへ移動
FreeBSD# ./avinstall.pl <= インストールスクリプト実行
※使用許諾書が出力されますのでSPACEキーを押して画面を進めます。
ここで色々と聞かれますが、自分は以下のように答えました。
Do you agree the LICENSE [n] y
Shutting down processes...
Enter the path where AntiVir MailGate binaries will be located
(default is: /usr/sbin): 空ENTER
Enter the path where scan engine and virus definition file will be located
(default is: /usr/lib/AntiVir): 空ENTER
The directory /usr/lib/AntiVir doesn't exists.
Shall I create it? [y] 空ENTER
Enter the path where manual pages will be located
(default is: /usr/share/man): 空ENTER
Enter the path to your license file: 空ENTER
An automatic internet updater of AntiVir for UNIX is available.
This is a daemon that will run in the background
and automatically check for updates (internet access is required).
You may also manually check for updates using:
antivir --update
You do not need to install the automatic internet updater in order
to manually check for updates. Please read the README file for more
information on updates and how they can best suit you.
Install the automatic internet updater? [n] y
Installing updater script to /usr/lib/AntiVir
Would you like the automatic updater to start automatically? [y] 空ENTER
Installing new /usr/lib/AntiVir/antivir with version: 6.29.0.2
Installing new /usr/lib/AntiVir/antivir.vdf with version: 6.29.0.1
Skipping avgated update
Skipping avgatefwd update
Installing config file /etc/avmailgate.conf
Found existing /etc/antivir.conf. Skipping.
Installing ignore file for addressfilter /etc/avmailgate.ignore
Installing scan file for addressfilter /etc/avmailgate.scan
Installing warn file /etc/avmailgate.warn
Enter the hosts and/or domains that are local:
(default is: FreeBSD.crimson-snow.net FreeBSD): 空ENTER
Enter the hosts and networks that are allowed to relay:
(default is: 127.0.0.1/8 192.168.0.0/16): 空ENTER
Installing config file /etc/avmailgate.acl
Installing start/stop script for a Redhat System
Would you like AvMailGate to start automatically? [n] y
Installing /usr/share/man/man5/avmailgate.conf.5
Installing /usr/share/man/man8/avmailgate.8
Would you like to enable GUI support?
The GUI allows you to monitor realtime activity, view logs, and configure MailGate. [y] n
AntiVir MailGate is now installed. Please read the installation
description in the directory avmailgate and follow the
instructions in INSTALL.sendmail, INSTALL.qmail,
INSTALL.postfix or INSTALL.exim.
Then start AntiVir MailGate "/usr/lib/AntiVir/avmailgate start".
|
「AntiVir MailGate」の設定
入手したライセンスキーの設定をします。
FreeBSD# mv HBEDV.KEY /usr/lib/AntiVir/hbedv.key <= ライセンスキーを/usr/lib/AntiVir/へ移動
FreeBSD# chown uucp:uucp /usr/lib/AntiVir/hbedv.key <= ライセンスキーの所有者をuucpへ変更
|
サービスポート設定ファイルを編集します。
FreeBSD# vi /etc/services <= 設定ファイルの編集
antivir 10024/tcp #Port for avgated <= 追加(AntiVir MailGateのポート)
smtp-backdoor 10025/tcp #Port for postfix backdoor <= 追加(Postfixのポート)
|
「AntiVir MailGate」の設定ファイルを編集します。
FreeBSD# vi /etc/avmailgate.conf <= 設定ファイルの編集
# ListenAddress 0.0.0.0 port 25
↓
ListenAddress localhost port antivir <= 「AntiVir MailGate」のポート
# ForwardTo SMTP: localhost port 825
↓
ForwardTo SMTP: localhost port smtp-backdoor <= AntiVirからのフォワード先ポート
|
「Postfix」の設定
「master.cf」と「main.cf」の2つのファイルを編集します。
FreeBSD# vi /usr/local/etc/postfix/master.cf <= 「master.cf」の編集
localhost:smtp-backdoor inet n - n - - smtpd -o content_filter= <= 追加
FreeBSD# vi /usr/local/etc/postfix/main.cf <= 「main.cf」の編集
content_filter = smtp:127.0.0.1:10024 <= 追加
|
「AntiVir MailGate」の起動
FreeBSD# /usr/lib/AntiVir/avmailgate start
|
「AntiVir MailGate」の自動起動
FreeBSD起動時に「AntiVir MailGate」も起動するように起動スクリプトをコピーします。
FreeBSD# # cp -p /usr/lib/AntiVir/avmailgate /usr/local/etc/rc.d/avmailgate.sh
|
展開したディレクトリは不要になりますので、削除します。
FreeBSD# rm -rf antivir-mailgate-prof-2.0.2/
|
ウィルス定義ファイルの最新化
FreeBSD# /usr/lib/AntiVir/antivir --update -q
|
ウィルス定義ファイルの最新化と検出したウィルスメールの削除を行うスクリプトの作成
FreeBSD# vi ~/avgate.sh <= スクリプトファイルの新規作成
#!/bin/sh
/usr/lib/AntiVir/antivir --update -q > /var/log/avgate.log
/usr/lib/AntiVir/antivir /var/spool/avmailgate/rejected/ -z -e -del >> /var/log/avgate.log
|
作成したスクリプトに実行権限を与えます。
FreeBSD# chmod 755 avgate.sh
|
作成したスクリプトを毎日4:30に自動実行するようにcronに登録します。
FreeBSD# vi /etc/crontab <= cronの編集
30 04 * * * root /root/avgate.sh <= 追加
|