http://www.perlmonks.org?node_id=1041275

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Background:

I'm downloading my twitter feed and saving them into text files and I want to check the likely hood of spam using a perl script with Mail::SpamAssassin. So I followed this post about loading messages from text. All my messages keep getting marked as 'not spam' even when I inject 419 scams.

Question

What am I doing wrong?
Do I have to configure some Spamasssasin files?
Do My messages need to be in a cetain format?
Is there a better alternative for my project?

Details:

code:
use Mail::SpamAssassin; use Mail::Audit; open FILE, "<", ~/Messages/twitter_tweet.ema' or die; my @lines = <FILE>; my $spamtest = Mail::SpamAssassin->new(); my $mail = $spamtest->parse(\@lines); my $status = $spamtest->check($mail); print $status->get_report(); if ($status->is_spam()) { print "Totally Spam\n"; } else { print "not spam\n"; } $status->finish(); $mail->finish(); $spamtest->finish();
errors:
also $status->get_report() prints (no report template found)
I didn't configure spamAssasin I simply started using the perl module
There is a file called ~.spamassassin/user_prefs in my home directory but i didn't touch it