mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 17:44:35 +03:00
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:
@ -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.
|
||||
|
Reference in New Issue
Block a user