summaryrefslogtreecommitdiffstats
path: root/rules/bitcoin.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-11 10:03:06 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2019-10-11 10:03:06 +0100
commit14c904d120fa5f4ce1feb2ce8c6c0f035c52ca61 (patch)
tree8fa55af9fef0d94edd94420a51b818cbca70e2b4 /rules/bitcoin.lua
parentd9f755c976a708b8a9836ed83f05bdd290b55d54 (diff)
downloadrspamd-14c904d120fa5f4ce1feb2ce8c6c0f035c52ca61.tar.gz
rspamd-14c904d120fa5f4ce1feb2ce8c6c0f035c52ca61.zip
[Rules] Catch LTC addresses
Diffstat (limited to 'rules/bitcoin.lua')
-rw-r--r--rules/bitcoin.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/rules/bitcoin.lua b/rules/bitcoin.lua
index 431415d42..0b611796d 100644
--- a/rules/bitcoin.lua
+++ b/rules/bitcoin.lua
@@ -32,18 +32,27 @@ rspamd_config:register_symbol{
local rspamd_re = require "rspamd_regexp"
local hash = require "rspamd_cryptobox_hash"
- local wallet_re = rspamd_re.create_cached('^[13][1-9A-Za-z]{25,34}$')
+ local btc_wallet_re = rspamd_re.create_cached('^[13][1-9A-Za-z]{25,34}$')
+ local ltc_wallet_re = rspamd_re.create_cached('^[LM3][a-km-zA-HJ-NP-Z1-9]{26,33}$')
local words_matched = {}
local valid_wallets = {}
for _,part in ipairs(task:get_text_parts() or {}) do
- local pw = part:filter_words(wallet_re, 'raw', 3)
+ local pw = part:filter_words(btc_wallet_re, 'raw', 3)
if pw and #pw > 0 then
for _,w in ipairs(pw) do
words_matched[#words_matched + 1] = w
end
end
+
+ pw = part:filter_words(ltc_wallet_re, 'raw', 3)
+ if pw and #pw > 0 then
+ for _,w in ipairs(pw) do
+ -- Do not validate, LTC regexp is more strict than BTC one, maybe do it in future
+ valid_wallets[#valid_wallets + 1] = w
+ end
+ end
end
for _,word in ipairs(words_matched) do