@@ -1098,8 +1098,14 @@ rspamd_smtp_received_process_part (struct rspamd_task *task, | |||
p ++; | |||
break; | |||
case all_done: | |||
*last = p - (const guchar *)data; | |||
return npart; | |||
if (p > (const guchar *)data) { | |||
*last = p - (const guchar *) data; | |||
return npart; | |||
} | |||
else { | |||
/* Empty element */ | |||
return NULL; | |||
} | |||
break; | |||
} | |||
} | |||
@@ -1120,9 +1126,11 @@ rspamd_smtp_received_process_part (struct rspamd_task *task, | |||
} | |||
break; | |||
case skip_spaces: | |||
*last = p - (const guchar *)data; | |||
if (p > c) { | |||
*last = p - (const guchar *) data; | |||
return npart; | |||
return npart; | |||
} | |||
default: | |||
break; | |||
} |
@@ -121,7 +121,14 @@ context("Received headers parser", function() | |||
{ | |||
by_hostname = 'example.com', | |||
}, | |||
} | |||
}, | |||
{[[from 171-29.br (1-1-1-1.z.com.br [1.1.1.1]) by x.com.br (Postfix) with;ESMTP id 44QShF6xj4z1X for <y.br>; Thu, 21 Mar 2019 23:45:46 -0300 : <g @yi.br>]], | |||
{ | |||
from_hostname = '171-29.br', | |||
real_ip = '1.1.1.1', | |||
by_hostname = 'x.com.br', | |||
} | |||
}, | |||
} | |||
local task = ffi.C.rspamd_task_new(nil, nil) |