diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-11-28 17:52:16 +0300 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-11-28 17:52:16 +0300 |
commit | afd505282b65a900b99113138e63fad6193ed3c9 (patch) | |
tree | 5bc53e15e4d9a84dbc6725de9539168faa67f36f /src/protocol.c | |
parent | 287067006bf2b44b9a68f3dd9d24414f4902e225 (diff) | |
download | rspamd-afd505282b65a900b99113138e63fad6193ed3c9.tar.gz rspamd-afd505282b65a900b99113138e63fad6193ed3c9.zip |
Fix log_urls setting.
Diffstat (limited to 'src/protocol.c')
-rw-r--r-- | src/protocol.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/protocol.c b/src/protocol.c index 73f8b9de6..70ba1bd83 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -651,6 +651,7 @@ struct tree_cb_data { gchar *buf; gsize len; gsize off; + struct worker_task *task; }; /* @@ -672,6 +673,12 @@ urls_protocol_cb (gpointer key, gpointer value, gpointer ud) cb->off += rspamd_snprintf (cb->buf + cb->off, cb->len - cb->off, " %*s,", url->hostlen, url->host); } + + if (cb->task->cfg->log_urls) { + msg_info ("<%s> URL: %s - %s: %s", cb->task->message_id, cb->task->user ? + cb->task->user : "unknown", inet_ntoa (cb->task->client_addr), struri (url)); + } + return FALSE; } @@ -687,6 +694,7 @@ show_url_header (struct worker_task *task) cb.buf = outbuf; cb.len = sizeof (outbuf); cb.off = r; + cb.task = task; g_tree_foreach (task->urls, urls_protocol_cb, &cb); /* Strip last ',' */ @@ -736,6 +744,7 @@ show_email_header (struct worker_task *task) cb.buf = outbuf; cb.len = sizeof (outbuf); cb.off = r; + cb.task = task; g_tree_foreach (task->emails, emails_protocol_cb, &cb); /* Strip last ',' */ |