summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-11-28 12:16:53 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-11-28 12:16:53 +0000
commit449b77cc82eacd9928f1fee7f4559eeb048c284b (patch)
treeb7aad4580e13ff932b151de5c6ac6832fb2060b3
parent5367d1ed1e71a0c5011e7f366de7c466b2b8e1e6 (diff)
downloadrspamd-449b77cc82eacd9928f1fee7f4559eeb048c284b.tar.gz
rspamd-449b77cc82eacd9928f1fee7f4559eeb048c284b.zip
[Minor] Fix task:set_recipients when the original recipients are absent
-rw-r--r--src/lua/lua_task.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index 48006fa84..d3e08dee4 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -3703,7 +3703,13 @@ lua_task_set_recipients (lua_State *L)
switch (what) {
case RSPAMD_ADDRESS_SMTP:
/* Here we check merely envelope rcpt */
- ptrs = task->rcpt_envelope;
+ if (task->rcpt_envelope) {
+ ptrs = task->rcpt_envelope;
+ }
+ else {
+ ptrs = g_ptr_array_new ();
+ task->rcpt_envelope = ptrs;
+ }
break;
case RSPAMD_ADDRESS_MIME:
/* Here we check merely mime rcpt */
@@ -3713,7 +3719,13 @@ lua_task_set_recipients (lua_State *L)
case RSPAMD_ADDRESS_ANY:
default:
if (task->rcpt_envelope) {
- ptrs = task->rcpt_envelope;
+ if (task->rcpt_envelope) {
+ ptrs = task->rcpt_envelope;
+ }
+ else {
+ ptrs = g_ptr_array_new ();
+ task->rcpt_envelope = ptrs;
+ }
}
else {
ptrs = MESSAGE_FIELD_CHECK (task, rcpt_mime);