Razor2:...t::Core(3)
πΈ 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, requiresNet::SOCKS). Default port is2703. 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 cachedserver.*.conffiles.
π¦ Server Discovery π¦
bootstrap_discovery()β Performs DNS-based discovery of Razor servers by querying TXT records for therazordiscoveryzone. 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 likeep4) to be loaded first viaget_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.$paramsis 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.$optionsis 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::AgentRazor2::Client::ConfigRazor2::Client::EngineRazor2::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
- arch rolling: razor 2.88-2 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms