From: "Paul Lenz" <[EMAIL PROTECTED]>

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.

What did the body of the email you are testing look like?

I am suspecting it looked something like:

I need to make this message body somewhat long so TextCat preloads
I need to make this message body somewhat long so TextCat preloads

etc.

The newlines are stripped as are some other elements of the message
leaving it as a long line of text for that particular means of getting
the message body.

{^_^}

Reply via email to