mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 11:44:38 +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:
@ -215,7 +215,7 @@ func Add(ctx context.Context, log *mlog.Log, senderAccount string, mailFrom, rcp
|
||||
err := acc.Close()
|
||||
log.Check(err, "closing account")
|
||||
}()
|
||||
m := store.Message{Size: size}
|
||||
m := store.Message{Size: size, MsgPrefix: msgPrefix}
|
||||
conf, _ := acc.Conf()
|
||||
dest := conf.Destinations[mailFrom.String()]
|
||||
acc.WithWLock(func() {
|
||||
|
Reference in New Issue
Block a user