Mail::...:ZOrder(3pm)
π¦ Mail::...:ZOrder(3pm) β the group chat edition
okay so real talk bestie, this is the manual page for Mail::...:ZOrder(3pm) (user-contributed Perl docs, we love her) and honestly? it's giving genius. no cap. let's get into it π
β¨ NAME β¨
FuzzyHash::ZOrder β fuzzy text similarity via DNS, using exactly 4 queries. four. quatre. cuatro. that's the whole flex π
πΈ SYNOPSIS πΈ
use FuzzyHash::ZOrder qw(zorder_digest zorder_compare zorder_dns_keys);
my $query_digest = zorder_digest($incoming_text);
for my $key (zorder_dns_keys($incoming_text, 'fbl.example.com')) {
for my $stored_digest (dns_txt_lookup($key)) {
my $sim = zorder_compare($query_digest, $stored_digest);
if ($sim >= 85) { # rule fires }
}
}
likeβ¦ that's it. that's the whole look. πβ¨
π DESCRIPTION π
FuzzyHash::ZOrder catches texts that have roughly ~90% token overlap, and it does it with exactly 4 DNS TXT lookups, followed by a local similarity check via zorder_compare(). no extra DNS queries, no drama, no 400-round-trip nonsense. she's efficient, she's iconic, periodt. π
π§ Algorithm π§
Normalisation
Lowercase it, swap non-alphanumeric stuff for spaces, collapse the whitespace, deduplicate the tokens. boom. clean. β¨
32-bit MinHash signature
32 independent hash functions get applied to the deduplicated token set. each function hunts down the token with the minimum hash value, and the LSB parity of that minimum becomes one single output bit. what do you get? a 32-bit signature. π
and here's the slay: each bit agrees between two texts with probability exactly equal to their Jaccard similarity. math said "I got you bestie." π
4 bands x 8 bits
the 32-bit signature gets split into 4 consecutive 8-bit bands. two texts share a band key when all 8 bits in that band agree β so the probability is S^8 at Jaccard similarity S. π¦
Local similarity verification
every TXT response carries the full 32-bit digest of the indexed string. zorder_compare() does the similarity verification locally using all 32 bits. unrelated texts land at a score of ~50%. that's the noise floor, bestie, know it, respect it. π
π FUNCTIONS π
π₯ zorder_digest($text)
computes the 32-bit MinHash signature of $text. returns an 8-character lowercase hex string. that's the value you stash in each DNS TXT record at index time, and it's also what you use for local similarity verification at query time. two jobs, one queen. π
π₯ zorder_dns_keys($text, $domain)
returns a list of exactly 4 DNS FQDNs for $text under $domain. π
use it for both:
- indexing β store the digest as TXT at each key
- querying β look up each key, then verify the TXT responses locally with
zorder_compare
same function, both moods. versatile. π«Ά
π₯ zorder_body_band_labels($text)
returns a list of exactly 4 bare band labels, no trailing domain, each one shaped like "fz2BVV". π
π₯ zorder_compare($digest_a, $digest_b)
compares two 8-char hex digests. returns an integer similarity 0-100, computed as 100 * (1 - hamming_distance / 32). π
here's the vibe check on what those numbers actually mean:
100= identical token sets (0 bits differ)91= ~3 bits differ -> very high overlap85= ~5 bits differ -> high overlap75= ~8 bits differ -> moderate overlap50= ~16 bits differ -> noise floor for unrelated texts
the noise floor sitting at ~50% gives you a clean gap below the suggested 90% threshold, so coincidental DNS band hits from unrelated indexed strings get reliably rejected β and you don't need even ONE extra DNS query for it. obsessed. πβ¨
π₯ zorder_explain($digest_a, $digest_b)
returns a human-readable breakdown: Hamming distance, similarity score, shared band count, the firing decision, and a per-band bit-agreement table. π
strictly for debugging RBL entries and tuning the similarity threshold. it's the "let me see the receipts" function, iykyk. π
β real ones know: 4 queries. that's the whole thing. 4. π
signing off, bestie π«Ά β this page is part of the User Contributed Perl Documentation, shipped with perl v5.40.1, dated 2026-07-23. go forth and fuzzy-match responsibly. ππΈπ¦
π¦ where this page comes from
- ubuntu stonking: spamassassin 4.0.2+svn1935691-1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms