Skip to content

Commit b312aee

Browse files
committed
Train spam messages as ham when the sender is in the user's address book
1 parent 4146e59 commit b312aee

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/pages/config/schema/spamfilter.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ impl Builder<Schemas, ()> {
3131
.help("Whether to automatically update the spam filter rules")
3232
.default("false")
3333
.typ(Type::Boolean)
34+
.new_field("spam-filter.card-is-ham")
35+
.label("Do not classify messages from contacts as spam")
36+
.help(concat!(
37+
"Never classify messages as spam if they are sent ",
38+
"from addresses present in the user's address book.",
39+
))
40+
.default("true")
41+
.typ(Type::Boolean)
3442
.build()
3543
.new_field("spam-filter.resource")
3644
.label("Rules URL")
@@ -185,6 +193,7 @@ impl Builder<Schemas, ()> {
185193
"spam-filter.score.discard",
186194
"spam-filter.score.reject",
187195
"spam-filter.enable",
196+
"spam-filter.card-is-ham",
188197
])
189198
.build()
190199
.new_form_section()
@@ -241,6 +250,15 @@ impl Builder<Schemas, ()> {
241250
.default("true")
242251
.typ(Type::Boolean)
243252
.build()
253+
.new_field("spam-filter.bayes.auto-learn.card-is-ham")
254+
.label("Train as ham messages from senders in the address book")
255+
.help(concat!(
256+
"If a message is classified as spam, ",
257+
"but the sender is in the address book, learn it as ham."
258+
))
259+
.default("true")
260+
.typ(Type::Boolean)
261+
.build()
244262
.new_field("spam-filter.bayes.classify.balance")
245263
.label("Balance")
246264
.help("Keep difference for spam/ham learns for at least this value")
@@ -438,6 +456,7 @@ impl Builder<Schemas, ()> {
438456
"spam-filter.bayes.account.score.spam",
439457
"spam-filter.bayes.account.score.ham",
440458
"spam-filter.bayes.account.enable",
459+
"spam-filter.bayes.auto-learn.card-is-ham",
441460
])
442461
.build()
443462
.new_form_section()

0 commit comments

Comments
 (0)