Browse Source

Increase limits for spf parser.

Add logging for views.
tags/0.3.7
Vsevolod Stakhov 13 years ago
parent
commit
b3633b1c36
2 changed files with 9 additions and 2 deletions
  1. 2
    2
      src/spf.c
  2. 7
    0
      src/view.c

+ 2
- 2
src/spf.c View File

@@ -45,8 +45,8 @@
#define SPF_EXP "exp"

/** SPF limits for avoiding abuse **/
#define SPF_MAX_NESTING 5
#define SPF_MAX_DNS_REQUESTS 10
#define SPF_MAX_NESTING 10
#define SPF_MAX_DNS_REQUESTS 30

/**
* State machine for SPF record:

+ 7
- 0
src/view.c View File

@@ -165,6 +165,7 @@ find_view_by_client_ip (GList * views, struct worker_task *task)
while (cur) {
v = cur->data;
if (radix32tree_find (v->client_ip_tree, ntohl (task->client_addr.s_addr)) != RADIX_NO_VALUE) {
msg_info ("found view for client ip %s", inet_ntoa (task->client_addr));
return v;
}
cur = g_list_next (cur);
@@ -189,6 +190,7 @@ find_view_by_from (GList * views, struct worker_task *task)
v = cur->data;
/* First try to lookup in hashtable */
if (g_hash_table_lookup (v->from_hash, task->from) != NULL) {
msg_info ("found view for client from %s", task->from);
return v;
}
/* Then try to match re */
@@ -197,6 +199,7 @@ find_view_by_from (GList * views, struct worker_task *task)
while (cur_re) {
re = cur_re->data;
if (g_regex_match (re->regexp, task->from, 0, NULL) == TRUE) {
msg_info ("found view for client from %s", task->from);
return v;
}
cur_re = g_list_next (cur_re);
@@ -223,6 +226,7 @@ check_view_rcpt (struct rspamd_view *v, struct worker_task *task)
rcpt_user[l] = '\0';
/* First try to lookup in hashtable */
if (g_hash_table_lookup (v->rcpt_hash, rcpt_user) != NULL) {
msg_info ("found view for client rcpt %s", rcpt_user);
return TRUE;
}
/* Then try to match re */
@@ -231,6 +235,7 @@ check_view_rcpt (struct rspamd_view *v, struct worker_task *task)
while (cur_re) {
re = cur_re->data;
if (g_regex_match (re->regexp, rcpt_user, 0, NULL) == TRUE) {
msg_info ("found view for client rcpt %s", rcpt_user);
return TRUE;
}
cur_re = g_list_next (cur_re);
@@ -238,6 +243,7 @@ check_view_rcpt (struct rspamd_view *v, struct worker_task *task)
}
/* Now check the whole recipient */
if (g_hash_table_lookup (v->rcpt_hash, cur->data) != NULL) {
msg_info ("found view for client rcpt %s", rcpt_user);
return TRUE;
}
/* Then try to match re */
@@ -246,6 +252,7 @@ check_view_rcpt (struct rspamd_view *v, struct worker_task *task)
while (cur_re) {
re = cur_re->data;
if (g_regex_match (re->regexp, cur->data, 0, NULL) == TRUE) {
msg_info ("found view for client rcpt %s", rcpt_user);
return TRUE;
}
cur_re = g_list_next (cur_re);

Loading…
Cancel
Save