]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Feature] Add task:get_cta_urls() API for proper CTA domain extraction
authorVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 6 Nov 2025 10:54:58 +0000 (10:54 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 6 Nov 2025 10:54:58 +0000 (10:54 +0000)
commitaa85f7395debd38928b5541c8d63b7841ac8e92e
tree734d296cef8e24e2c71305f6edddebe976f12e44
parent97082fbe01fd43f842a8a3a071d81007e44d6bd4
[Feature] Add task:get_cta_urls() API for proper CTA domain extraction

- C code (message.c): collect top CTA URLs per HTML part by button weight,
  store in task mempool variable "html_cta_urls"
- Lua API (lua_task.c): add task:get_cta_urls([max_urls]) method
- llm_search_context: use new API instead of reimplementing CTA logic in Lua
- Benefits: single source of truth for CTA logic, uses C knowledge of HTML
  structure and button weights, cleaner Lua code

This provides proper architecture where C code handles HTML structure analysis
and Lua adds domain filtering (blacklists, infrastructure domains, etc.)
lualib/llm_search_context.lua
src/libmime/message.c
src/lua/lua_task.c