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

@ -537,7 +537,7 @@ func importMessages(ctx context.Context, log *mlog.Log, token string, acc *store
// 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() {
trainMessage(m, p, pos)
}