Rspamd: [BUG] Spamtrap Module not learning bayes if action is set explicitly

Created on 13 Oct 2020  路  6Comments  路  Source: rspamd/rspamd

Prerequisites

Describe the bug
If you activate spamtrap module in rspamd 2.6 on debian, bayes filter is not trained if you set action = "no action" explicitly

Steps to Reproduce

  1. Enable Spamtrap module with this configuration

learn_spam = true;
enabled = true;
action = "no action";
score = 1.0;
map = file://$LOCAL_CONFDIR/local.d/spamtrap.map

  1. Configure map with regex
    /^[email protected]/

  2. Send Mail to [email protected] and verify bayes learning in the WebUI

  • You will see in History that SPAMTRAP symbol is added to the mail

  • Bayes learns will not increase.

  • you can see in the logs
    2020-10-11 22:28:58 #14557(normal) <61ddee>; task; rspamd_task_process: learn error: Cannot learn statistics when passthrough result has been set; not classified

Expected behavior
Bayes learns are increasing by 1 for each spamtrapped mail

Versions

Rspamd daemon version 2.6

Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster

CPU
Intel Xeon Processor (Skylake, IBRS)

Additional Information

If you comment the lines

action = "no action"

score = 1.0

The passthrough error is not logged, bayes learn works and you can see in the debug log of spamtrap
default: F (no action)

The documentation clearly states bayes learns should work with action and score set explicitly:
https://rspamd.com/doc/modules/spamtrap.html

bug wontfix

Most helpful comment

I agree, that this passthrough stuff might be confusing. I have one idea to improve it, so I would probably implement it at some point.

All 6 comments

It is working as intended. Bayes learning and many other things that rely on full message analysis are disabled if you set passthrough result.

Thank you for the clarification. I might propose a change in the documentation. What is the purpose of spamtrap module with defined action setting passthrough result, if the message is not learned as spam?

I agree, that this passthrough stuff might be confusing. I have one idea to improve it, so I would probably implement it at some point.

Thanks, I just stumbled across this. :-)

I have noticed that there are messages with SPAMTRAP symbol being rejected. If I set action = "no action" in spamtrap module, bayes is not being learned. How can I prevent rejection in some other way? It feels like rejecting spamtrapped mails kind of beats the purpose of a spamtrap address. Am I missing something?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings