Razor2:...t::Agent(3)

๐Ÿ“ฆ version 2.88, in arch rolling

okay so bestie, welcome to Razor2:...t::Agent(3) ๐Ÿ’… from the User Contributed Perl Documentation โ€” yes, that's the manual name, folded in right here at the top so nobody gets confused. This page is all about Razor2::Client::Agent, and it's giving command-line-interface-for-a-spam-detection-network energy. Periodt. โœจ

โœจ NAME โœจ

Razor2::Client::Agent โ€” Command-line interface for Vipul's Razor spam detection. ๐Ÿ›ก๏ธ

๐ŸŒธ SYNOPSIS ๐ŸŒธ

okay so you load it like this, bestie:

use Razor2::Client::Agent;

my $agent = Razor2::Client::Agent->new('razor-check');
$agent->read_options() or $agent->raise_error;
$agent->do_conf()      or $agent->raise_error;
my $rc = $agent->doit({});
exit $rc;

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

Razor2::Client::Agent gives you the user interface layer for Vipul's Razor, a distributed, collaborative spam detection and filtering network. No cap, that's the whole vibe. ๐Ÿ’–

It implements the command-line tools razor-check, razor-report, razor-revoke, and razor-admin. ๐ŸŽ€

This module inherits from Razor2::Client::Core (network protocol), Razor2::Client::Config (configuration management), Razor2::Logger (logging), and Razor2::String (utility functions). It's giving "stacked inheritance" and we love that for it. ๐Ÿงš

Typical usage is through the command-line programs rather than calling this module directly. See razor-check(1), razor-report(1), razor-revoke(1), and razor-admin(1). ๐Ÿซถ

๐Ÿงš METHODS ๐Ÿงš

okay these are the methods, and every single one is here โ€” no skips, no cap. ๐Ÿซก

  • new($breed) โ€” Constructor energy. $breed is the full program name, which must end with one of "razor-check", "razor-report", "razor-revoke", or "razor-admin". The breed determines which operations are available. Also deletes $ENV{PATH} and $ENV{BASH_ENV} for taint safety. ๐Ÿ›ก๏ธ
  • read_options($agent) โ€” Parses command-line options via Getopt::Long. Returns true on success, false on error (error message available via errstr()). ๐Ÿ’…
  • do_conf() โ€” Processes configuration: resolves razorhome, reads the config file, sets up logging, and creates the home directory if -create was specified. Must be called after read_options(). That's not a suggestion, bestie. ๐ŸŒธ
  • doit($args) โ€” Main dispatcher. Calls the appropriate handler based on the breed: checkit() for check, adminit() for admin, reportit() for report and revoke. Returns 0 for match (spam), 1 for no match (not spam), or 2 for error. ๐ŸŽฏ
  • checkit($args) โ€” Checks mail against the Razor catalogue servers. Accepts input as filenames, mbox files, signatures on the command line, or a filehandle in $args. Return values: 0 = spam detected, 1 = not spam, 2 = error. ๐Ÿ”
  • reportit($args) โ€” Reports mail as spam (or revokes a previous report). Requires a valid Razor identity; attempts automatic registration if none is found. Backgrounds itself unless -f (foreground) is specified. Return values: 0 = success, 2 = error. ๐Ÿ“ฎ
  • adminit($args) โ€” Handles administrative tasks: creating razorhome (-create), server discovery (-discover), and identity registration (-register). Return values: 0 = success, 2 = error. ๐Ÿ‘‘
  • parse_mbox($args) โ€” Parses input into individual mail messages. Supports mbox format (splitting on ^From lines), single RFC 822 messages, filehandle input (via $args->{fh}), and array reference input (via $args->{aref}). Returns an array reference of scalar references to mail content. ๐Ÿ“ฌ
  • local_check($obj) โ€” Performs local whitelist and mailing-list checks. Returns true if the mail should be skipped (not checked against the server). ๐Ÿ™…โ€โ™€๏ธ
  • read_whitelist() โ€” Loads the whitelist file specified in the configuration. The whitelist maps header names to patterns; matching mail is skipped. ๐Ÿ—‚๏ธ
  • get_server_info() โ€” Reads server lists, loads cached server configurations, and resolves the next server to connect to. Called before network operations. ๐ŸŒ
  • raise_error($errstr) โ€” Prints a fatal error message and exits with the Razor error code extracted from the message, or 255 if no code is found. ๐Ÿ’€
  • log($level, $msg) โ€” Logs a message at the given debug level. Uses the Razor2::Logger instance if available, otherwise prints to STDOUT in debug mode. ๐Ÿชต
  • logll($loglevel) โ€” Returns true if the current debug level is at or above $loglevel. Use this to guard expensive log message construction. ๐Ÿ”ฅ

๐ŸŽ€ CONFIGURATION ๐ŸŽ€

See razor-agent.conf(5) for configuration file format and options. ๐Ÿ“–

The razorhome directory (default ~/.razor/, system-wide /etc/razor/) stores configuration files, server lists, identity files, and logs. That's the whole storage situation, bestie. ๐Ÿ“

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

๐Ÿ’– AUTHORS ๐Ÿ’–

Vipul Ved Prakash, <mail@vipul.net> ๐Ÿ’Œ

๐Ÿ“œ LICENSE ๐Ÿ“œ

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


mwah ๐Ÿ’‹ this page was served by perl v5.44.0, dated 2026-10-17, and it's the Razor2:...t::Agent(3) page โ€” bye bestie, go check some spam! ๐Ÿซถโœจ

๐Ÿ“ฆ where this page comes from