make most fields of junk filter configurable by account itself

finally remove the message saying that not all config options can be configured
through the web interface.
This commit is contained in:
Mechiel Lukkien
2024-05-09 22:43:14 +02:00
parent ebb8ad06b5
commit 3f000fd4e0
7 changed files with 207 additions and 4 deletions

View File

@ -28,6 +28,7 @@ import (
"github.com/mjl-/mox/config"
"github.com/mjl-/mox/dns"
"github.com/mjl-/mox/junk"
"github.com/mjl-/mox/mlog"
"github.com/mjl-/mox/mox-"
"github.com/mjl-/mox/queue"
@ -463,6 +464,18 @@ func TestAccount(t *testing.T) {
api.AutomaticJunkFlagsSave(ctx, true, "^(junk|spam)", "^(inbox|neutral|postmaster|dmarc|tlsrpt|rejects)", "")
api.AutomaticJunkFlagsSave(ctx, false, "", "", "")
api.JunkFilterSave(ctx, nil)
jf := config.JunkFilter{
Threshold: 0.95,
Params: junk.Params{
Twograms: true,
MaxPower: 0.1,
TopWords: 10,
IgnoreWords: 0.1,
},
}
api.JunkFilterSave(ctx, &jf)
api.RejectsSave(ctx, "Rejects", true)
api.RejectsSave(ctx, "Rejects", false)
api.RejectsSave(ctx, "", false) // Restore.