[Rspamd-Users] How to reject email subject/body message?

Andrew Lewis rspamd-users at judo.za.org
Fri Oct 20 21:21:19 UTC 2023


Hi,

Conventionally regex rules are defined in Lua but they can be defined
in configuration, the syntax is the same:

~~~
# local.d/regexp.conf

BADWORD_SUBJECT {
  re = 'Subject=/\bbadword\b/i{header}';
}

BADWORD_BODY {
  re = '/\bbadword\b/i{mime}';
}

BADWORD_BODY_OR_SUBJECT {
  re = '/^badword$/{words}';
  description = "Has badword in body or subject";
  score = 15;
  group = "local";
}
~~~

You can reject mail by adding high scores or if you're very particular
about it with force_actions module:
https://rspamd.com/doc/modules/force_actions.html

Best,
-AL.

On Fri, 2023-10-20 at 12:57 -0700, Stanislav via Users wrote:
> Thanks!
> 
> So, just to confirm my thought-  at the moment, Rspamd doesn't have
> any 
> configuration-based approach to achieve my goals, so as a result, I
> must 
> write my own Lua script and plug it into the regexp module. Sounds
> about 
> right?
> 
> Best
> 
> > See:
> > 
> > https://rspamd.com/doc/modules/regexp.html
> > 
> > -- sw
> > 
> > On Fri, Oct 20, 2023 at 11:48 AM Stanislav via Users 
> > <users at lists.rspamd.com>
> > wrote:
> > 
> > > Greetings,
> > > 
> > > I'm relatively new to spam filtering systems.
> > > Could somebody please point me to the documentation or give an
> > > example
> > > of how to perform the following actions:
> > > - Reject an email with specific text in a body message.
> > > - Reject an email with specific text in a subject.
> > > 
> > > Thanks a lot
> > > --
> > > Users mailing list
> > > Users at lists.rspamd.com
> > > https://lists.rspamd.com/mailman/listinfo/users
> > > 



More information about the Users mailing list