]> source.dussan.org Git - rspamd.git/commitdiff
Fix received headers passing to lua.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 17 Feb 2011 14:33:15 +0000 (17:33 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 17 Feb 2011 14:33:15 +0000 (17:33 +0300)
src/lua/lua_task.c

index 892bbdf0736193b0964fc23660d7d73f70981449..8b02ac5e7adad32f758e1d33ceee1a38d14a87db 100644 (file)
@@ -324,6 +324,13 @@ lua_task_get_received_headers (lua_State * L)
                cur = g_list_first (task->received);
                while (cur) {
                        rh = cur->data;
+                       if (rh->is_error || (
+                                       rh->from_ip == NULL &&
+                                       rh->real_ip == NULL &&
+                                       rh->real_hostname == NULL)) {
+                               cur = g_list_next (cur);
+                               continue;
+                       }
                        lua_newtable (L);
                        lua_set_table_index (L, "from_hostname", rh->from_hostname);
                        lua_set_table_index (L, "from_ip", rh->from_ip);