diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-01-05 14:25:22 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-01-05 14:25:22 +0000 |
commit | 019fb16fe874bf95feddb7dd1b19b73aff31816e (patch) | |
tree | b19993c51cceaa9113f539a29fb31a34d509bb7f /src/libserver | |
parent | d159074e35b6dd8d3fd2a27f106aa3e12fe92445 (diff) | |
download | rspamd-019fb16fe874bf95feddb7dd1b19b73aff31816e.tar.gz rspamd-019fb16fe874bf95feddb7dd1b19b73aff31816e.zip |
[Feature] Core: Allow to construct scan tasks from raw data
Diffstat (limited to 'src/libserver')
-rw-r--r-- | src/libserver/protocol.c | 12 | ||||
-rw-r--r-- | src/libserver/protocol_internal.h | 1 |
2 files changed, 11 insertions, 2 deletions
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 |