]> source.dussan.org Git - rspamd.git/commitdiff
[Feature] Core: Allow to construct scan tasks from raw data
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 5 Jan 2019 14:25:22 +0000 (14:25 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sat, 5 Jan 2019 14:25:22 +0000 (14:25 +0000)
src/libserver/protocol.c
src/libserver/protocol_internal.h

index 76a41445b2b82542fba463bf8eea07369ccb3eb9..45051ce513459d8b6aad52d83cb57d319d1eaad8 100644 (file)
@@ -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':
index 756b9f68aa948ae131ac3c8cd456294d242ba24d..fb2ee115a355ce4a39486feb933050c7a78f2a9a 100644 (file)
@@ -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