summaryrefslogtreecommitdiffstats
path: root/perl
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-15 19:20:45 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-15 19:20:45 +0400
commit205cb6049d86f74707949ac6a3b2de64afe2850a (patch)
tree0c40e3ee9b10f2fab59f873d005dc4f966ec4d04 /perl
parentecbbd935773673d8df1f2cb8334b447f7b834b5a (diff)
downloadrspamd-205cb6049d86f74707949ac6a3b2de64afe2850a.tar.gz
rspamd-205cb6049d86f74707949ac6a3b2de64afe2850a.zip
* Add ability to assign several actions to one metric
* Report action in rspamc protocol * Mail::Rspamd::Client and rspamc can now understand Action header too * Write action to log as well
Diffstat (limited to 'perl')
-rw-r--r--perl/lib/Mail/Rspamd/Client.pm4
1 files changed, 4 insertions, 0 deletions
diff --git a/perl/lib/Mail/Rspamd/Client.pm b/perl/lib/Mail/Rspamd/Client.pm
index ca90b7421..d74484002 100644
--- a/perl/lib/Mail/Rspamd/Client.pm
+++ b/perl/lib/Mail/Rspamd/Client.pm
@@ -943,6 +943,7 @@ sub _do_rspamc_command {
symbols => [],
urls => [],
messages => [],
+ action => 'reject',
};
foreach my $line (@lines) {
if ($line =~ /^Urls: (.+)$/) {
@@ -979,6 +980,9 @@ sub _do_rspamc_command {
my $symref = $metrics{$cur_metric}->{'messages'};
push(@$symref, $1);
}
+ elsif ($line =~ /^Action: (.+)/ && $cur_metric) {
+ $metrics{$cur_metric}->{'action'} = $1;
+ }
elsif ($line =~ /^${EOL}$/) {
last;
}