From 523def594e31dd5b29e0899f51d69b8f940ffbc2 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 19 Apr 2018 15:10:47 +0100 Subject: [Minor] Fix modern milter headers format in CGP helper --- utils/cgp_rspamd.pl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'utils/cgp_rspamd.pl') 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"; + } } } } -- cgit v1.2.3