summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorcebka@lenovo-laptop <cebka@lenovo-laptop>2010-02-17 18:57:05 +0300
committercebka@lenovo-laptop <cebka@lenovo-laptop>2010-02-17 18:57:05 +0300
commit94edb9f04b2144be4a78556653451456738ba767 (patch)
tree59418513a28438035b0cdde8ef408622ebb2f52b /src/plugins
parent3ec2330431b62e442f4fdea41cacab152cbcee55 (diff)
downloadrspamd-94edb9f04b2144be4a78556653451456738ba767.tar.gz
rspamd-94edb9f04b2144be4a78556653451456738ba767.zip
* Add ability to add custom messages to rspamd output
* Add messages from spf checks
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/fuzzy_check.c8
-rw-r--r--src/plugins/spf.c3
2 files changed, 5 insertions, 6 deletions
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c
index 987a2cb40..40b1aaa79 100644
--- a/src/plugins/fuzzy_check.c
+++ b/src/plugins/fuzzy_check.c
@@ -490,7 +490,7 @@ fuzzy_controller_handler (char **args, struct controller_session *session, int c
{
char *arg, out_buf[BUFSIZ], *err_str;
uint32_t size;
- int r, value, *sargs;
+ int r, value = 1, *sargs;
/* Process size */
arg = args[0];
@@ -510,11 +510,7 @@ fuzzy_controller_handler (char **args, struct controller_session *session, int c
}
/* Process value */
arg = args[1];
- if (!arg || *arg == '\0') {
- msg_info ("empty value, assume it 1");
- value = 1;
- }
- else {
+ if (arg && *arg != '\0') {
value = strtol (arg, &err_str, 10);
}
diff --git a/src/plugins/spf.c b/src/plugins/spf.c
index ae762f12a..57a6f4407 100644
--- a/src/plugins/spf.c
+++ b/src/plugins/spf.c
@@ -155,13 +155,16 @@ spf_plugin_callback (struct spf_record *record, struct worker_task *task)
switch (addr->mech) {
case SPF_FAIL:
insert_result (task, spf_module_ctx->metric, spf_module_ctx->symbol_fail, 1, g_list_prepend (NULL, addr->spf_string));
+ task->messages = g_list_prepend (task->messages, "(SPF): spf fail");
break;
case SPF_SOFT_FAIL:
case SPF_NEUTRAL:
insert_result (task, spf_module_ctx->metric, spf_module_ctx->symbol_softfail, 1, g_list_prepend (NULL, addr->spf_string));
+ task->messages = g_list_prepend (task->messages, "(SPF): spf softfail");
break;
default:
insert_result (task, spf_module_ctx->metric, spf_module_ctx->symbol_allow, 1, g_list_prepend (NULL, addr->spf_string));
+ task->messages = g_list_prepend (task->messages, "(SPF): spf allow");
break;
}
/* Stop parsing */