Mail::...sassin(3pm)
π 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
- debian trixie: libmail-box-perl 3.011-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: libmail-box-perl 3.011-1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms