How would I go about adding a header in the perl code below, the value
of the header would be dynamic on a per message basis so I don't think a
local.cf mod would help me.

I've tried dynamically touching $spamtest->{conf}->{headers_spam} and
$spamtest->{conf}->{headers_ham}, as well as a few other incantations,
but haven't quite found the magic to make it work. 

We're using SA3.04 on Windows

(using $hdr & $hdrval below)

Please and Thank you,
Steven
--------------------------- 
sub is_message_spam {
  my $message_txt = $_[0];
  my @messages = @{$_[3]};
  my %opts = %{$_[4]};
  my $hdr = "X-Spam-InternalId";
  my $hdrval = $_[5];
  my $spamtest = new Mail::SpamAssassin(\%opts);
  if (!defined($spamtest)) {
    logthis("SPAMTEST: Unable to create SpamAssassin
object",[EMAIL PROTECTED]);
    return 0;
  }
 
  my $mail = $spamtest->parse($message_txt);
  my $status = $spamtest->check($mail);
  $mail = $status->get_message();
  $_[1] = $mail;
  $_[2] = $status;
  @{$_[3]} = @messages;
  $_[0] = $status->rewrite_mail();
  if ($status->is_spam()) {
    return 1;
  } else {
    return 0;
  }
}

Reply via email to