aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-10-08 16:08:44 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-10-08 16:08:44 +0100
commit2ce612ba70309ab8024f878d33ade87565eca394 (patch)
tree376cdf2ff5191218426d68d816c15d8957945d72 /src
parent5c4438a5bb7656b36cf9c5299cfbfa32f2834b7e (diff)
downloadrspamd-2ce612ba70309ab8024f878d33ade87565eca394.tar.gz
rspamd-2ce612ba70309ab8024f878d33ade87565eca394.zip
[Minor] Do not push invalid real_ip for received
Diffstat (limited to 'src')
-rw-r--r--src/libmime/received.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libmime/received.cxx b/src/libmime/received.cxx
index 74d2e3574..6d3e7b796 100644
--- a/src/libmime/received.cxx
+++ b/src/libmime/received.cxx
@@ -816,7 +816,12 @@ received_export_to_lua(received_header_chain *chain, lua_State *L) -> bool
push_nullable_string(rh.by_hostname, "by_hostname");
push_nullable_string(rh.for_mbox, "for");
- rspamd_lua_ip_push (L, rh.addr);
+ if (rh.addr) {
+ rspamd_lua_ip_push(L, rh.addr);
+ }
+ else {
+ lua_pushnil(L);
+ }
lua_setfield(L, -2, "real_ip");
const auto *proto = "unknown";