razor-check - Razor Filtering Agent


    razor-check [-s -d -H] file_with_mail_in_rfc822_format
    $ cat mail | razor-check
    $ razor-check ./mail 
    $ razor-check -d ./mail


razor-check checks a mail against the distributed Razor Catalogue. It should be invoked before the mail is delivered or processed by a human. razor-check terminates with exit value 0 if the signature for the mail is catalogued on the server (spam) or 1 if the mail is not catalogued by the server (not a spam). razor-check should be invoked against every incoming mail by mail processors (like procmail) or MTAs (like sendmail). An alternate method would be to call razor-check from cron, at regular intervals, to identify and mark spam in queued mailboxes.


razor-check is usually run by piping the contents of the mail to it, or by providing the name of the file that contains the mail message to be checked as the last argument. razor-check takes the following arguments:

Simulate a check. Do everything except talk to the server.
-d | --verbose
Print debugging information.
Compute and print the SHA hash of the mail contents. And then exit.
-M | --mbox

Accept a mailbox name on the command line and check every mail in the mailbox against the database. razor-check will print out the serial number of every mail found in the Catalogue. When combined with -n it will also print the serial numbers, prefixed with a -, of mails that were not found in the Catalogue. Usage:

 razor-check -M ~/Mail/possible-spam 
-S | --sig

Accept a list of pre-computed (with -H) signatures on the command line, instead of computing one from mail content. When called with --sig, razor-check will not attempt to read from STDIN. Usage:

 razor-check -d -S a8a3d545adb73f9733675571ffeaf10cba87745b
The path of the config file. By default the path is ~/razor.conf, an alternate path can be specified with this option. See razor.conf(5) manpage for various configuration options.
Print a usage message and exit.
Print the version number and exit.


razor-check is usually invoked from procmail(1). Here are some common ways of using it with procmail:

To change the Subject header if mail is spam:
    :0 Wc
    | razor-check
    :0 Waf
    | formail -i "Subject: Razor Warning: SPAM/UBE/UCE"
To add a X-Razor-Warning header to spam:
    :0 Wc
    | razor-check
    :0 Waf
    | formail -A "X-Razor-Warning: SPAM."
To file spam in a mailbox
    :0 Wc
    | razor-check
    :0 Wa


Vipul Ved Prakash, <>


razor.conf(5), razor-report(1), razor-discover(1)


This is free software, distributed under the ARTISTIC license.