Reject Viruses from Logged-in Users in Rspamd

· 136 words · 1 minute read

I’m a big fan of Rspamd for filtering your emails for spam. One thing I wanted to achieve is to reject viruses from logged-in users. This would mainly happen if a user machine is compromised. Rspamd makes this quite easy using the user settings module.

Using the snipped from that website, you can reject all emails with a score higher than e.g. 15. On the other hand, greylisting and adding a spam header is disabled for authenticated users.

authenticated {
    priority = high;
    authenticated = yes;
    apply {
        groups_disabled = ["rbl", "spf"];
        actions {
            reject = 15.0;
            greylist = null;
            "add header" = null;
        }
    }
}

I also recommend looking at the Mailcow Github repo. They make it easy to run your own mailserver and have very thoughful config files for Rspamd, Postfix and others.