RSPAMD_LOG_FLAG_OPTIONAL = (1 << 0),
RSPAMD_LOG_FLAG_MIME_ALTERNATIVE = (1 << 1),
RSPAMD_LOG_FLAG_CONDITION = (1 << 2),
- RSPAMD_LOG_FLAG_SYMBOLS_SCORES = (1 << 3)
+ RSPAMD_LOG_FLAG_SYMBOLS_SCORES = (1 << 3),
+ RSPAMD_LOG_FLAG_SYMBOLS_PARAMS = (1 << 4)
};
struct rspamd_log_format {
type = RSPAMD_LOG_SYMBOLS;
flags |= RSPAMD_LOG_FLAG_SYMBOLS_SCORES;
}
+ else if (rspamd_ftok_cstr_equal (&tok, "symbols_params", TRUE)) {
+ type = RSPAMD_LOG_SYMBOLS;
+ flags |= RSPAMD_LOG_FLAG_SYMBOLS_PARAMS;
+ }
+ else if (rspamd_ftok_cstr_equal (&tok, "symbols_scores_params", TRUE)) {
+ type = RSPAMD_LOG_SYMBOLS;
+ flags |= RSPAMD_LOG_FLAG_SYMBOLS_PARAMS|RSPAMD_LOG_FLAG_SYMBOLS_SCORES;
+ }
else if (rspamd_ftok_cstr_equal (&tok, "ip", TRUE)) {
type = RSPAMD_LOG_IP;
}
sym = (struct symbol *) v;
if (first) {
- if (lf->flags & RSPAMD_LOG_FLAG_SYMBOLS_SCORES) {
- rspamd_printf_fstring (&symbuf, "%s(%.2f)", sym->name,
- sym->score);
- }
- else {
- rspamd_printf_fstring (&symbuf, "%s", sym->name);
- }
- first = FALSE;
+ rspamd_printf_fstring (&symbuf, "%s", sym->name);
}
else {
- if (lf->flags & RSPAMD_LOG_FLAG_SYMBOLS_SCORES) {
- rspamd_printf_fstring (&symbuf, ",%s(%.2f)", sym->name,
- sym->score);
- }
- else {
- rspamd_printf_fstring (&symbuf, ",%s", sym->name);
+ rspamd_printf_fstring (&symbuf, ",%s", sym->name);
+ }
+
+ if (lf->flags & RSPAMD_LOG_FLAG_SYMBOLS_SCORES) {
+ rspamd_printf_fstring (&symbuf, "(%.2f)", sym->score);
+ }
+
+ if (lf->flags & RSPAMD_LOG_FLAG_SYMBOLS_PARAMS) {
+ GList *cur;
+
+ rspamd_printf_fstring (&symbuf, "{");
+
+ for (cur = sym->options; cur != NULL; cur = g_list_next (cur)) {
+ rspamd_printf_fstring (&symbuf, "%s;", cur->data);
}
+
+ rspamd_printf_fstring (&symbuf, "}");
}
+
+ first = FALSE;
}
rspamd_mempool_add_destructor (task->task_pool,