Razor2:...t::Core(3)

πŸ“¦ version 2.88, in arch rolling

🌸 NAME 🌸

Razor2::Client::Core β€” Network protocol engine for Vipul's Razor. Also hii bestie, you're on the Razor2:...t::Core(3) page from the User Contributed Perl Documentation πŸ’– this is the core module and it's giving main character energy.

✨ SYNOPSIS ✨

# Typically used via Razor2::Client::Agent, not directly
use Razor2::Client::Agent;

my $agent = Razor2::Client::Agent->new('razor-check');
# Core methods are inherited by Agent

The comments are literally doing the heavy lifting here β€” use it via Razor2::Client::Agent, not directly 🫢

πŸ’– DESCRIPTION πŸ’–

Okay so Razor2::Client::Core implements the Razor v2 network protocol, and it's giving full package: server discovery, connection management, signature computation, spam checking, reporting, revocation, and identity registration/authentication.

This module talks to Razor catalogue servers (for checking) and nomination servers (for reporting/revoking) using a TCP-based protocol with SIS-encoded (Server Information String) messages.

And the family tree? Core inherits from Razor2::String, Razor2::Logger, Razor2::Client::Engine, and Razor2::Errorhandler β€” iconic inheritance behavior 🌈

πŸ‘‘ METHODS πŸ‘‘

πŸ’… Connection Management πŸ’…

  • connect(%params) β€” Establishes a TCP connection to a Razor server. Supports direct connections, HTTP proxy tunneling ("proxy" config), and SOCKS proxies ("socks_server" config, requires Net::SOCKS). Default port is 2703. Reads and parses the server greeting on connect. Automatically tries the next server on failure.
  • disconnect() β€” Sends a quit command and closes the connection.
  • nextserver() β€” Selects the next server from the current server list. If no servers remain, initiates server discovery. Loads per-server configuration from cached server.*.conf files.

πŸ¦‹ Server Discovery πŸ¦‹

  • bootstrap_discovery() β€” Performs DNS-based discovery of Razor servers by querying TXT records for the razordiscovery zone. Used when no server lists exist.
  • discover($server) β€” Connects to a discovery server and retrieves current catalogue and nomination server lists.

πŸŽ€ Signature Operations πŸŽ€

  • prepare_objects($mails) β€” Takes an array reference of mail scalar references and prepares them into internal objects with headers, body parts, and preprocessing applied.
  • compute_sigs($objects) β€” Computes spam signatures for each mail object using the configured engines. Requires server info (for engine parameters like ep4) to be loaded first via get_server_info(). Returns an array reference of printable signature strings.

πŸ”₯ Spam Checking πŸ”₯

  • check($objects) β€” Sends computed signatures to the catalogue server and retrieves confidence values. Sets "$obj->{spam}" on each object based on the response.
  • check_logic($objects) β€” Applies the configured logic method to determine the final spam verdict for each mail object based on per-engine confidence values.

πŸ“ Reporting πŸ“

  • report($objects) β€” Reports or revokes spam signatures with the nomination server. Requires prior authentication. Sends signatures in batched queries.
  • register($params) β€” Registers a new identity with the nomination server. $params is a hash reference with optional "user" and "pass" keys. Returns a hash reference with the registered credentials on success.
  • authenticate($options) β€” Authenticates with the server using HMAC-SHA1 challenge-response. $options is a hash reference with "user" and "pass" keys. Attempts automatic re-registration on unknown user errors.

🌈 PROTOCOL 🌈

The Razor v2 protocol uses TCP connections (default port 2703) with SIS-encoded messages (URI-escaped key=value pairs separated by "&" and terminated by CRLF). Server discovery uses DNS TXT records.

The protocol version is defined in Razor2::Client::Version. iykyk ✨

πŸ’œ SEE ALSO πŸ’œ

  • Razor2::Client::Agent
  • Razor2::Client::Config
  • Razor2::Client::Engine
  • Razor2::String

⭐ AUTHORS ⭐

Vipul Ved Prakash, <mail@vipul.net> β€” iconic author behavior πŸ‘‘

🧚 LICENSE 🧚

And the legal tea, no cap: This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


k bye bestie πŸ’– β€” this page came from perl v5.44.0, dated 2026-10-17, and it's the Razor2:...t::Core(3) page. Mwah! 🫢

πŸ“¦ where this page comes from