maildroprc DELETE_THRESHOLD="7.0" default for new accounts - rspamd deletes mail instead of using .Spam folder

Hello. It has come to my attention that all my sites and new sites created get DELETE_THRESHOLD=“7.0”.

It’s an awfully low limit because this would mean that all mail that get 7 or higher in score would get deleted and not put inside of .Spam folder. Rspamd currently marks mail that have a score of 8 or higher as SPAM and deletes those that have a score of 7 or higher.

This seems like a miss configuration. Would you please advice?

cat /home/virtual/site1/fst/etc/maildroprc

MAX_SCAN=524288
DELETE_THRESHOLD="7.0"

if ($SIZE < $MAX_SCAN)
{
    exception {
        #xfilter "/usr/bin/spamc -u $LOGNAME"
    }
}

if (/^X-Spam(?:-Flag)?: Yes/)
{
    /^X-Spam-Score: ([-\.\d]+)/
    if ($MATCH1 >= $DELETE_THRESHOLD)
    {
        to /dev/null
    }
    else
    {
        to Mail/.Spam/
    }
}

Relevant command outputs

cpcmd scope:get mail.spam-filter
rspamd

It depends on what spam filtering is used at install. SpamAssassin and rspamd have different scoring curves. When a server is provisioned with SpamAssassin, the default threshold is 7. If rspamd is used, the threshold is 25. Copy-up behavior of storage/opcenter/filelists/siteinfo/etc/maildroprc means that when an account is provisioned, this value isn’t adjusted even if you change the spam filter provider.

Ideally this value should be an environment variable passed to maildrop that can be set at runtime and overridden on a per-site basis in siteXX/fst/etc/maildroprc. I’ll see what can be done; maildrop (LDA) doesn’t accept env vars directly from Postfix (MTA).

Alright then

sed -i 's/7.0/25/g' /home/virtual/site*/fst/etc/maildroprc /usr/local/apnscp/storage/opcenter/filelists/siteinfo/etc/maildroprc

I fixed the issue on my server now for new/existing accounts. Good to know that this command have to be run if switching to rspamd

Yes, that would work. Additionally, new release on edge allows you to control this setting globally:

cpcmd scope:set mail.spam-deletion-threshold 14

Sites will still be able to override this value in siteXX/fst/etc/maildroprc. Existing sites that have a maildroprc will not be affected by this change but can be deleted en masse with:

sed -i '/^DELETE_THRESHOLD/d' /home/virtual/site*/fst/etc/maildroprc

The value is inherited now from maildrop_delete_threshold in /etc/postfix/main.cf, which in turn is managed by mail.spam-deletion-threshold Scope.