aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-04-19 15:10:47 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-04-19 15:10:47 +0100
commit523def594e31dd5b29e0899f51d69b8f940ffbc2 (patch)
treeca52512a11e775cf3d4fe6e356e7cda87f1bb8d7 /utils
parent833b11676e05d34d42e0fabb9a1651b81fa276ea (diff)
downloadrspamd-523def594e31dd5b29e0899f51d69b8f940ffbc2.tar.gz
rspamd-523def594e31dd5b29e0899f51d69b8f940ffbc2.zip
[Minor] Fix modern milter headers format in CGP helper
Diffstat (limited to 'utils')
-rw-r--r--utils/cgp_rspamd.pl16
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";
+ }
}
}
}