when moving a message out of a Rejects mailbox, mark the message as "not seen" so stands out in the destination mailbox (e.g. inbox)

we set the flag both for move in imap and in webmail.

this also ensures the "MailboxDestinedID", used for per-mailbox reputation
analysis, is set in more reject-situations. before this change, some rejects
(such as based on DMARC reject) wouldn't result in reputation being used after
having been moved the message out of the rejects mailbox.

in the future, we need more tests for scenario's like this...

for issue #63 reported by x8x
may also help with issue #64
This commit is contained in:
Mechiel Lukkien
2023-09-22 15:43:25 +02:00
parent 2ec8c79e10
commit a0f3856e40
3 changed files with 48 additions and 23 deletions

View File

@ -3378,9 +3378,7 @@ func (c *conn) cmdxMove(isUID bool, tag, cmd string, p *parser) {
xserverErrorf("internal error: got uid %d, expected %d, for index %d", m.UID, uids[i], i)
}
mc := m.MailboxCounts()
mbSrc.Sub(mc)
mbDst.Add(mc)
mbSrc.Sub(m.MailboxCounts())
// Copy of message record that we'll insert when UID is freed up.
om := *m
@ -3394,7 +3392,9 @@ func (c *conn) cmdxMove(isUID bool, tag, cmd string, p *parser) {
// is used for reputation calculation during future deliveries.
m.MailboxOrigID = m.MailboxDestinedID
m.IsReject = false
m.Seen = false
}
mbDst.Add(m.MailboxCounts())
m.UID = uidnext
m.ModSeq = modseq
m.JunkFlagsForMailbox(mbDst, conf)