From 019fb16fe874bf95feddb7dd1b19b73aff31816e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sat, 5 Jan 2019 14:25:22 +0000 Subject: [Feature] Core: Allow to construct scan tasks from raw data --- src/libserver/protocol.c | 12 ++++++++++-- src/libserver/protocol_internal.h | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src/libserver') diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index 76a41445b..45051ce51 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -351,8 +351,16 @@ rspamd_protocol_handle_headers (struct rspamd_task *task, msg_debug_protocol ("read rcpt header, value: %V", hv); } - else { - msg_debug_protocol ("wrong header: %V", hn); + IF_HEADER (RAW_DATA_HEADER) { + srch.begin = "yes"; + srch.len = 3; + + msg_debug_protocol ("read raw data header, value: %V", hv); + + if (rspamd_ftok_casecmp (hv_tok, &srch) == 0) { + task->flags &= ~RSPAMD_TASK_FLAG_MIME; + msg_debug_protocol ("disable mime parsing"); + } } break; case 'i': diff --git a/src/libserver/protocol_internal.h b/src/libserver/protocol_internal.h index 756b9f68a..fb2ee115a 100644 --- a/src/libserver/protocol_internal.h +++ b/src/libserver/protocol_internal.h @@ -83,5 +83,6 @@ #define FILENAME_HEADER "Filename" #define CERT_ISSUER_HEADER "TLS-Cert-Issuer" #define MAILER_HEADER "Mailer" +#define RAW_DATA_HEADER "Raw" #endif //RSPAMD_PROTOCOL_INTERNAL_H -- cgit v1.2.3