summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-01-21 19:50:12 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-01-21 19:50:12 +0300
commitb3633b1c36431980afe45b5a139ddefe4300f2fc (patch)
treee4741c04b2bedbaefb3842367f57b0561b6b4ca5 /src
parentb2ac22cb599cbba8fc056aa1ebecbdd8735699a1 (diff)
downloadrspamd-b3633b1c36431980afe45b5a139ddefe4300f2fc.tar.gz
rspamd-b3633b1c36431980afe45b5a139ddefe4300f2fc.zip
Increase limits for spf parser.
Add logging for views.
Diffstat (limited to 'src')
-rw-r--r--src/spf.c4
-rw-r--r--src/view.c7
2 files changed, 9 insertions, 2 deletions
diff --git a/src/spf.c b/src/spf.c
index fcbefeab2..0f89e7513 100644
--- a/src/spf.c
+++ b/src/spf.c
@@ -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:
diff --git a/src/view.c b/src/view.c
index ec4bb1082..b24c26b28 100644
--- a/src/view.c
+++ b/src/view.c
@@ -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);