An Anti-Spam gateway #6: Razor

(NOTE: this is part of the “An Anti-Spam gateway” series)

Vipul’s Razor is a piece of software for accessing a large database of spam messages. By installing it, and configuring SpamAssassin to use it, you can, among SpamAssassin’s other tests, see whether a particular message has been previously reported as spam by other people. You can also report messages yourself.

It’s not a perfect system, but the best way to use SpamAssassin is by combining several methods of checking spam. This is simply one more.

Note: although I have previously said that I won’t be offering different alternatives, as this is a “recipe”, for Razor I’ll make an exception. If you don’t want to use it, simply skip this part and move on to the next.


You’re still here? :) Fine, let’s move on. Go to CPAN’s shell again with the command:
perl -MCPAN -e shell

then type in the following commands, to install some more Perl modules:

install Time::HiRes
install Digest::SHA1
install Test::Simple
install Test::Harness
install Getopt::Long
install File::Copy
install URI::Escape
quit

Again, it’s possible that some are already installed, and it’s also possible that some ask for dependencies; if so, say that, yes, indeed, you know what you’re doing :) and that you really, certainly, indeed, want to install them.

Now, go to http://razor.sourceforge.net/, and download “razor-agents“. Just that one, not the -sdk file. Uncompress it, enter the directory, then:


perl Makefile.PL
make
make install

It’s installed, now. But we have to configure something more, and, first, we need to create an user. Let’s call it “amavis“, since it will be amavisd-new which will be running the show, and, therefore, everything except Postfix itself will run as that user.

So, create a group “amavis” and an user “amavis” with that group as its main group, and /var/amavis as its home directory. Come on, you don’t need help with this one, do you? :)

Then su to that user.

Now, execute the following (as user “amavis):

razor-admin -register

Finally (for SpamAssassin 3.1 or greater) , go back to root and edit the file /etc/mail/spamassassin/v310.pre. Uncomment the following line

#loadplugin Mail::SpamAssassin::Plugin::Razor2

by removing the “#” from the beginning.

There. Next part: MySQL.

Related posts:

  1. An Anti-Spam gateway #5: SpamAssassin
  2. An Anti-Spam gateway #3: Postfix
  3. An Anti-Spam gateway #0: Introduction
  4. An Anti-Spam gateway #2: A note about compiling on Linux
  5. An Anti-Spam gateway #1: Initial stuff

3 Responses to “An Anti-Spam gateway #6: Razor”

  1. Mike says:

    Are there going to be further followups on the anti-spam gateway article? I see you got to #6, but best I can tell there are likely at least two more installments to go…

    Take care,
    Mike

  2. You’re right; I haven’t had the time to write this one lately. I’ll try to finish it soon – next week, hopefully.

  3. Mike says:

    Looking forward to it… =)

Leave a Reply

Notify me of followup comments via e-mail. You can also subscribe without commenting.


Creative Commons Attribution-NonCommercial-NoDerivs 2.5 Portugal
This work by Pedro Timóteo is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 2.5 Portugal.