]> source.dussan.org Git - rspamd.git/commitdiff
Fix received headers parser state machine to parse headers with only 'by' component.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 17 Feb 2011 15:31:09 +0000 (18:31 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 17 Feb 2011 15:31:09 +0000 (18:31 +0300)
src/lua/lua_task.c
src/message.c

index 8b02ac5e7adad32f758e1d33ceee1a38d14a87db..11485aa3e08f0747bdb8998ca249542a89bdcd8e 100644 (file)
@@ -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;
                        }
index 323dd33a0fe01ad1d8e8df84e34ddb076aa3a1c8..553ecca518f4fa1ee41dfe7ec392bdee90962e6d 100644 (file)
@@ -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);