From: Vsevolod Stakhov Date: Fri, 2 Jun 2017 15:00:51 +0000 (+0100) Subject: [Minor] Use modern protocol in CGP helper X-Git-Tag: 1.6.0~71 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=543b1c25cf4bd5b3e2bd263b53466c644a231b2b;p=rspamd.git [Minor] Use modern protocol in CGP helper --- 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