diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-04-19 15:10:47 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-04-19 15:10:47 +0100 |
commit | 523def594e31dd5b29e0899f51d69b8f940ffbc2 (patch) | |
tree | ca52512a11e775cf3d4fe6e356e7cda87f1bb8d7 /utils/cgp_rspamd.pl | |
parent | 833b11676e05d34d42e0fabb9a1651b81fa276ea (diff) | |
download | rspamd-523def594e31dd5b29e0899f51d69b8f940ffbc2.tar.gz rspamd-523def594e31dd5b29e0899f51d69b8f940ffbc2.zip |
[Minor] Fix modern milter headers format in CGP helper
Diffstat (limited to 'utils/cgp_rspamd.pl')
-rw-r--r-- | utils/cgp_rspamd.pl | 16 |
1 files 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"; + } } } } |