#!/usr/bin/perl use strict; use Razor::Client; use Razor::Agent; use Razor::Config; # Do Razor Init my $options = Razor::Agent::options('razor-check'); my $config = Razor::Config::findconf('razor.conf'); my $rc = new Razor::Agent( $config, %$options ); # Read in a message my @message = ( "Subject: I know this is spam\n", "\n", "test\n" ); # Have razor compute the signature for the message my @sigs = ( $rc->local_check( \@message ) ); # Set the array references appropriately. my %check = ( sigs => \@sigs ); # Do the check. my $response = $rc->check(%check); # If there was an error, say so. if ( !defined $response ) { $rc->raise_error(); } elsif ( $response->[0] ) { print "This message is spam!\n"; } else { print "This message is not spam!\n"; }