From: Vsevolod Stakhov Date: Thu, 17 Feb 2011 14:33:15 +0000 (+0300) Subject: Fix received headers passing to lua. X-Git-Tag: 0.3.7~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=535231642d8fbe5f65052507e4527ea1d28d4657;p=thirdparty%2Frspamd.git Fix received headers passing to lua. --- diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 892bbdf073..8b02ac5e7a 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -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);