summaryrefslogtreecommitdiffstats
path: root/src/cfg_xml.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-10-20 22:26:34 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-10-20 22:26:34 +0400
commit7a09c641f8caaefa697013540166f0a7f3857321 (patch)
treeece6ade382dd4acb53f275a34fe47c590e8ff617 /src/cfg_xml.c
parent2f23fd64a793f818300bb645beb16f1a01528d31 (diff)
downloadrspamd-7a09c641f8caaefa697013540166f0a7f3857321.tar.gz
rspamd-7a09c641f8caaefa697013540166f0a7f3857321.zip
* Add ability to recursive scan over multipart's parts for functions:
- content_type_is_type - content_type_is_subtype - content_type_compare_param - content_type_has_param * Add ability to specify any of actions in user's settings, not only reject.
Diffstat (limited to 'src/cfg_xml.c')
-rw-r--r--src/cfg_xml.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/src/cfg_xml.c b/src/cfg_xml.c
index 5e0d69a4c..2e762ba1e 100644
--- a/src/cfg_xml.c
+++ b/src/cfg_xml.c
@@ -690,28 +690,6 @@ worker_handle_bind (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GH
return TRUE;
}
-static inline gboolean
-check_action (const gchar *data, gint *result)
-{
- if (g_ascii_strncasecmp (data, "reject", sizeof ("reject") - 1) == 0) {
- *result = METRIC_ACTION_REJECT;
- }
- else if (g_ascii_strncasecmp (data, "greylist", sizeof ("greylist") - 1) == 0) {
- *result = METRIC_ACTION_GREYLIST;
- }
- else if (g_ascii_strncasecmp (data, "add_header", sizeof ("add_header") - 1) == 0) {
- *result = METRIC_ACTION_ADD_HEADER;
- }
- else if (g_ascii_strncasecmp (data, "rewrite_subject", sizeof ("rewrite_subject") - 1) == 0) {
- *result = METRIC_ACTION_REWRITE_SUBJECT;
- }
- else {
- msg_err ("unknown action for metric: %s", data);
- return FALSE;
- }
- return TRUE;
-}
-
gboolean
handle_metric_action (struct config_file *cfg, struct rspamd_xml_userdata *ctx, GHashTable *attrs, gchar *data, gpointer user_data, gpointer dest_struct, gint offset)
{
@@ -722,14 +700,14 @@ handle_metric_action (struct config_file *cfg, struct rspamd_xml_userdata *ctx,
/* First of all check whether we have data with weight (reject:50 for example) */
if ((p = strchr (data, ':')) == NULL) {
- if (check_action (data, &res)) {
+ if (check_action_str (data, &res)) {
metric->action = res;
return TRUE;
}
return FALSE;
}
else {
- if (!check_action (data, &res)) {
+ if (!check_action_str (data, &res)) {
return FALSE;
}
else {