Mail::...sassin(3pm)

πŸ“¦
version 3.011 Β· 5 versions
, in debian trixie, ubuntu questing

πŸ’… NAME πŸ’…

Okay bestie, welcome to the Mail::...sassin page β€” yeah it's the User Contributed Perl Documentation one, and it's giving ✨niche but iconic✨.

So, <cyan>Mail::Message::Wrapper::SpamAssassin</cyan> β€” say it with me, it's a mouthful, and that is literally the whole point of this module β€” its job is to connect a Mail::Message with Mail::SpamAssassin. That's it. That's the vibe. πŸ¦‹


🧬 INHERITANCE 🧬

The family tree is short, bestie, no cap:

 Mail::Message::Wrapper::SpamAssassin
   is a Mail::SpamAssassin::Message

So it's out here being a Mail::SpamAssassin::Message, but make it Mail::Message flavored. Periodt. πŸ’…


✨ SYNOPSIS ✨

Here's how you'd actually use it β€” read the comments first, because the warning is real:

# WARNING: requires OLD SpamAssassion 2.x, not the new 3.x
# See Mail::Box::Search::SpamAssassin for the preferred interface
# However, it is possible to do:

my $msg    = ...;   # some Mail::Message object
my $sa     = Mail::Message::Wrapper::SpamAssassin->new($msg);
my $spam   = Mail::SpamAssassin->new;
my $status = $spam->check($sa);

$msg->label(spam => 1) if $status->is_spam;
$status->rewrite_mail;  # Adds spam lines to header

Lowkey the flow is: wrap your message, spin up SpamAssassin, run the check, and if it comes back as spam, slap a label on it. Then rewrite_mail does the thing and adds spam lines to the header. 🫢

Heads up though β€” the comments say the preferred interface is Mail::Box::Search::SpamAssassin. This module is the "however, it is possible to do" path, iykyk.

😭 DESCRIPTION 😭

WARNING, and I mean this with my whole chest: this module only works with the old version of SpamAssassin, like, version 2.x old. The newer 3.x releases changed the way that messages are kept, so this thing just doesn't vibe with them. And the manpage says, and I quote the energy, please contribute improved code. So if you're feeling main character energy with a patch, bestie, go off. 🌈

So the Mail::Message::Wrapper::SpamAssassin class β€” and yeah, --sorry for the long package name, the original literally apologizes, I'm not making that up πŸ’€ β€” is a wrapper around Mail::SpamAssassin::Message, which itself is an interface to the spam checking software of Mail::SpamAssassin. It's wrappers all the way down, fr fr. πŸŽ€


πŸ›  METHODS πŸ› 

Mail::Message::Wrapper::SpamAssassin->new($message, %options)

Creates a wrapper around the $message. And here's the detail you don't wanna skip: the already present fields from a previous run of Spam::Assassin (or, honestly, probably fake lines πŸ™ˆ) are removed first. So it cleans house before it starts, no leftover spam crumbs. Slay. ✨


πŸ‘€ SEE ALSO πŸ‘€

This module is part of the Mail-Box distribution, version 3.011, built on April 18, 2025. The website, if you wanna go be nosy: http://perl.overmeer.net/CPAN/ πŸ¦‹


πŸ“œ LICENSE πŸ“œ

Copyrights 2001-2025 by [Mark Overmeer]. For other contributors, see ChangeLog β€” gotta give credit where it's due, bestie. πŸ’–

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://dev.perl.org/licenses/ for the receipts. 🫢


And that's a wrap on the Mail::...sassin page from the User Contributed Perl Documentation crew β€” this one was generated by perl v5.40.1 on 2025-04-25. Take care of yourselves, read your warnings, and don't run SpamAssassin 3.x with this module, I'm begging you. πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from