msimerson / Mail-Toaster-6

Mail Toaster 6
https://github.com/msimerson/Mail-Toaster-6/wiki
BSD 3-Clause "New" or "Revised" License
46 stars 16 forks source link

Add rspamd milters #494

Closed Infern1 closed 1 year ago

Infern1 commented 2 years ago

I disabled spamassassin and I know see mails come through where rspamd marks them as spam

Enable the function of rspamd to add headers.

https://rspamd.com/doc/modules/milter_headers.html

When I add this to local.d/milter_headers.conf

# local.d/milter_headers.conf:

# Options

# Add "extended Rspamd headers" (default false) (enables x-spamd-result, x-rspamd-server & x-rspamd-queue-id routines)
extended_spam_headers = true;

# List of headers to be enabled for authenticated users (default empty)
# authenticated_headers = ["authentication-results"];

# List of headers to be enabled for local IPs (default empty)
# local_headers = ["x-spamd-bar"];

# Set false to always add headers for local IPs (default true)
# skip_local = true;

# Set false to always add headers for authenticated users (default true)
# skip_authenticated = true;
#
use = ["x-spamd-bar", "x-spamd-result", "x-spam-status"];

The following header is added: X-Spam-Status: No, score=-0.50

If this header is there our default mailfilter will act on it

if ( /X-Spam-Status: Yes/:h)
{
    if ( /X-Spam-Status: Yes, (hits|score)=([\d\.\-]+)\s/:h)
    {
...
msimerson commented 2 years ago

This suggestion interferes with the use of spamassassin and rspamd together. Better would be to update the mailfilter to also check for the existing X-Rspamd-Score header, and maybe also the X-Haraka-Karma header.