pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Patches for DSPAM to make Quarantine work properly



Hello!

I am setting up DSPAM on a server and saw that when you set up dspam's quarantine, the mails contained in it won't be shown in the windows for this purpose.

I found following two patches on the DSPAM mailinglist that fixed the problem. BTW it is an often asked question by dspam admins.

I would like to submit those two patches, but it seems that this mailinglist users are maintaining the DSPAM pkgsrc package.

So I am asking how to add those patches to the pkgsrc tree?
I just attached them to the email, maybe someone can make the work or tell me how to do it myself.

Have a good day!
Damian


--- src/dspam.c 2006-12-12 
+++ src/dspam.c 
@@ -762,7 +762,12 @@

   /* Reassemble message from components */

-  copyback = _ds_assemble_message (CTX->message, (USE_LMTP || USE_SMTP) ? 
"\r\n" : "\n");
+  if (CTX->result == DSR_ISSPAM && (!(ATX->flags & DAF_DELIVER_SPAM))) {
+      copyback = _ds_assemble_message (CTX->message, "\n");
+  } else {
+      copyback = _ds_assemble_message (CTX->message,
+            (USE_LMTP || USE_SMTP) ? "\r\n" : "\n");
+  }
   buffer_clear (message);
   buffer_cat (message, copyback);
   free (copyback);

--- webui.orig/cgi-bin/dspam.cgi        2007-02-14 13:18:59.000000000 -0500
+++ webui/cgi-bin/dspam.cgi     2007-03-27 16:43:46.000000000 -0400
@@ -531,10 +532,13 @@
   foreach my $period (qw( daily weekly )) {
     my $uc_period=uc($period);
     my $hk="DATA_$uc_period";
-    my %lst=();
+    my %lst=(
+       spam => [],
+       nonspam => [],
+       title   => []
+    );
     foreach my $hr (sort {$a->{idx}<=>$b->{idx}} (values %{$Stats{$period}})) {
       foreach my $type (qw( spam nonspam title )) {
-        (exists $lst{$type}) || ($lst{$type}=[]);
         push(@{$lst{$type}},$hr->{$type});
         my $totk="";
         if ($type eq "spam") { $totk="S"; }
@@ -546,9 +550,9 @@
       }
     }
     $DATA{$hk}=join("_",
-               join(",",@{$lst{spam}}),
-               join(",",@{$lst{nonspam}}),
-               join(",",@{$lst{title}}),
+               join(",",@{$lst{spam}}    || [0]),
+               join(",",@{$lst{nonspam}} || [0]),
+               join(",",@{$lst{title}}   || [0]),
        );
   }
 
@@ -698,7 +702,7 @@
   }
   open(FILE, "<$MAILBOX");
   while(<FILE>) {
-    chomp;
+    s/\r?\n$//;
     push(@buffer, $_);
   }
   close(FILE);
@@ -759,7 +763,7 @@
 
   open(FILE, "<$MAILBOX");
   while(<FILE>) {
-    chomp;
+    s/\r?\n$//;
     push(@buffer, $_);
   }
   close(FILE);
@@ -839,7 +843,7 @@
 
   open(FILE, "<$MAILBOX");
   while(<FILE>) {
-    chomp;
+    s/\r?\n//;
     push(@buffer, $_);
   }
   close(FILE);
@@ -907,7 +911,7 @@
   }
   open(FILE, "<$MAILBOX");
   while(<FILE>) {
-    chomp;
+    s/\r?\n//;
     push(@buffer, $_);
   }
   close(FILE);
@@ -980,7 +984,7 @@
   $rowclass="rowEven";
   open(FILE, "<$MAILBOX");
   while(<FILE>) {
-    chomp;
+    s/\r?\n//;
     if ($_ ne "") {
       if ($mode eq "") { 
         if ($_ =~ /^From /) {



Home | Main Index | Thread Index | Old Index