Purpose

The Open Source Software Razor is a distributed, collaborative, spam detection and filtering network. Razor establishes a distributed and constantly catalogue of spam. The catalogue is feeded with spam mails from users. If the server gets the same spam mail often from different users the mail is listet as spam. SpamAssassin can use Razor2 to detect spam. SpamAssassin consult the Razor Server to find out if a message is listet as spam and gives spam scores if listet.
This artikel describes the installation of Razor2 and integration into SpamAssassin.

 
Solution


Installation of Razor2

Razor can be downloaded from http://razor.sourceforge.net. There are two archives:

razor-agents the Razor programm
razor-agents-sdk Perl modules which are needed by Razor


Download both archives and unpack in different directorys. Change in the directory of razor and start the installation with following commands:

perl Makefile.PL
make
make install

The librarys of Razor are installed within the perl directory on your system..
Use perl -V:prefix to see your perl installation path use :
Output: prefix='/usr/'; (following called as PREFIX)
So perl is installed in the directory /usr/lib/perl5 or also called PREFIX/lib/perl5

If Perl modules are missing you get a message. You can install those modules with the razor-agents.sdk .
(Change in the directory where you uncompressed the archive an install with perl Makefile, make, make install...)
Alternatively you can download the Perl modules from www.cpan.org.

Following file is installed /usr/lib/razor-client .
You need to start razor-client. Following systemlinks are installed:

/usr/lib/razor-admin for configuration of Razor
/usr/lib/razor-check checkt the Razor server if message is spam
/usr/lib/razor-report reported message to Razor server as spam
/usr/lib/razor-revoke removed spam message from Razor server


With razor-admin ?create xou can create the razor-agent.conf file in Razor homedirectory .
The default homedirectory is /home/~user~/.razor. (user correspond to the username)

With razor-admin ?create ?home=/etc/razor you can create a homedirectory in /etc/razor.
Following files are installed in homedirectory:

razor-agent.conf configuration file of Razor
server.joy.cloudmark.com
servers.catalogue.lst list with Razor catalouge server
servers.catalogue.lst list with Razor discovery server
servers.nomination.lst list with Razor nomination server


It is recommended to move the razor-agent.conf file in the directory /etc/razor so Spamassassin can use it. Razor is automatic looking for a configuration file in this directory.

With razor-check ?d mbox you can ask the Razor server if a message is spam. (-d debug, mbox correspond to the mailbox)

Integration in SpamAssassin
Following entry is needed in SpamAssassins configuration file local.cf to use Razor with SA.

entry in local.cf


# use of Razor ? yes=1 no=0
use_razor2 1

# path to Razor configuration file
razor_config /etc/razor/razor-agent.conf



A connection to Razor server on the internet is made on TCP port 7 and TCP port 2703. You may need to configure your firewall to open this ports for outgoing traffic.
You need to restart the SpamAssassin daemon to load the new configuration.

If you want to report spam messages to Razor server you need to create a account with username and password:

razor-admin ?register ?user=username ?pass=password

Two files are installed in Razor homedirectory:

@identity
identity-username


This files contain the username and password.

With razor-report ?d mbox you can report a spam message to Razor server.
(-d debug, mbox correspond to the mailbox)

With razor-revoke ?d mbox you can remove a spam message from Razor server
(-d debug, mbox entspricht der jeweilige Mailbox)

For only use with SpamAssassin it is not necessary to create a account on Razor server.