]> source.dussan.org Git - rspamd.git/commitdiff
Allow processing MTA-Tag header from Rmilter and saving it under 'MTA-Tag' name insid...
authorAndrej Zverev <andrej.zverev@gmail.com>
Fri, 18 Nov 2016 19:59:27 +0000 (22:59 +0300)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 18 Nov 2016 21:20:21 +0000 (21:20 +0000)
src/libserver/protocol.c

index e4a042610278ef61a2aabd7720ca770085c392df..f33422dfe50b469a214aae378e0c1c93a1395a0a 100644 (file)
@@ -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);