]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Use modern protocol in CGP helper
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 2 Jun 2017 15:00:51 +0000 (16:00 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 2 Jun 2017 15:00:51 +0000 (16:00 +0100)
utils/cgp_rspamd.pl

index f387dd877c50efa6f8cec5cd3d39fcd4aa5051a2..68abc9342248e6001acc8d1512255f431b257842 100644 (file)
@@ -77,10 +77,8 @@ sub rspamd_scan {
           my $id     = $js->{'message-id'};
 
           my $symbols = "";
-          while ( my ( $k, $s ) = each( %{$def} ) ) {
-            if ( ref($s) eq "HASH" && $s->{'score'} ) {
-              $symbols .= sprintf "%s(%.2f);", $k, $s->{'score'};
-            }
+          while ( my ( $k, $s ) = each( %{$def->{'symbols'}}) ) {
+            $symbols .= sprintf "%s(%.2f);", $k, $s->{'score'};
           }
 
           printf
@@ -91,8 +89,8 @@ sub rspamd_scan {
             $headers .= "DKIM-Signature: " . $js->{'dkim-signature'};
           }
 
-          if ( $js->{'rmilter'} ) {
-            my $block = $js->{'rmilter'};
+          if ( $js->{'milter'} ) {
+            my $block = $js->{'milter'};
 
             if ( $block->{'add_headers'} ) {
               while ( my ( $h, $v ) = each( %{ $block->{'add_headers'} } ) ) {
@@ -216,7 +214,7 @@ sub rspamd_scan {
         }
 
         http_post(
-          "http://$rspamd_host/symbols", $data,
+          "http://$rspamd_host/checkv2", $data,
           timeout => $request_timeout,
           headers => $headers,
           $http_callback