Devin Carraway wrote:
Here's a rewritten spamassassin plugin that has no issues with
SpamAssassin 2.50.  I ripped out all the attempt at speaking the SA
network protocol and just used spamc, which already knows how.

Unfortunatly this doesn't handle messages larger than the spamc size limit correctly.


  print WR $transaction->header->as_string, "\n";
  my $line;
  print WR $line while $line = $transaction->body_getline;
  $transaction->body_resetpos;
  close WR;

When spamc determines that the message is too large to be passed to spamd it passes the message to stdout immediately. Thus spamc will block trying to write to its stdout pipe (since the plugin isn't yet reading from RD) and then the plugin will block writing to WR (since spamc isn't reading from stdin anymore).



my $h = new Mail::Header; $h->read(\*RD); while (<RD>) { chomp; $self->log(10,"spamc returned body: [$_]"); } close RD; waitpid $pid, 0;

This read loop would have to be interleaved with the write loop above, using select.




Reply via email to