Any guide or tips for migrating from Spamassassin to Rspamd?

Richard G

Verified User
Joined
Jul 6, 2008
Messages
14,977
Location
Maastricht
We would like to migrate from Spamassassin to Rspamd.
The installation commands are not too hard to do, but what other things need to be done, what do I have to keep in mind?

Also, at this moment, several users have their own settings so the user_prefs or custom .cf files. Can these be converted to rspamd or does this work differently and I need to thrown them away (or backup in case I need to go back to SA)?

At this moment I also have a post creation script which creates some default settings on creation of a user account. Can this also be done for rspamd?

I don't have a test server at the moment and need to migrate a live server so any help/tips/guides are greatly appreciated!
 
Treat this as two separate things: DirectAdmin-managed user settings and hand-written SpamAssassin rules.

Rspamd is a drop-in replacement at DA's integration layer. DA continues to use the existing user_prefs as its source and generates /etc/rspamd/users.d/USERNAME.conf. Arbitrary SA .cf/header/meta rules are not Rspamd syntax, so inventory and back them up; translate those manually into Rspamd local.d/override.d rather than copying them.

The documented switch is:

da build set spamd rspamd
da build rspamd

Before doing it on a live box, back up the current CustomBuild, Exim and SA configs. Afterward, rewrite one user's Rspamd config from DA, compare it, then test a normal message plus GTUBE before rewriting all users. Also verify Exim headers, Rspamd logs and queue flow.

For rollback, DA documents:

da build set spamd spamassassin
da build remove_rspamd
da build spamassassin
da build exim_conf

Your post-create hook is probably no longer needed merely to enable scanning: DA 1.669+ enables it by default when allowed. If the hook adds custom defaults, keep the intent but generate DA/Rspamd settings, not raw SA rules.

Official guide: https://docs.directadmin.com/other-hosting-services/preventing-spam/incoming-spam.html
 
First of all, thank you *very* much for your quick reply and your insights!

then test a normal message plus GTUBE
What is GTUBE? You mean mail to/from gmail or something else?

Is there a good command to rewrite all users? I'm not that good in those replace all commands.

There are 3 things I created by default by that posthook previously. That was a filter, filter.conf and user_prefs file. But I just remembered that the hook was deleted some time ago and I switched to a more modern spam_defaults.json file in the custom template directory with this content.
Code:
{
        "high_score" : "5",
        "high_score_block" : "yes",
        "rewrite_subject" : "1",
        "subject_tag" : "*****SPAM*****",
        "where" : "userspamfolder",
        "report_safe" : "1"
}
So nothing very special, just rewriting subject and setting the score a bit different.

As far as I know I only made some custom changes in the local.cf file from SA.

da build remove_rspamd
Just to be sure. Don't I also need to do a "da build remove_spamassassin" once rspamd is running well?

before rewriting all users
You have a command for that by any chance?
 
Back
Top