Bug 2859 - Add "Required-Hits:" to spamd communication protocol
Summary: Add "Required-Hits:" to spamd communication protocol
Status: RESOLVED WONTFIX
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamc/spamd (show other bugs)
Version: 2.60
Hardware: All All
: P5 enhancement
Target Milestone: 3.0.0
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 3208
  Show dependency tree
 
Reported: 2003-12-19 12:40 UTC by Mike Wade
Modified: 2004-04-28 14:12 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Wade 2003-12-19 12:40:04 UTC
I have a custom written MDA that:

1) Queries a SQL server containing the domain / user configuration.
2) Connects to spamd for message processing.

"spamd" doesn't need to be smart enough to pull the per domain / user config 
but I do need a way to pass the "required hits" threshold to "spamd" via the 
communication protocol.  That's what this patch allows:

*** spamd.orig	Fri Dec 19 11:32:31 2003
--- spamd	Fri Dec 19 15:15:42 2003
***************
*** 606,611 ****
--- 606,612 ----
      my ($method, $version, $start) = @_;
      local ($_);
      my $expected_length;
+     my $required_hits;
  
      # Protocol version 1.0 and greater may have "User:" and
      # "Content-length:" headers.  But they're not required.
***************
*** 657,662 ****
--- 658,666 ----
  	    if (/^Content-length: ([0-9]*)\r\n/i) {
  		$expected_length = $1;
  	    }
+ 	    if (/^Required-Hits: (\S*)\r\n/i) {
+ 		$required_hits = $1 + 0.00;
+ 	    }
  	}
      }
  
***************
*** 719,724 ****
--- 723,733 ----
      if($expected_length && ($actual_length != $expected_length)) {
          protocol_error ("(Content-Length mismatch: Expected $expected_length 
bytes, got $actual_length bytes)");
          return 1;
+     }
+ 
+     # If connecting client specified required-hits then update the conf
+     if (defined($required_hits)) {
+  	$spamtest->{conf}->{required_hits} = $required_hits;
      }
  
      # Now use copy-on-writed (hopefully) SA object
Comment 1 Theo Van Dinter 2004-04-28 22:12:33 UTC
after discussion, we decided to close this ticket as "wontfix".  the addition 1) doesn't have a general 
benefit to people, and 2) is a kluge (strong-arming the configuration is always a kluge...)