diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-08-23 11:21:14 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-08-23 11:21:14 +0100 |
commit | f4d26bd0a17cb6e8c6839f4b8cda65257911a93e (patch) | |
tree | 6cf60f5ef8f111554253af0ba7d110e79b03ce73 /src/libserver | |
parent | c352b641b1d28aa33817e524936bf08c8134c633 (diff) | |
download | rspamd-f4d26bd0a17cb6e8c6839f4b8cda65257911a93e.tar.gz rspamd-f4d26bd0a17cb6e8c6839f4b8cda65257911a93e.zip |
[Feature] Support adding and deletion of recipients in the milter block
Diffstat (limited to 'src/libserver')
-rw-r--r-- | src/libserver/milter.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/libserver/milter.c b/src/libserver/milter.c index b44856028..29c13d30a 100644 --- a/src/libserver/milter.c +++ b/src/libserver/milter.c @@ -1640,6 +1640,34 @@ rspamd_milter_process_milter_block (struct rspamd_milter_session *session, g_string_free (hvalue, TRUE); } + elt = ucl_object_lookup (obj, "add_rcpt"); + + if (elt && ucl_object_type (elt) == UCL_ARRAY) { + it = NULL; + + while ((cur = ucl_object_iterate (elt, &it, true)) != NULL) { + hvalue = g_string_new (ucl_object_tostring (cur)); + rspamd_milter_send_action (session, + RSPAMD_MILTER_ADDRCPT, + hvalue); + g_string_free (hvalue, TRUE); + } + } + + elt = ucl_object_lookup (obj, "del_rcpt"); + + if (elt && ucl_object_type (elt) == UCL_ARRAY) { + it = NULL; + + while ((cur = ucl_object_iterate (elt, &it, true)) != NULL) { + hvalue = g_string_new (ucl_object_tostring (cur)); + rspamd_milter_send_action (session, + RSPAMD_MILTER_DELRCPT, + hvalue); + g_string_free (hvalue, TRUE); + } + } + elt = ucl_object_lookup (obj, "reject"); if (elt && ucl_object_type (elt) == UCL_STRING) { |