You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2006/12/07 16:09:02 UTC

svn commit: r483476 - /spamassassin/trunk/masses/plugins/Dumptext.pm

Author: jm
Date: Thu Dec  7 07:08:59 2006
New Revision: 483476

URL: http://svn.apache.org/viewvc?view=rev&rev=483476
Log:
test plugin which outputs 'body' text to stdout; load using e.g. 'spamassassin --cf="loadplugin Dumptext masses/plugins/Dumptext.pm" -Lt < sample-spam.txt', or similar in mass-check

Added:
    spamassassin/trunk/masses/plugins/Dumptext.pm

Added: spamassassin/trunk/masses/plugins/Dumptext.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/masses/plugins/Dumptext.pm?view=auto&rev=483476
==============================================================================
--- spamassassin/trunk/masses/plugins/Dumptext.pm (added)
+++ spamassassin/trunk/masses/plugins/Dumptext.pm Thu Dec  7 07:08:59 2006
@@ -0,0 +1,23 @@
+package Dumptext;
+use strict;
+use Mail::SpamAssassin;
+use Mail::SpamAssassin::Plugin;
+our @ISA = qw(Mail::SpamAssassin::Plugin);
+
+sub new {
+  my ($class, $mailsa) = @_;
+  $class = ref($class) || $class;
+  my $self = $class->SUPER::new($mailsa);
+  bless ($self, $class);
+  return $self;
+}
+
+sub check_end {
+  my ($self, $opts) = @_;
+  my $array = $opts->{permsgstatus}->get_decoded_stripped_body_text_array();
+  my $str = join (' ', @$array);
+  $str =~ s/\s+/ /gs;
+  print STDOUT "text: $str\n";
+}
+
+1;



Re: svn commit: r483476 - /spamassassin/trunk/masses/plugins/Dumptext.pm

Posted by Fred T <sp...@freddyt.com>.
Hello jm,

Thursday, December 7, 2006, 10:09:02 AM, you wrote:

> Author: jm
> Date: Thu Dec  7 07:08:59 2006
> New Revision: 483476

> URL: http://svn.apache.org/viewvc?view=rev&rev=483476
> Log:
> test plugin which outputs 'body' text to stdout; load using e.g.
> 'spamassassin --cf="loadplugin Dumptext masses/plugins/Dumptext.pm"
> -Lt < sample-spam.txt', or similar in mass-check

> Added:
>     spamassassin/trunk/masses/plugins/Dumptext.pm

I wasn't sure if I should create a ticket on this, but when DumpText
prints the output to STDERR, it doesn't use the same format as all the
other debug messages.  Normal debug messages look like:
[PID] dbg: channel: message

DumpText is using the format:
text: message
or
channel: message

Maybe I made a mistake, playing some more with DumpText and it looks
like "text" is not a channel at all, just what's displayed in STDERR.

I also noticed that when I lint with DumpText loaded, it prints out
the body of the lint message ;)


text:  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 need to make this
 message body somewhat long so TextCat preloads I need to make this message body
 somewhat long so TextCat preloads I need to make this message body somewhat lon
g so TextCat preloads I need to make this message body somewhat long so TextCat
-- 
Best regards,
 Fred                            mailto:spamassassin@freddyt.com