diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-02 16:00:51 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-02 16:00:51 +0100 |
commit | 543b1c25cf4bd5b3e2bd263b53466c644a231b2b (patch) | |
tree | 4116ff6c7aa214922ad347008030086a31e1062e /utils/cgp_rspamd.pl | |
parent | 1dce67d97a586c8556098f2f26709982509af513 (diff) | |
download | rspamd-543b1c25cf4bd5b3e2bd263b53466c644a231b2b.tar.gz rspamd-543b1c25cf4bd5b3e2bd263b53466c644a231b2b.zip |
[Minor] Use modern protocol in CGP helper
Diffstat (limited to 'utils/cgp_rspamd.pl')
-rw-r--r-- | utils/cgp_rspamd.pl | 12 |
1 files 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 |