]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix modern milter headers format in CGP helper
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 19 Apr 2018 14:10:47 +0000 (15:10 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 19 Apr 2018 14:10:47 +0000 (15:10 +0100)
utils/cgp_rspamd.pl

index 4a4bb928161651384dad58ebfe51fe58e8815219..78ca89462e92a7c22cd7d85a8d1005889dc00d0a 100644 (file)
@@ -94,11 +94,21 @@ sub rspamd_scan {
 
             if ( $block->{'add_headers'} ) {
               while ( my ( $h, $v ) = each( %{ $block->{'add_headers'} } ) ) {
-                if ( $headers eq "" ) {
-                  $headers .= "$h: $v";
+                if (ref($v) eq 'HASH') {
+                  if ($headers eq "") {
+                    $headers .= "$h: $v->{value}";
+                  }
+                  else {
+                    $headers .= "\\e$h: $v->{value}";
+                  }
                 }
                 else {
-                  $headers .= "\\e$h: $v";
+                  if ($headers eq "") {
+                    $headers .= "$h: $v";
+                  }
+                  else {
+                    $headers .= "\\e$h: $v";
+                  }
                 }
               }
             }