aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2013-06-03 16:04:27 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2013-06-03 16:04:27 +0100
commitf2c442c62951e1441493797268bb36f5da635ee4 (patch)
treea232155b018feb2cb5eb9b219bd85b4ab30c584a
parent3afb1a6d1a8611afd3781fd3c1dd91182f98d25a (diff)
downloadrspamd-f2c442c62951e1441493797268bb36f5da635ee4.tar.gz
rspamd-f2c442c62951e1441493797268bb36f5da635ee4.zip
Print filename when client scan or learn message from a file.
-rw-r--r--src/client/rspamc.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/client/rspamc.c b/src/client/rspamc.c
index 940f3942c..65179e083 100644
--- a/src/client/rspamc.c
+++ b/src/client/rspamc.c
@@ -295,7 +295,7 @@ show_header_result (gpointer key, gpointer value, gpointer ud)
}
static void
-print_rspamd_result (struct rspamd_result *res)
+print_rspamd_result (struct rspamd_result *res, const gchar *filename)
{
g_assert (res != 0);
@@ -303,6 +303,9 @@ print_rspamd_result (struct rspamd_result *res)
printf ("\033[1m");
}
PRINT_FUNC ("Results for host: %s\n", connect_str);
+ if (filename != NULL) {
+ PRINT_FUNC ("Filename: %s\n", filename);
+ }
if (tty) {
printf ("\033[0m");
}
@@ -374,7 +377,7 @@ scan_rspamd_stdin (void)
fprintf (stderr, "cannot scan message: %s\n", err->message);
exit (EXIT_FAILURE);
}
- print_rspamd_result (res);
+ print_rspamd_result (res, "stdin");
rspamd_free_result (res);
}
@@ -396,7 +399,7 @@ scan_rspamd_file (const gchar *file)
fprintf (stderr, "cannot scan message: %s\n", err->message);
return;
}
- print_rspamd_result (res);
+ print_rspamd_result (res, file);
if (res) {
rspamd_free_result (res);
}
@@ -501,7 +504,8 @@ learn_rspamd_file (gboolean is_spam, const gchar *file)
if (tty) {
printf ("\033[1m");
}
- PRINT_FUNC ("Results for host: %s: %d, %s\n", res->server_name, res->code, res->result->str);
+ PRINT_FUNC ("Results for host: %s: %d, %s, file: %s\n",
+ res->server_name, res->code, res->result->str, file);
if (tty) {
printf ("\033[0m");
}
@@ -610,7 +614,8 @@ fuzzy_rspamd_file (const gchar *file, gboolean delete)
if (tty) {
printf ("\033[1m");
}
- PRINT_FUNC ("Results for host: %s: %d, %s\n", res->server_name, res->code, res->result->str);
+ PRINT_FUNC ("Results for host: %s: %d, %s, file: %s\n",
+ res->server_name, res->code, res->result->str, file);
if (tty) {
printf ("\033[0m");
}