From 44be618c375a591655a90843f4abefea7201d348 Mon Sep 17 00:00:00 2001 From: Andrej Zverev Date: Fri, 18 Nov 2016 22:59:27 +0300 Subject: [PATCH] Allow processing MTA-Tag header from Rmilter and saving it under 'MTA-Tag' name inside mempool. Your can access it from lua via task:get_mempool():get_variable("MTA-Tag") --- src/libserver/protocol.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index e4a042610..f33422dfe 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -99,6 +99,7 @@ #define NO_LOG_HEADER "Log" #define MLEN_HEADER "Message-Length" #define USER_AGENT_HEADER "User-Agent" +#define MTA_TAG_HEADER "MTA-Tag" static GQuark @@ -471,6 +472,13 @@ rspamd_protocol_handle_headers (struct rspamd_task *task, task->flags |= RSPAMD_TASK_FLAG_HAS_CONTROL; } } + IF_HEADER (MTA_TAG_HEADER) { + gchar *mta_tag; + mta_tag = rspamd_mempool_ftokdup (task->task_pool, hv_tok); + rspamd_mempool_set_variable (task->task_pool, "MTA-Tag", + mta_tag, NULL); + debug_task ("read MTA-Tag header, value: %s", mta_tag); + } break; default: debug_task ("unknown header: %V", hn); -- 2.39.5