[Rspamd-Users] Force a Spam Score

Tino Hendricks t.hendricks at interpool.de
Tue Sep 17 07:42:09 UTC 2024


Hi Casey,

> Am 16.09.2024 um 19:59 schrieb Casey Bralla via Users <users at lists.rspamd.com>:
> 
> Thanks, GD.  I'll read this section of the docs.  (I had seen that module, but didn't really understand it.)
> 
> But to clarify what I'm trying to do:
> 
> * Trigger a spam determination by forcing an eMail to get a spam score
>    > ~10, no matter what the contents of the eMail or the headers. 
>   This is for testing only, and will not be used in a production
>   environment.
> 
> I'm in an isolated virtual test environment, so the system will NEVER see real spam (unless I send it).  This is for testing only, since I need to see how my sieve program works to isolate the spam.
> 
> Once I have completed testing and rolled out the real server into the real internet, I will disable this test setting so eMails can be evaluated and scored properly.
> 
> Thanks for your help!!
> 
> Casey
> 
> On 9/16/24 12:57 PM, G.W. Haywood wrote:
>> Hi there,
>> 
>> On Mon, 16 Sep 2024, Casey Bralla via Users wrote:
>> 
>>> I'm setting up a system where the spam is never rejected, but will be filtered by dovecot-sieve.  But I'm having trouble testing it in a controlled virtual environment because none of the emails I'm sending are being judged as spam (even though I'm taking them from my extensive collection of saved spam).
>>> 
>>> Is there a way I can force a particular score in an eMail for testing purposes?
>>> 
>>> I know I can use GTUBE, but these force actions, and don't allow me to test my sieve scripts.
>> 
>> I do not really understand from your description exactly what the
>> problem is, but perhaps the spamtrap module will solve it:
>> 
>> https://rspamd.com/doc/modules/spamtrap.html
>> 
>> You could just list all the domains in your spam in the map file.
>> 
>> HTH
>> 


I understand you just need a trigger for your test environment from rspamd, regardless of the input.

I don’t know about a switch that just classifies everything as spam, but I think „hardcore version“ could be

/etc/rspamd/local.d/multimap.conf:
FORCE_SPAM {
  type = „from";
  map = "${LOCAL_CONFDIR}/local.d/match_all_email.map";
  prefilter = true;
  action = "add header";
  regexp = true;
  score = 10.0; #or 20 or 100...
}

/etc/rspamd/local.d/match_all_email.map:
/.*@.*/

My 2ct

Tino





More information about the Users mailing list