You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by do...@apache.org on 2005/03/11 06:25:08 UTC

svn commit: r157049 - in spamassassin/branches/3.0/lib/Mail/SpamAssassin: Conf.pm Reporter.pm

Author: dos
Date: Thu Mar 10 21:25:05 2005
New Revision: 157049

URL: http://svn.apache.org/viewcvs?view=rev&rev=157049
Log:
bug 4064: implements spamcop_max_report_size

Modified:
    spamassassin/branches/3.0/lib/Mail/SpamAssassin/Conf.pm
    spamassassin/branches/3.0/lib/Mail/SpamAssassin/Reporter.pm

Modified: spamassassin/branches/3.0/lib/Mail/SpamAssassin/Conf.pm
URL: http://svn.apache.org/viewcvs/spamassassin/branches/3.0/lib/Mail/SpamAssassin/Conf.pm?view=diff&r1=157048&r2=157049
==============================================================================
--- spamassassin/branches/3.0/lib/Mail/SpamAssassin/Conf.pm (original)
+++ spamassassin/branches/3.0/lib/Mail/SpamAssassin/Conf.pm Thu Mar 10 21:25:05 2005
@@ -1145,6 +1145,20 @@
     },
   });
 
+=item spamcop_max_report_size		(default: 50)
+
+The size (in kilobytes) at which SpamAssassin will truncate messages
+reported to SpamCop.  The default is the maximum size SpamCop will
+accept at the time of release.
+
+=cut
+
+  push (@cmds, {
+    setting => 'spamcop_max_report_size',
+    default => 50,
+    type => $CONF_TYPE_NUMERIC
+  });
+
 =item trusted_networks ip.add.re.ss[/mask] ...   (default: none)
 
 What networks or hosts are 'trusted' in your setup.  B<Trusted> in this case

Modified: spamassassin/branches/3.0/lib/Mail/SpamAssassin/Reporter.pm
URL: http://svn.apache.org/viewcvs/spamassassin/branches/3.0/lib/Mail/SpamAssassin/Reporter.pm?view=diff&r1=157048&r2=157049
==============================================================================
--- spamassassin/branches/3.0/lib/Mail/SpamAssassin/Reporter.pm (original)
+++ spamassassin/branches/3.0/lib/Mail/SpamAssassin/Reporter.pm Thu Mar 10 21:25:05 2005
@@ -428,8 +428,8 @@
 	      );
 
   # truncate message
-  if (length($original) > 64*1024) {
-    substr($original,(64*1024)) = "\n[truncated by SpamAssassin]\n";
+  if (length($original) > $self->{conf}->{spamcop_max_report_size}*1024) {
+    substr($original,($self->{conf}->{spamcop_max_report_size}*1024)) = "\n[truncated by SpamAssassin]\n";
   }
 
   my $body = <<"EOM";