rspamd_symbols_cache_add_symbol (cfg->cache, bit->symbol,
0, NULL, NULL,
SYMBOL_TYPE_VIRTUAL, parent_id);
- msg_debug ("bit: %d", bit->bit);
+ msg_debug_config ("bit: %d", bit->bit);
}
}
else if (suffix->bits != NULL) {
{
cur = ucl_obj_get_key (cur_rule, "suffix");
if (cur == NULL) {
- msg_err ("surbl rule must have explicit symbol definition");
+ msg_err_config ("surbl rule must have explicit symbol "
+ "definition");
continue;
}
new_suffix = rspamd_mempool_alloc0 (surbl_module_ctx->surbl_pool,
cur = ucl_obj_get_key (cur_rule, "symbol");
if (cur == NULL) {
- msg_warn (
+ msg_warn_config (
"surbl rule for suffix %s lacks symbol, using %s as symbol",
new_suffix->suffix,
DEFAULT_SURBL_SYMBOL);
p ++;
}
- msg_debug ("add new bit suffix: %d with symbol: %s",
+ msg_debug_config ("add new bit suffix: %d with symbol: %s",
(gint)new_bit->bit, new_bit->symbol);
g_array_append_val (new_suffix->bits, *new_bit);
has_subsymbols = TRUE;
sizeof (struct surbl_bit_item));
if (inet_pton (AF_INET, ip_val, &bit) != 1) {
- msg_err ("cannot parse ip %s: %s", ip_val,
+ msg_err_config ("cannot parse ip %s: %s", ip_val,
strerror (errno));
continue;
}
p ++;
}
- msg_debug ("add new IP suffix: %d with symbol: %s",
+ msg_debug_config ("add new IP suffix: %d with symbol: %s",
(gint)new_bit->bit, new_bit->symbol);
g_hash_table_insert (new_suffix->ips, &new_bit->bit,
new_bit);
}
/* Add default suffix */
if (surbl_module_ctx->suffixes == NULL) {
- msg_err ("surbl module loaded but no suffixes defined, skip checks");
+ msg_err_config ("surbl module loaded but no suffixes defined, skip "
+ "checks");
return TRUE;
}
/* This is ip address */
if (suffix != NULL && (suffix->options & SURBL_OPTION_NOIP) != 0) {
/* Ignore such requests */
- msg_info ("ignore request of ip url for list %s", suffix->symbol);
+ msg_info_pool ("ignore request of ip url for list %s",
+ suffix->symbol);
return NULL;
}
result = rspamd_mempool_alloc (pool, len);
/* This is number */
if (suffix != NULL && (suffix->options & SURBL_OPTION_NOIP) != 0) {
/* Ignore such requests */
- msg_info ("ignore request of ip url for list %s", suffix->symbol);
+ msg_info_pool ("ignore request of ip url for list %s",
+ suffix->symbol);
return NULL;
}
rspamd_strlcpy (num_buf, hostname->begin,
errno = 0;
ip_num = strtoull (num_buf, NULL, 10);
if (errno != 0) {
- msg_info ("cannot convert ip to number '%s': %s",
+ msg_info_pool ("cannot convert ip to number '%s': %s",
num_buf,
strerror (errno));
g_set_error (err, SURBL_ERROR, /* error domain */
if (tree != NULL) {
if (g_hash_table_lookup (tree, result) != NULL) {
- msg_debug ("url %s is already registered", result);
+ msg_debug_pool ("url %s is already registered", result);
g_set_error (err, SURBL_ERROR,
DUPLICATE_ERROR,
"URL is duplicated: %s",
if (!forced &&
g_hash_table_lookup (surbl_module_ctx->whitelist, result) != NULL) {
- msg_debug ("url %s is whitelisted", result);
+ msg_debug_pool ("url %s is whitelisted", result);
g_set_error (err, SURBL_ERROR,
WHITELIST_ERROR,
"URL is whitelisted: %s",
rspamd_snprintf (result + r, len - r, ".%s", suffix->suffix);
}
- msg_debug ("request: %s, dots: %d, level: %d, orig: %*s",
+ msg_debug_pool ("request: %s, dots: %d, level: %d, orig: %*s",
result,
dots_num,
level,
}
else if (err != NULL && err->code != WHITELIST_ERROR && err->code !=
DUPLICATE_ERROR) {
- msg_info ("cannot format url string for surbl %s, %e", struri (
+ msg_info_task ("cannot format url string for surbl %s, %e", struri (
url), err);
g_error_free (err);
return;
dns_callback (struct rdns_reply *reply, gpointer arg)
{
struct dns_param *param = (struct dns_param *)arg;
+ struct rspamd_task *task;
struct rdns_reply_entry *elt;
+ task = param->task;
/* If we have result from DNS server, this url exists in SURBL, so increase score */
if (reply->code == RDNS_RC_NOERROR && reply->entries) {
- msg_info ("<%s> domain [%s] is in surbl %s", param->task->message_id,
+ msg_info_task ("<%s> domain [%s] is in surbl %s",
+ param->task->message_id,
param->host_resolve, param->suffix->suffix);
elt = reply->entries;
if (elt->type == RDNS_REQUEST_A) {
}
}
else {
- msg_debug ("<%s> domain [%s] is not in surbl %s",
+ msg_debug_task ("<%s> domain [%s] is not in surbl %s",
param->task->message_id, param->host_resolve,
param->suffix->suffix);
}
GError *err)
{
struct redirector_param *param = (struct redirector_param *)conn->ud;
+ struct rspamd_task *task;
- msg_err ("connection with http server %s terminated incorrectly: %e",
+ task = param->task;
+ msg_err_task ("connection with http server %s terminated incorrectly: %e",
rspamd_inet_address_to_string (rspamd_upstream_addr (param->redirector)),
err);
rspamd_upstream_fail (param->redirector);
struct rspamd_http_message *msg)
{
struct redirector_param *param = (struct redirector_param *)conn->ud;
+ struct rspamd_task *task;
gint r, urllen;
const GString *hdr;
gchar *urlstr;
+ task = param->task;
if (msg->code == 200) {
hdr = rspamd_http_message_find_header (msg, "Uri");
if (hdr != NULL) {
- msg_info ("<%s> got reply from redirector: '%s' -> '%v'",
+ msg_info_task ("<%s> got reply from redirector: '%s' -> '%v'",
param->task->message_id,
struri (param->url),
hdr);
}
}
else {
- msg_info ("<%s> could not resolve '%s' on redirector",
+ msg_info_task ("<%s> could not resolve '%s' on redirector",
param->task->message_id,
struri (param->url));
}
}
if (s == -1) {
- msg_info ("<%s> cannot create tcp socket failed: %s",
+ msg_info_task ("<%s> cannot create tcp socket failed: %s",
task->message_id,
strerror (errno));
make_surbl_requests (url, task, suffix, FALSE, tree);
rspamd_http_connection_write_message (param->conn, msg, NULL,
NULL, param, s, timeout, task->ev_base);
- msg_info (
+ msg_info_task (
"<%s> registered redirector call for %s to %s, according to rule: %s",
task->message_id,
struri (url),