Cloudmark Authorityのインストール方法
ダウンロード
まずこちらのページにアクセスしてください。
http://www.cloudmark.com/ja/serviceproviders/authority-spamassassin.html
「試用版のダウンロード」をクリックし、必要事項を入力します。
MTAのOSプラットホームを選択します。
例)
RHEL i386 の場合は Linux 32-bit
RHEL x86_64 の場合は Linux 64-bit
項目全ての入力/選択を済ませたら「ダウンロード」ボタンをクリックします。
移動したページに
ご指定のアドレスにダウンロード手順を説明した電子メールが送信されました。
と表示されていれば OK です。
暫くすると上記で入力したEmailアドレス宛にダウンロード用URLを記述したE-Mailが届きます。
E-Mailに記述されたダウンロード用URLをクリックしてソフトウェアをダウンロードします。
動作環境の確認
ダウンロードしたファイルをインストール先のマシンにコピーし、インストール先のマシンにloginして下さい。root権限が必要です。perl バージョン 5.8 またはそれ以降がインストールされている事を確認してください。
rpmコマンドでの確認
bash# rpm -q perl
perl-5.8.8-18.el5_3.1
bash#
perlでの確認
bash# perl --version
This is perl, v5.8.8 built for
以下略
bash#
SpamAssassin version 3 以降がインストールされている事を確認します。
rpmコマンドでの確認
bash# rpm -q spamassassin
spamassassin-3.2.5-1.el5
bash#
perlでの確認
bash# perl -e 'use Mail::SpamAssassin; printf STDOUT "%s\n",Mail::SpamAssassin->Version;'
3.2.5
bash#
perlモジュール Params::Validate がインストールされているかどうか確認し、インストールされていない場合はインストールします。
bash# perl -e 'use Params::Validate;'
Can't locate Params/Validate.pm in @INC (@INC contains: .... 以下略
(インストールされていない場合はエラーが表示される)
bash# echo $?
2 (インストールされていない場合は exit status は 0 以外)
bash# perl -MCPAN -e shell
cpan> install Params::Validate
cpan> exit
bash# perl -e 'use Params::Validate;'
(インストールされている場合は何も表示されない)
bash# echo $?
0 (インストールされている場合は exit status は 0)
bash#
インストール
Cloudmark Authority for SpamAssassin をインストールします。
デフォルトディレクトリ /etc/mail/spamassassin にインストールする場合
bash# mkdir /var/tmp/Cloudmark
bash# cd /var/tmp/Cloudmark
bash# tar xpfz /..../authority-spamassassin-linux32.tar.gz (手順 5 でコピーしたファイルを指定)
bash# ./setup.sh
Initial Setup of Cloudmark Authority for SpamAssassin Software
o Please read the README file first.
o The target directory should be /etc/mail/spamassassin -- but your SA system
directory may be different.
o This script untars Cloudmark software into the target directory, makes
symlinks, and installs the license file.
Note: full path is required for target directory.
Enter target directory [/etc/mail/spamassassin]:
(ここで [CR] を入力)
expr: warning: unportable BRE: `^/': using `^' as the first character (この警告は無視して下さい)
of the basic regular expression is not portable; it is being ignored (この警告は無視して下さい)
Target directory is /etc/mail/spamassassin
Initial setup done.
Now cd to:
cd /etc/mail/spamassassin/cmae
and follow the instructions in the INSTALL file, beginning with Step #4.
bash# cd /etc/mail/spamassassin/cmae
bash# ./install.pl $PWD/SpamDNA.tar.gz
Spamassassin plugin integration installation
Checking the prerequisites
OK.
Installing the CMAE spamassassin plugin
OK. CMAE.pm copied to /usr/lib/perl5/vendor_perl/5.8.8/Mail/SpamAssassin/Plugin/CMAE.pm.
Performing cartridge installation.
OK. SpamDNA cartridge installed correctly.
Installing the CMAE-Client perl package
Client.c: In function 'XS_Cloudmark__CMAE__Client__constant': (この警告は無視して下さい)
Client.c:492: warning: 'RETVAL' may be used uninitialized in this function (この警告は無視して下さい)
OK. Cloudmark-CMAE-Client-2.0000329 installed correctly at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Cloudmark/CMAE/Client.pm
Writing the configuration file to /etc/sa_cmae_plugin.cfg
OK. /etc/sa_cmae_plugin.cfg written.
Add this to your LD_LIBRARY_PATH (see INSTALL file)
/etc/mail/spamassassin/CMAE-SA/cloudmark/lib:/etc/mail/spamassassin/CMAE-SA/cloudmark/syslib
See the INSTALL file for instructions on configuring SpamAssassin.
bash# echo '/etc/mail/spamassassin/CMAE-SA/cloudmark/lib' > /etc/ld.so.conf.d/cloudmark.conf
bash# /sbin/ldconfig
bash#
デフォルトディレクトリ /etc/mail/spamassassin 以外にインストールする場合
bash# mkdir /usr/local/Cloudmark (インストール先ディレクトリを作成)
bash# mkdir /var/tmp/Cloudmark (作業用ディレクトリを作成)
bash# cd /var/tmp/Cloudmark (作業用ディレクトリへ移動)
bash# tar xpfz /..../authority-spamassassin-linux32.tar.gz (手順 5 でコピーしたファイルを指定)
bash# ./setup.sh
Initial Setup of Cloudmark Authority for SpamAssassin Software
o Please read the README file first.
o The target directory should be /etc/mail/spamassassin -- but your SA system
directory may be different.
o This script untars Cloudmark software into the target directory, makes
symlinks, and installs the license file.
Note: full path is required for target directory.
Enter target directory [/etc/mail/spamassassin]:
/usr/local/Cloudmark
expr: warning: unportable BRE: `^/': using `^' as the first character
of the basic regular expression is not portable; it is being ignored
Target directory is /usr/local/Cloudmark
Initial setup done.
Now cd to:
cd /usr/local/Cloudmark/cmae
and follow the instructions in the INSTALL file, beginning with Step #4.
bash# ./install.pl $PWD/SpamDNA.tar.gz
Spamassassin plugin integration installation
Checking the prerequisites
OK.
Installing the CMAE spamassassin plugin
OK. CMAE.pm copied to /usr/lib/perl5/vendor_perl/5.8.8/Mail/SpamAssassin/Plugin/CMAE.pm.
Performing cartridge installation.
OK. SpamDNA cartridge installed correctly.
Installing the CMAE-Client perl package
Client.c: In function 'XS_Cloudmark__CMAE__Client__constant': (この警告は無視して下さい)
Client.c:492: warning: 'RETVAL' may be used uninitialized in this function (この警告は無視して下さい)
OK. Cloudmark-CMAE-Client-2.0000329 installed correctly at /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Cloudmark/CMAE/Client.pm
Writing the configuration file to /etc/sa_cmae_plugin.cfg
OK. /etc/sa_cmae_plugin.cfg written.
Add this to your LD_LIBRARY_PATH (see INSTALL file)
/usr/local/Cloudmark/CMAE-SA/cloudmark/lib:/usr/local/Cloudmark/CMAE-SA/cloudmark/syslib
See the INSTALL file for instructions on configuring SpamAssassin.
bash# echo '/usr/local/Cloudmark/CMAE-SA/cloudmark/lib' > /etc/ld.so.conf.d/cloudmark.conf
bash# /sbin/ldconfig
bash#
SpamAssassinの設定
SpamAssassin が Cloudmark Plug-in を実行する様に設定します。
init.pre の設定
/etc/mail/spamassassin/init.pre に以下の内容を追加します。
###########################################################
# CMAE - Cloudmark Authority Plug-in for SpamAssassin
###########################################################
loadplugin Mail::SpamAssassin::Plugin::CMAE
local.cf の設定
/etc/mail/spamassassin/local.cf に以下の内容を追加します。
###########################################################
# CMAE - Cloudmark Authority Plug-in for SpamAssassin
###########################################################
ifplugin Mail::SpamAssassin::Plugin::CMAE
full CMAE_1 eval:check_msg()
describe CMAE_1 Cloudmark CMAE detected spam
score CMAE_1 10
endif
Cloudmark Aurhorityの動作確認
CMAEの起動
CMAE サーバを起動します
bash# cd /
デフォルトディレクトリ /etc/mail/spamassassin にインストールした場合
bash# /etc/mail/spamassassin/cmae/cloudmark/bin/cmaed start
Started cmae_server, PID: 12345
bash#
ディレクトリ /usr/local/Cloudmark にインストールした場合
bash# /usr/local/Cloudmark/cmae/cloudmark/bin/cmaed start
Started cmae_server, PID: 12345
bash#
起動は上記の様にフルパス名で指定するか、<インストールディレクトリ>/etc/mail/spamassassinや
/usr/local/Cloudmarkに移動したあと、以下の様に指定します。
bash# cmae/cloudmark/bin/cmaed start
(./cmaed start では正常に起動しません)
ログのチェック
CMAE サーバのログファイルは<インストールディレクトリ>/cmae/cloudmark/log/server.logです。
デフォルトディレクトリ /etc/mail/spamassassin にインストールした場合
/etc/mail/spamassassin/cmae/cloudmark/log/server.log
ディレクトリ /usr/local/Cloudmark にインストールした場合
/usr/local/Cloudmark/cmae/cloudmark/log/server.log
ログファイル中のライセンス情報を確認します。
bash# grep Licen /usr/local/Cloudmark/cmae/cloudmark/log/server.log
cmae_server: [INFO] MICROUPDATE: License setting: authorized microupdate types: comprehensive.4,sp.4,comprehensive_sender_rep.4,sp_sender_rep.4
cmae_server: [INFO] MICROUPDATE: License setting: expiration date: 2009-05-12 15:30:13
cmae_server: [INFO] MICROUPDATE: License setting: maximum number of sessions: 2
cmae_server: [INFO] MICROUPDATE: Licensing OK (session #41669360)
bash#
Licensing OK という行が有る事を確認します。
テストスクリプトの実行
初めて CMAE サーバを起動した直後は SPAM チェックに必要なfingerprint-file のダウンロードに 5 分程度要します。このため CMAE サーバ起動後 5 分程度以上経過してからテストスクリプトを実行してください。
テストスクリプトの実行
bash# cd /usr/local/Cloudmark/cmae
bash# ./cmcheck.sh -c < gtube
spam
bash#
この様に spam と表示されれば CMAE サーバは正常に動作しています。
legit と表示された場合は CMAE サーバに異常があります。
spamassassin でのテスト
spamassassin コマンドでのテストを実行します。
bash# sh -c 'spamassassin -D < gtube 2>&1 | grep CMAE'
[11669] dbg: plugin: loading Mail::SpamAssassin::Plugin::CMAE from @INC
[11669] dbg: generic: CMAE SpamAssassin 1.2.0.14 started up.
[11669] dbg: rules: ran eval rule CMAE_1 ======> got hit (100)
[11669] dbg: check: tests=AWL,CMAE_1,GTUBE,MISSING_DATE,MISSING_MID,NO_RECEIVED,NO_RELAYS
X-Spam-Status: Yes, score=1008.3 required=5.0 tests=AWL,CMAE_1,GTUBE,
* 10 CMAE_1 Cloudmark CMAE detected spam
bash#
この様に
* 10 CMAE_1 Cloudmark CMAE detected spam
が表示されれば正常に動作しています。
spamd, spamcでのテスト
spamd を起動します。
bash# /sbin/service spamassassin start
Starting spamd: [ OK ]
bash#
spamc でのテストを実行します。
bash# spamc < gtube
X-Spam-Flag: YES
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on
mail.answre.jp
X-Spam-Level: **************************************************
X-Spam-Status: Yes, score=1010.0 required=5.0 tests=CMAE_1,GTUBE,MISSING_DATE,
MISSING_MID,NO_RECEIVED,NO_RELAYS autolearn=no version=3.2.5
X-Spam-Report:
* 0.0 MISSING_MID Missing Message-Id: header
* 0.0 MISSING_DATE Missing Date: header
* -0.0 NO_RELAYS Informational: message was not relayed via SMTP
* 1000 GTUBE BODY: Generic Test for Unsolicited Bulk Email
* 10 CMAE_1 Cloudmark CMAE detected spam
* -0.0 NO_RECEIVED Informational: message has no Received headers
From: Emerson_Switchboard@FrugalJoe.com
To: dougm@catalinas.net
Subject: [SPAM] Receive Phone Calls and Faxes While You're Online
X-Spam-Prev-Subject: Receive Phone Calls and Faxes While You're Online
XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X
bash#
この様に
* 10 CMAE_1 Cloudmark CMAE detected spam
が表示されれば正常に動作しています。
以上