
Mail::SpamAssassin::PerMsgLearner - per-message status (spam or not-spam)

my $spamtest = new Mail::SpamAssassin ({
'rules_filename' => '/etc/spamassassin.rules',
'userprefs_filename' => $ENV{HOME}.'/.spamassassin.cf'
});
my $mail = Mail::SpamAssassin::NoMailAudit->new();
my $status = $spamtest->learn ($mail);
...

The Mail::SpamAssassin learn() method returns an object of this class. This object encapsulates all the per-message state for the learning process.

Learn the message as spam.
$id is an optional message-identification string, used internally to tag the message. If it is undef, the Message-Id of the message will be used. It should be unique to that message.
Learn the message as ham.
$id is an optional message-identification string, used internally to tag the message. If it is undef, the Message-Id of the message will be used. It should be unique to that message.
Forget about a previously-learned message.
$id is an optional message-identification string, used internally to tag the message. If it is undef, the Message-Id of the message will be used. It should be unique to that message.
Returns 1 if the message was learned from or forgotten succesfully.
Finish with the object.

Mail::SpamAssassin spamassassin