On Fri, 2021-04-23 at 16:28 -0400, Steve Dondley wrote: > I'm experimenting with writing a library of my own SA rules and > scores. > I do this on a separate computer, which has Spamassassin installed but not linked into anything else. It also has a copy of all the live SA configuration files. Alongside this I have a directory filled with examples of spam to function as testing input.
Along with I have a bash script or two which is used to do things like: 1) start SA in debug mode to check the testing config for errors. No messages are processed - its just looking for configuration errors. 2) run SA against a spam sample and only display the list of spam hits 3) run SA against a spam sample and display the entire output message using less so it can be scrolled through 4) run SA against the complete spam collection and only display references to messages which are not scored as spam 5) replace the live SA configuration with with the current testing configuration, i.e. make the most set of changes live. In practise (1) through (3) are east to combine into a single script with an option to select the required action while (4) and (5) are best kept separate. It helps a lot of to name the items in the spam collection to relate each set of similar spam to the local rule that's intended to trap this spam type. > I'd like to be sure that the rules I write don't turn ham into spam > and vice versa. > It won't if you test the rules against related spam and give some thought to the score you apply to each rule. > I imagine a utility like this must exists so figured I'd ask here > before re-inventing the wheel and writing my own (probably bugg) > script. > The sort of scripts I use are fairly short and simple. > > The script would need to check against all email files in .INBOX.* and > .Spam directory in a user's IMAP directory. > No. Treat this like any other code development project: use a rule development SA installation like I describe so you never develop rules using the live mail stream. This way your rules will be better written and tested and you'll cause fewer false positives in your live mail stream. Martin