You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by Yusuf Goolamabbas <yu...@gmail.com> on 2004/08/03 12:14:48 UTC

Starting spamd invokes plugin with the preloading message for TextCat loading

Hi, I wrote a trivial plugin which would print out an md5 checksum of
the message on stder r as well as storing the message on file
descriptor 4, it worked great when run with the spamassassin command
line

spamassassin -Lx < msg 4>output 1>/dev/null


I decided to see if it work correctly when run with spamd/spamc. So I
started of spamd
As soon as I started spamd via spamd -Lx -p 7830. I get the following
displayed in the terminal

6166c359a351a9ad990c05334ea520ec 
From: ignore@compiling.spamassassin.taint.org
Message-Id:  <10...@spamassassin_spamd_init>

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 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 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 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

Is there a way to prevent this message from invoking plugins ?

Also, when I pass the message to spamc and redirect fd 4 to a file,
the output doesn't seem to go there unlike the invocation with
spamassassin. An empty file is created with the following invocation

spamc -Lx -p 7830 < msg 4>output 1>/dev/null

The plugin code is as follows
sub print_md5 {
  my ($self, $permsgstatus) = @_ ;
  open(MSG,">&=4");
  $md5 = Digest::MD5->new;
  $msgref = $permsgstatus->get_message();
  $msg = $msgref->get_pristine();
  $md5->add($msg);
  $digest = $md5->hexdigest;
  print MSG "$digest \n" ;
  print MSG "$msg";
  close(MSG);
}

Am I doing something wrong ?

Regards, Yusuf

Re: Starting spamd invokes plugin with the preloading message for TextCat loading

Posted by Theo Van Dinter <fe...@kluge.net>.
On Tue, Aug 03, 2004 at 06:14:48PM +0800, Yusuf Goolamabbas wrote:
> As soon as I started spamd via spamd -Lx -p 7830. I get the following
> displayed in the terminal
> 
> 6166c359a351a9ad990c05334ea520ec 
> From: ignore@compiling.spamassassin.taint.org
> Message-Id:  <10...@spamassassin_spamd_init>
> 
> Is there a way to prevent this message from invoking plugins ?

No.  spamd wants to get everything precompiled before processing messages,
so it makes a fake message (as above) and sends it through a "check"
to get it all set to go.

I don't recall off hand if there's an easy way to tell if you're in
"compile_now" mode or not.

> Also, when I pass the message to spamc and redirect fd 4 to a file,
> the output doesn't seem to go there unlike the invocation with
> spamassassin. An empty file is created with the following invocation

Yeah.  spamc != spamassassin...   spamd is the one actually doing the
processing, so the fd 4 bit happens in spamd.  spamc has absolutely no
capability of dealing with that.

BTW: any reason you're doing md5 and not using the already loaded/required
sha1?

-- 
Randomly Generated Tagline:
I am Henny of Borg - assimilate my wife...please!