From 523def594e31dd5b29e0899f51d69b8f940ffbc2 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 19 Apr 2018 15:10:47 +0100 Subject: [PATCH] [Minor] Fix modern milter headers format in CGP helper --- utils/cgp_rspamd.pl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/utils/cgp_rspamd.pl b/utils/cgp_rspamd.pl index 4a4bb9281..78ca89462 100644 --- a/utils/cgp_rspamd.pl +++ b/utils/cgp_rspamd.pl @@ -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"; + } } } } -- 2.39.5