]> source.dussan.org Git - rspamd.git/commitdiff
Add 'allow_raw_input' option
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 12 Nov 2015 14:24:51 +0000 (14:24 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 12 Nov 2015 14:24:51 +0000 (14:24 +0000)
conf/options.inc
src/libserver/cfg_file.h
src/libserver/cfg_rcl.c
src/libserver/cfg_utils.c

index fb314d0cf24bca8355a5999a6fcf6ae65b465e3e..798e658d6fc1f935ed152416ad000cfc286a6b7b 100644 (file)
@@ -25,3 +25,5 @@ classify_headers = [
 control_socket = "$DBDIR/rspamd.sock mode=0600";
 history_rows = 200;
 explicit_modules = ["settings"];
+# Scan messages even if they are not MIME
+allow_raw_input = true;
index 9e1164175236db69164a8e89b9221fce2d09c6c5..7036fd5526cf57e500d635eb2ecbde6b5808da9a 100644 (file)
@@ -222,6 +222,7 @@ struct rspamd_config {
        gboolean convert_config;                        /**< convert config to XML format                                               */
        gboolean strict_protocol_headers;               /**< strictly check protocol headers                                    */
        gboolean check_all_filters;                     /**< check all filters                                                                  */
+       gboolean allow_raw_input;                       /**< scan messages with invalid mime                                    */
 
        gsize max_diff;                                 /**< maximum diff size for text parts                                   */
 
index 42830d7003401de4e65c0621bfb7ab99203a31f3..eec9c0fc6999476fa12cb312f616f161c47e9668 100644 (file)
@@ -1314,6 +1314,11 @@ rspamd_rcl_config_init (void)
                rspamd_rcl_parse_struct_string_list,
                G_STRUCT_OFFSET (struct rspamd_config, explicit_modules),
                RSPAMD_CL_FLAG_STRING_LIST_HASH);
+       rspamd_rcl_add_default_handler (sub,
+               "allow_raw_input",
+               rspamd_rcl_parse_struct_boolean,
+               G_STRUCT_OFFSET (struct rspamd_config, allow_raw_input),
+               0);
 
        /* New DNS configuration */
        ssub = rspamd_rcl_add_section (&sub->subsections, "dns", NULL, NULL,
index 65317b9cdf867a6a86cf34f6912a9855e6043d62..568efe934c004231a1acb2994a1311e9ff294ee4 100644 (file)
@@ -183,6 +183,8 @@ rspamd_config_defaults (struct rspamd_config *cfg)
                        "$if_user{ user: $,}$if_smtp_from{ from: <$>,} (default: $is_spam "
                        "($action): [$scores] [$symbols]), len: $len, time: $time_real real,"
                        " $time_virtual virtual, dns req: $dns_req";
+       /* Allow non-mime input by default */
+       cfg->allow_raw_input = TRUE;
 }
 
 void