rspamd content (body) checks

Für Modifikationen in und um KeyHelp.
Post Reply
User avatar
Ralph
Posts: 1245
Joined: Mon 30. Mar 2020, 16:14

rspamd content (body) checks

Post by Ralph »

Das Fuzzy-Hashes module ist mir etwas zu pauschal und unpräzise ...
ich möchte gerne explizit wie mit den guten alten body_checks für postfix arbeiten und hab da eine mögliche Lösung gefunden.
/\bKEYWORD\b/i

Code: Select all

nano /etc/rspamd/local.d/content.map
# add:

#content filter
/\bBreasts\b/i
/\bBreast\.com\b/i
# The blank line at the end is REQUIRED.

Code: Select all

nano /etc/rspamd/local.d/multimap.conf
# add

reject_content {
type = "content";
filter = "text";
map = "${LOCAL_CONFDIR}/local.d/content.map";
symbol = "REJECT_CONTENT";
prefilter = true;
action = "reject";
regexp = true;
}

Code: Select all

systemctl restart rspamd
Zum testen folgende 2 emails senden, einmal mit einem URL part (domain name) und einmal mit Keyword im Text

Code: Select all

Test mail 1

Test check via URL:
https://www.breast.com/ww/sdfrtrzU7lager.com

Test mail 2

Test check via keyword
The Breasts have a test 
Bei einer phishing email braucht es also nur den domain name um einen reject zu erreichen ...
Ich teste noch einige Keyword Kombi, aber ich denke mal so kann es in etwa verwendet werden mit rspamd
User avatar
Ralph
Posts: 1245
Joined: Mon 30. Mar 2020, 16:14

Re: rspamd content (body) checks

Post by Ralph »

so ist es hübscher :lol:

Code: Select all

CONTENT_VIOLATION {
          type = "content";
          filter = "text";
          map = "${LOCAL_CONFDIR}/local.d/content.map";
          symbol = "CONTENT_VIOLATION";
          prefilter = true;
          action = "reject";
          regexp = true;
}
pandinusimperator
Posts: 51
Joined: Tue 24. Aug 2021, 22:34

Re: rspamd content (body) checks

Post by pandinusimperator »

Ralph wrote: Tue 4. Mar 2025, 18:44 so ist es hübscher :lol:

Code: Select all

CONTENT_VIOLATION {
          type = "content";
          filter = "text";
          map = "${LOCAL_CONFDIR}/local.d/content.map";
          symbol = "CONTENT_VIOLATION";
          prefilter = true;
          action = "reject";
          regexp = true;
}
Funktioniert gut!
Hab unten noch ein

Code: Select all

score = 10.0
hinzugefügt, obwohl auch so rejected wird, damit der auch in der rspamd-History als CONTENT_VIOLATION(10) in rot angezeigt wird ... :D

Allerdings wird die multimap.conf wohl überschrieben werden.
User avatar
Ralph
Posts: 1245
Joined: Mon 30. Mar 2020, 16:14

Re: rspamd content (body) checks

Post by Ralph »

ja, bei einem KH Update könnte die multimap überschrieben werden ...

oben in der sample content.map ist es nicht ganz richtig dargestellt ... die Leerzeilen:
/\bBreasts\b/i
(blank line)
The blank line at the end is REQUIRED.
https://github.com/rspamd/rspamd/issues/1831
Post Reply