mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 08:34:40 +03:00
add message size consistency check
the bulk of a message is stored on disk. a message prefix is stored in the database (for prefixed headers like "Received:"). this adds a check to ensure Size = prefix length + on-disk file size. verifydata also checks for this now. and one older and one new (since yesterday) bug was found. the first when appending a message without a header/body section (uncommon). the second when sending messages from webmail with localserve (uncommon).
This commit is contained in:
@ -2731,7 +2731,7 @@ func (c *conn) cmdAppend(tag, cmd string, p *parser) {
|
||||
Received: tm,
|
||||
Flags: storeFlags,
|
||||
Keywords: keywords,
|
||||
Size: size,
|
||||
Size: size + int64(len(msgPrefix)),
|
||||
MsgPrefix: msgPrefix,
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user