Question
Is it possible to create custom rules for SpamAssassin?
Answer
It is possible to create custom rules for SpamAssassin that operate per-user. In order to do so, custom user rules must be enabled in the SpamAssassin configuration, but this comes with the following warning from the maintainers of SpamAssassin:
Warning: This setting allows users to create rules (and only rules) in their user_prefs files for use with spamd. It defaults to off, because this could be a severe security hole. It may be possible for users to gain root level access if spamd is run as root. It is NOT a good idea, unless you have some other way of ensuring that users' tests are safe. Don't use this unless you are certain you know what you are doing. Furthermore, this option causes SpamAssassin to recompile all the tests each time it processes a message for a user with a rule in the user_prefs file, which could have a significant effect on server load. It is not recommended.
To enable user rules, create a custom SpamAssassin configuration file with the following instructions:
How to Make a Custom Configuration File for SpamAssassin
Add the following to the configuration file:
# allow_user_rules 1
Custom rules can be added to the following file (replace $USER with the cPanel username):
# /home/$USER/.spamassassin/user_prefs
Additional Resources:
SpamAssassin Wiki - Writing New Rules
SpamAssassin Wiki - Writing New Rules Advanced
Comments
0 comments
Article is closed for comments.