mox/junk
Mechiel Lukkien 17baf9a883
junk filter: fix adjusting word counts after train/untrain
after seeing some junk messages pass the filter, i investigated word counts in
junkfilter.db. i had seen suspicious counts that were just around powers of
two. did not make sense at the time. more investigating makes it clear: instead
of setting new word counts when updating the junk filter, we were adding the
new value to the current value (instead of just setting the new value). so the
counts got approximately doubled when being updated.

users should retrain the junk filter after this update using the "retrain"
subcommand.

this also adds logging for the hypothetical case where numbers would get
decreased below zero (which would wrap around due to uints).

and this fixes junk filter tests that were passing wrong parameters to
train/untrain...
2024-12-07 16:53:53 +01:00
..
bloom.go mox! 2023-01-30 14:27:06 +01:00
bloom_test.go mox! 2023-01-30 14:27:06 +01:00
filter.go junk filter: fix adjusting word counts after train/untrain 2024-12-07 16:53:53 +01:00
filter_test.go junk filter: fix adjusting word counts after train/untrain 2024-12-07 16:53:53 +01:00
parse.go switch to slog.Logger for logging, for easier reuse of packages by external software 2023-12-14 13:45:52 +01:00
parse_test.go switch to slog.Logger for logging, for easier reuse of packages by external software 2023-12-14 13:45:52 +01:00