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

@ -3227,7 +3227,7 @@ func (c *conn) cmdxCopy(isUID bool, tag, cmd string, p *parser) {
m.IsReject = false
}
m.TrainedJunk = nil
m.JunkFlagsForMailbox(mbDst.Name, conf)
m.JunkFlagsForMailbox(mbDst, conf)
err := tx.Insert(&m)
xcheckf(err, "inserting message")
msgs[uid] = m
@ -3397,7 +3397,7 @@ func (c *conn) cmdxMove(isUID bool, tag, cmd string, p *parser) {
}
m.UID = uidnext
m.ModSeq = modseq
m.JunkFlagsForMailbox(mbDst.Name, conf)
m.JunkFlagsForMailbox(mbDst, conf)
uidnext++
err := tx.Update(m)
xcheckf(err, "updating moved message in database")