ffi.cdef[[
typedef struct rspamd_inet_addr_s rspamd_inet_addr_t;
bool rspamd_parse_inet_address (rspamd_inet_addr_t **target,
- const char *src);
+ const char *src, size_t len);
void rspamd_inet_address_free (rspamd_inet_addr_t *addr);
]]
for i,c in ipairs(cases) do
test("Create inet addr from string " .. c[1] .. '; expect ' .. tostring(c[2]), function()
local ip = ffi.new("rspamd_inet_addr_t* [1]");
- local res = ffi.C.rspamd_parse_inet_address(ip, c[1])
+ local res = ffi.C.rspamd_parse_inet_address(ip, c[1], #c[1])
assert_equal(res, c[2], "Expect " .. tostring(c[2]) .. " while parsing " .. c[1])
if res then
ffi.C.rspamd_inet_address_free(ip[0])
by_hostname = 'mail01.someotherdomain.org',
}
},
+ {[[from example.com ([]) by example.com with ESMTP id 2019091111 ; Thu, 26 Sep 2019 11:19:07 +0200]],
+ {
+ by_hostname = 'example.com',
+ },
+ }
}
local task = ffi.C.rspamd_task_new(nil, nil)