Skip to content

Commit

Permalink
Merge pull request #3561 from fatalbanana/multimap_disable_multisymbol
Browse files Browse the repository at this point in the history
[Feature] Multimap: support adding map values as extra options
  • Loading branch information
vstakhov committed Nov 28, 2020
2 parents 87f9e50 + 68cb5ea commit 3e6f598
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/plugins/lua/multimap.lua
Expand Up @@ -561,6 +561,15 @@ local function multimap_callback(task, rule)
symbol, rule.symbol, rule.symbol)
symbol = rule.symbol
end
elseif rule.disable_multisymbol then
symbol = rule.symbol
if type(opt) == 'table' then
table.insert(opt, result)
elseif type(opt) ~= nil then
opt = {opt,result}
else
opt = {result}
end
else
forced = true
end
Expand Down
4 changes: 4 additions & 0 deletions test/functional/cases/102_multimap.robot
Expand Up @@ -332,6 +332,10 @@ FREEMAIL_CC
Scan File ${FREEMAIL_CC}
Expect Symbol With Score And Exact Options FREEMAIL_CC 19.00 test.com test1.com test2.com test3.com test4.com test5.com test6.com test7.com test8.com test9.com test10.com test11.com test12.com test13.com test14.com

MAP - MULTISYMBOL DISABLED
Scan File ${MESSAGE} Rcpt=user3@example.com
Expect Symbol With Exact Options RCPT_MAP_NOMULTISYM user3@example.com SYM1

*** Keywords ***
Multimap Setup
${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/multimap.conf
Expand Down
7 changes: 7 additions & 0 deletions test/functional/configs/multimap.conf
Expand Up @@ -56,6 +56,13 @@ multimap {
map = "${TESTDIR}/configs/maps/multiple.list";
score = 1.0;
}
RCPT_MAP_NOMULTISYM {
type = "rcpt";
filter = "email:addr";
disable_multisymbol = true;
map = "${TESTDIR}/configs/maps/multiple.list";
score = 1.0;
}
HEADER_MAP {
type = "header";
header = "To";
Expand Down

0 comments on commit 3e6f598

Please sign in to comment.