mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 13:44:37 +03:00
explicitly store in a Message whether it was delivered to the rejects mailbox
soon, we can have multiple rejects mailboxes. and checking against the configured rejects mailbox name wasn't foolproof to begin with, because it may have changed between delivery to the rejects mailbox and the message being moved. after upgrading, messages currently in rejects mailboxes don't have IsReject set, so they don't get the special rejecs treatment when being moved. they are removed from the rejects mailbox after some time though, and newly added rejects will be treated correctly. so this means some existing messages wrongly delivered to the rejects mailbox, and moved out, aren't used (for a positive signal) for future deliveries. saves a bit of complexity in the implementation. i think the tradeoff is worth it. related to discussion in issue #50
This commit is contained in:
@ -3215,10 +3215,11 @@ func (c *conn) cmdxCopy(isUID bool, tag, cmd string, p *parser) {
|
||||
m.CreateSeq = modseq
|
||||
m.ModSeq = modseq
|
||||
m.MailboxID = mbDst.ID
|
||||
if mbSrc.Name == conf.RejectsMailbox && m.MailboxDestinedID != 0 {
|
||||
if m.IsReject && m.MailboxDestinedID != 0 {
|
||||
// Incorrectly delivered to Rejects mailbox. Adjust MailboxOrigID so this message
|
||||
// is used for reputation calculation during future deliveries.
|
||||
m.MailboxOrigID = m.MailboxDestinedID
|
||||
m.IsReject = false
|
||||
}
|
||||
m.TrainedJunk = nil
|
||||
m.JunkFlagsForMailbox(mbDst.Name, conf)
|
||||
@ -3383,10 +3384,11 @@ func (c *conn) cmdxMove(isUID bool, tag, cmd string, p *parser) {
|
||||
om.ModSeq = modseq
|
||||
|
||||
m.MailboxID = mbDst.ID
|
||||
if mbSrc.Name == conf.RejectsMailbox && m.MailboxDestinedID != 0 {
|
||||
if m.IsReject && m.MailboxDestinedID != 0 {
|
||||
// Incorrectly delivered to Rejects mailbox. Adjust MailboxOrigID so this message
|
||||
// is used for reputation calculation during future deliveries.
|
||||
m.MailboxOrigID = m.MailboxDestinedID
|
||||
m.IsReject = false
|
||||
}
|
||||
m.UID = uidnext
|
||||
m.ModSeq = modseq
|
||||
|
Reference in New Issue
Block a user