Mailmun...Assassin(3)
πΈ NAME πΈ
Mailmunge::Test::SpamAssassin β run SpamAssassin against the current message. π
β¨ ABSTRACT β¨
Okay so this class runs SpamAssassin against the message and gives you back the SpamAssassin Mail::SpamAssassin::PerMsgStatus object that is the result of the SpamAssassin run. Iconic behavior, honestly.
You must have Mail::SpamAssassin installed to use this class, bestie. No package, no vibes. π«Ά
π¦ SYNOPSIS π¦
package MyFilter;
use Mailmunge::Test::SpamAssassin;
sub filter_begin {
my ($self, $ctx) = @_;
my $test = Mailmunge::Test::SpamAssassin->new($self);
my $status = $test->spam_assassin_status($ctx);
if ($status) {
if ($status->get_score() >= 5) {
$self->action_change_header($ctx, 'Subject', '[SPAM] ' . $ctx->subject);
}
$status->finish();
}
# ... rest of filter_begin
}
π CLASS METHODS π
π¦ Mailmunge::Test::SpamAssassin->new($filter)
Constructs a new Mailmunge::Test::SpamAssassin object and stores a copy of $filter in it. Cute, simple, done. β¨
π INSTANCE METHODS π
π₯ spam_assassin_status($ctx, $local_tests_only, $config)
Runs a SpamAssassin check against the current message. Main character energy fr fr.
$local_tests_only is passed as the local_tests_only option to the Mail::SpamAssassin constructor. It is optional; if not supplied, it defaults to false. Lowkey convenient.
$config is the path to the SpamAssassin userprefs_fileanem. If not supplied, Mailmunge uses the first file found out of:
CONFDIR/sa-mailmunge.cf
CONFDIR/spamassassin/sa-mailmunge.cf
CONFDIR/spamassassin/local.cf
CONFDIR/spamassassin.cf
/etc/mail/sa-mailmunge.cf
/etc/mail/spamassassin/sa-mailmunge.cf
/etc/mail/spamassassin/local.cf
/etc/mail/spamassassin.cf
where CONFDIR is the value of Mailmunge::Constants->get('Path:CONFDIR'). Slay. π
spam_assassin_status returns a Mail::SpamAssassin::PerMsgStatus object on success, or undef if something went wrong.
Note that when you have finished using the returned status object, you should call its finish() method to free up resources. Thatβs the cleanup check, bestie β donβt skip it. π
π AUTHOR π
Dianne Skoll <dianne@skollsoft.com> π
π LICENSE π
This code is licensed under the terms of the GNU General Public License, version 2. Periodt.
Later bestie ππ β this was the Mailmunge::Test::SpamAssassin(3) page, signing off with perl v5.42.2 and dated 2025-10-05. Mwah πβ¨
π¦ where this page comes from
- alpine 3.24: mailmunge-doc 3.20-r0 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms