From: Vsevolod Stakhov Date: Thu, 17 Feb 2011 15:31:09 +0000 (+0300) Subject: Fix received headers parser state machine to parse headers with only 'by' component. X-Git-Tag: 0.3.7~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8227c09f9486642cd2792e760fe4659e25e05876;p=thirdparty%2Frspamd.git Fix received headers parser state machine to parse headers with only 'by' component. --- diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 8b02ac5e7a..11485aa3e0 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -324,10 +324,11 @@ lua_task_get_received_headers (lua_State * L) cur = g_list_first (task->received); while (cur) { rh = cur->data; - if (rh->is_error || ( + if (rh->is_error || G_UNLIKELY( rh->from_ip == NULL && rh->real_ip == NULL && - rh->real_hostname == NULL)) { + rh->real_hostname == NULL && + rh->by_hostname == NULL)) { cur = g_list_next (cur); continue; } diff --git a/src/message.c b/src/message.c index 323dd33a0f..553ecca518 100644 --- a/src/message.c +++ b/src/message.c @@ -309,6 +309,9 @@ parse_recv_header (memory_pool_t * pool, gchar *line, struct received_header *r) next_state = 1; } } + else if (g_ascii_tolower (*p) == 'b' && g_ascii_tolower (*(p + 1)) == 'y') { + state = 3; + } else { /* This can be qmail header, parse it separately */ parse_qmail_recv (pool, line, r);