Actually I write Perl programs since many years, but I am not
so familiar with the object oriented programming and I can not
discover the secrets of Spamassassin. Contretely: I was not able
to access the body of a mail.

I included Plugin\Test.pm into my configuration:

loadplugin     Mail::SpamAssassin::Plugin::Test
full           MY_TEST1 eval:check_test_plugin()
score          MY_TEST1 0.1
describe       MY_TEST1 Test-Plugin

This workes, each mail gets this score.

In the sub with the line "hard work goes here..." (how true!!!) there
are the scalars $self and $permsgstatus. I added some code which
saves $self into a file. The result was a hash reference. I tried
keys() and found the key "main". Sounds promising, doesn't it?
But the result was another hash reference. It's keys didn't look like
the message body. I gave it up.

I looked into some other plugins and ended with this code:

  my ($self, $permsgstatus) = @_;
  my $array = $permsgstatus->get_decoded_stripped_body_text_array();
  my $text = join (' ', @$array);

But $text contains only "I need to make this message body somewhat
long so TextCat preloads I need to make this message body somewhat
long so TextCat preloads ......". I gave it up.

Would please somebody give me a hint how to access the body of 
the mail? 

Thanks, Paul Lenz


PS. Sorry for multiple postings, I only saved my message during 
editing, but it seems to be sent every time :(

Reply via email to