aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>2004-11-03 18:43:32 +0800
committerjoerg <joerg@FreeBSD.org>2004-11-03 18:43:32 +0800
commit5f18ca47f6e40d62cf70bcfb073595d1cfc81de6 (patch)
tree267e72cf05e43d5e49ccf913aecc9e6f9a0bcfda /mail
parent0b2371ce8f06d0b6fd20a46e0f40a0459e93da92 (diff)
downloadfreebsd-ports-gnome-5f18ca47f6e40d62cf70bcfb073595d1cfc81de6.tar.gz
freebsd-ports-gnome-5f18ca47f6e40d62cf70bcfb073595d1cfc81de6.tar.zst
freebsd-ports-gnome-5f18ca47f6e40d62cf70bcfb073595d1cfc81de6.zip
Support the changed API of spamassassin 3.0.
Submitted by: maintainer
Diffstat (limited to 'mail')
-rw-r--r--mail/spampd/Makefile1
-rw-r--r--mail/spampd/files/patch-2to363
2 files changed, 64 insertions, 0 deletions
diff --git a/mail/spampd/Makefile b/mail/spampd/Makefile
index c49cbe8b1c58..8f52af358d71 100644
--- a/mail/spampd/Makefile
+++ b/mail/spampd/Makefile
@@ -7,6 +7,7 @@
PORTNAME= spampd
PORTVERSION= 2.12
+PORTREVISION= 1
CATEGORIES= mail perl5
MASTER_SITES= http://www.worlddesign.com/Content/rd/mta/spampd/
diff --git a/mail/spampd/files/patch-2to3 b/mail/spampd/files/patch-2to3
new file mode 100644
index 000000000000..4af4ef172283
--- /dev/null
+++ b/mail/spampd/files/patch-2to3
@@ -0,0 +1,63 @@
+--- spampd.orig Tue May 11 09:52:42 2004
++++ spampd Mon Oct 4 15:06:57 2004
+@@ -395,7 +395,6 @@
+ use IO::File;
+ use Getopt::Long;
+ use Mail::SpamAssassin;
+-use Mail::SpamAssassin::NoMailAudit;
+
+ BEGIN {
+ # Load Time::HiRes if it's available
+@@ -464,8 +463,7 @@
+ my $previous_alarm = alarm($self->{spampd}->{satimeout});
+
+ # Audit the message
+- my $mail = Mail::SpamAssassin::NoMailAudit->new (
+- data => \@msglines );
++ my $mail = $assassin->parse( \@msglines );
+
+ # Check spamminess
+ my $status = $assassin->check($mail);
+@@ -475,11 +473,12 @@
+
+ my $addingHeader = 0;
+ if ( $self->{spampd}->{addheader} && length($self->{spampd}->{myhostname}) ) {
+- $mail->put_header("X-Spam-Checked-By", $self->{spampd}->{myhostname});
++ $mail->put_metadata("X-Spam-Checked-By", $self->{spampd}->{myhostname});
+ $addingHeader = 1;
+ }
+
+ # Rewrite mail if high spam factor or options --tagall or --add-sc-header
++ my $msg_resp = '';
+ if ( $status->is_spam || $self->{spampd}->{tagall} || $addingHeader ) {
+
+ # if spam or --tagall, have SA put in its report/headers.
+@@ -487,12 +486,14 @@
+ if ( $self->{spampd}->{debug} ) {
+ $self->log(2, "Rewriting mail using SpamAssassin"); }
+
+- $status->rewrite_mail;
++ $msg_resp = $status->rewrite_mail;
+
+- }
++ } else {
+
+- my $msg_resp = join '', $mail->header, "\r\n", @{$mail->body};
++ $msg_resp = join '', $mail->get_pristine_header(), "\r\n", @{$mail->get_body()};
++ }
+ my @resplines = split(/\r?\n/, $msg_resp);
++
+
+ # Build the new message to relay
+ # pause the timeout alarm while we do this (no point in timing
+@@ -513,8 +514,8 @@
+ # Log what we did
+ my $was_it_spam = 'clean message';
+ if ($status->is_spam) { $was_it_spam = 'identified spam'; }
+- my $msg_score = sprintf("%.2f",$status->get_hits);
+- my $msg_threshold = sprintf("%.2f",$status->get_required_hits);
++ my $msg_score = sprintf("%.2f",$status->get_score);
++ my $msg_threshold = sprintf("%.2f",$status->get_required_score);
+ my $proc_time = sprintf("%.2f", time - $start);
+
+ $self->log(2, "$was_it_spam $msgid ($msg_score/$msg_threshold) for ". \ No newline at end of file