From 543b1c25cf4bd5b3e2bd263b53466c644a231b2b Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 2 Jun 2017 16:00:51 +0100 Subject: [PATCH] [Minor] Use modern protocol in CGP helper --- utils/cgp_rspamd.pl | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/utils/cgp_rspamd.pl b/utils/cgp_rspamd.pl index f387dd877..68abc9342 100644 --- a/utils/cgp_rspamd.pl +++ b/utils/cgp_rspamd.pl @@ -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 -- 2.39.5