mirror of
https://github.com/mjl-/mox.git
synced 2024-12-26 16:33:47 +03:00
bugfix: imapserver "append" command: properly account for message size when bare newlines ("\n") are converted to crlf ("\r\n")
the original size, with bare newlines, was stored in the database, not the actual adjusted file size. this caused failures when reading the message. users may want to run "mox fixmsgsize <account>" if they imported messages from another account over IMAP. reported by daftaupe, thanks!
This commit is contained in:
parent
7c1879da82
commit
02eb7b5033
2 changed files with 5 additions and 1 deletions
|
@ -59,6 +59,10 @@ func TestAppend(t *testing.T) {
|
||||||
tc2.xuntagged(imapclient.UntaggedExists(2))
|
tc2.xuntagged(imapclient.UntaggedExists(2))
|
||||||
tc2.xcodeArg(imapclient.CodeAppendUID{UIDValidity: 1, UID: 2})
|
tc2.xcodeArg(imapclient.CodeAppendUID{UIDValidity: 1, UID: 2})
|
||||||
|
|
||||||
|
tc2.transactf("ok", "append inbox (\\Seen) \" 1-Jan-2022 10:10:00 +0100\" UTF8 ({31+}\r\ncontent-type: text/plain;\n\ntest)")
|
||||||
|
tc2.xuntagged(imapclient.UntaggedExists(3))
|
||||||
|
tc2.xcodeArg(imapclient.CodeAppendUID{UIDValidity: 1, UID: 3})
|
||||||
|
|
||||||
// Messages that we cannot parse are marked as application/octet-stream. Perhaps
|
// Messages that we cannot parse are marked as application/octet-stream. Perhaps
|
||||||
// the imap client knows how to deal with them.
|
// the imap client knows how to deal with them.
|
||||||
tc2.transactf("ok", "uid fetch 2 body")
|
tc2.transactf("ok", "uid fetch 2 body")
|
||||||
|
|
|
@ -2732,7 +2732,7 @@ func (c *conn) cmdAppend(tag, cmd string, p *parser) {
|
||||||
Received: tm,
|
Received: tm,
|
||||||
Flags: storeFlags,
|
Flags: storeFlags,
|
||||||
Keywords: keywords,
|
Keywords: keywords,
|
||||||
Size: size,
|
Size: mw.Size,
|
||||||
}
|
}
|
||||||
|
|
||||||
mb.Add(m.MailboxCounts())
|
mb.Add(m.MailboxCounts())
|
||||||
|
|
Loading…
Reference in a new issue