From: Andrej Zverev Date: Fri, 18 Nov 2016 19:59:27 +0000 (+0300) Subject: Allow processing MTA-Tag header from Rmilter and saving it under 'MTA-Tag' name insid... X-Git-Tag: 1.4.0~16 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=44be618c375a591655a90843f4abefea7201d348;p=rspamd.git 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") --- 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);