]> source.dussan.org Git - rspamd.git/commitdiff
* Strip trailing whitespace characters in Mail::Rspamd::Client
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 20 Jul 2010 14:28:03 +0000 (18:28 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Tue, 20 Jul 2010 14:28:03 +0000 (18:28 +0400)
perl/lib/Mail/Rspamd/Client.pm

index d74484002d5c8de3a3a0fc2271f595146cfe156f..7f32cd6ee937e07ac6231f7d03f05a4027fce6cd 100644 (file)
@@ -964,23 +964,23 @@ sub _do_rspamc_command {
                                };
                                $cur_metric = $1;
                        }
-                       elsif ($line =~ /^Symbol: (\S+);\s*(.+)${EOL}$/ && $cur_metric) {
+                       elsif ($line =~ /^Symbol: (\S+);\s*(.+)\s*${EOL}$/ && $cur_metric) {
                                # Line with parameters
                                my $symref = $metrics{$cur_metric}->{'symbols'};
                                push(@$symref, "$1($2)");
                        }
-                       elsif ($line =~ /^Symbol: (\S+)/ && $cur_metric) {
+                       elsif ($line =~ /^Symbol: (\S+)\s*/ && $cur_metric) {
                                my $symref = $metrics{$cur_metric}->{'symbols'};
                                push(@$symref, $1);
                        }
-                       elsif ($line =~ /^Urls: (.+)$/ && $cur_metric) {
+                       elsif ($line =~ /^Urls: (.+)\s*$/ && $cur_metric) {
                                @{ $metrics{$cur_metric}->{'urls'} } = split /,\s+/, $1;
                        }
-                       elsif ($line =~ /^Message: (.+)/ && $cur_metric) {
+                       elsif ($line =~ /^Message: (.+)\s*$/ && $cur_metric) {
                                my $symref = $metrics{$cur_metric}->{'messages'};
                                push(@$symref, $1);
                        }
-                       elsif ($line =~ /^Action: (.+)/ && $cur_metric) {
+                       elsif ($line =~ /^Action: (.+)\s*$/ && $cur_metric) {
                                $metrics{$cur_metric}->{'action'} = $1;
                        }
                        elsif ($line =~ /^${EOL}$/) {