aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-08-23 16:31:22 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-08-23 16:31:52 +0100
commit50753081cc9a6fc30d3be8ad7979c8d1000132fd (patch)
tree3498ac0e3dddd98dc5b7c624eec41f8abefb72c2 /src
parent233c911bdf5ee87abbe9955eb1b9dc20aab93c7b (diff)
downloadrspamd-50753081cc9a6fc30d3be8ad7979c8d1000132fd.tar.gz
rspamd-50753081cc9a6fc30d3be8ad7979c8d1000132fd.zip
[Minor] Implement better support of indexes in adding of headers
Diffstat (limited to 'src')
-rw-r--r--src/libserver/milter.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libserver/milter.c b/src/libserver/milter.c
index 05525fe5d..fac46da1a 100644
--- a/src/libserver/milter.c
+++ b/src/libserver/milter.c
@@ -1638,6 +1638,19 @@ rspamd_milter_process_milter_block (struct rspamd_milter_session *session,
}
else {
/* Calculate negative offset */
+
+ if (-idx <= priv->cur_hdr) {
+ rspamd_milter_send_action (session,
+ RSPAMD_MILTER_INSHEADER,
+ priv->cur_hdr + idx + 1,
+ hname, hvalue);
+ }
+ else {
+ rspamd_milter_send_action (session,
+ RSPAMD_MILTER_INSHEADER,
+ 0,
+ hname, hvalue);
+ }
}
}
else {