when moving message to mailbox with special-use flag "Junk", mark the message as junk too, for retraining

i had been using the AutomaticJunkFlags option, so hadn't noticed the special use flag wasn't used.
This commit is contained in:
Mechiel Lukkien
2023-09-21 15:19:11 +02:00
parent 79774c15ec
commit 2e16d8025d
5 changed files with 13 additions and 8 deletions

View File

@ -352,7 +352,7 @@ func importctl(ctx context.Context, ctl *ctl, mbox bool) {
// We set the flags that Deliver would set now and train ourselves. This prevents
// Deliver from training, which would open the junk filter, change it, and write it
// back to disk, for each message (slow).
m.JunkFlagsForMailbox(mb.Name, conf)
m.JunkFlagsForMailbox(mb, conf)
if jf != nil && m.NeedsTraining() {
if words, err := jf.ParseMessage(p); err != nil {
ctl.log.Infox("parsing message for updating junk filter", err, mlog.Field("parse", ""), mlog.Field("path", origPath))